ADSM-L

Re: SQL and ADSM ACT LOG Queries

1999-12-23 10:27:55
Subject: Re: SQL and ADSM ACT LOG Queries
From: GERARD Jean Michel <jm.gerard AT COFINOGA DOT FR>
Date: Thu, 23 Dec 1999 16:27:55 +0100
On a UNIX client I am used to call dayly the following script that build a
macro previous to call it

rm actlog.mac
echo set SQLDISPLAYMODE WIDE                    > /home/user1/actlog.mac
echo 'select * from actlog where date_time>-'  >> /home/user1/actlog.mac
echo \'`date --date '1 day ago' '+%Y-%M-%d %H:%M'`\'- >>
/home/user1/actlog.mac
echo '> /home/gerjm/actlog.txt' >> /home/user1/actlog.mac

/usr/adsm/dsmadmc -optfile=opt.sys -id=user -password=userpw -comma macro
c:\temp\adsm\actlog.mac        
c:\temp\adsm\actlog.mac        

I hope it helps,
Jean-Michel Gérard
COFINOGA Mérignac France
DSI / Exploitation


> -----Message d'origine-----
> De:   Bacchi Matt VENDOR [SMTP:v2bacchi AT BTV.IBM DOT COM]
> Date: jeudi 23 décembre 1999 14:43
> À:  ADSM-L AT VM.MARIST DOT EDU
> Objet:        Re: SQL and ADSM ACT LOG Queries
> 
> Michael,
> It sounds like you want to do something like this:
> 
>         select * from actlog where date_time \> '1999-12-22
> 00:00:00.000000' 
> and date_time \< '1999-12-23 00:00:00.000000'
> 
> Unfortunately the select command is quite picky about the format of the
> date 
> field which you are attempting to match.  It needs to be in the format
> shown 
> above.  Also, this command is assuming you are using the interactive
> command 
> line client, not from a script.  In a script you need to escape all the 
> shell metacharacters, i.e. the asterisk, backslash, single quote....
> In the Korn shell, my command looks like this:
> 
>             open (SELECT,"dsmadmc -id=adsmadmin -password=$pw -SE=adsm2
> -outfile \"select date_time from actlog where msgno=1025 and > -outfile 
> \"select date_time from actlog where msgno=1025 and date_time \\>
> '$long_date' and message like '%ARCHIVEPOOL%'\" 2>&1|");
> 
> 
> Then I can take that SELECT filehandle and perform any operation on it.
> 
> Hope this helps.
> 
> -Matt
> 
> >Does anyone know how to limit sql queries to just one day of the activity
> log.
> >Currently, we can produce reports but they contain every record in the
> activity
> >log. We would like to be able to trim the data down to just one day, like
> >yesterday.  We want to automatically produce this report so the date
> command
> >should be something like "yesterday".  We don't know and can't figure
> this out.
> 
> 
> *---------------------------------------------------------*
> Matt Bacchi                              mbacchi AT us.ibm DOT com
> IBM Global Services                    v2bacchi AT btv.ibm DOT com
> D54V Server Infrastructure                   (802) 769-4072
> ADSM & AFS/DFS Backup                        (tie) 446-4072
<Prev in Thread] Current Thread [Next in Thread>