how to take the back up the log files for n days

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

how to take the back up the log files for n days

Post by sudhakar_viswa »

Hi,

how to take the back up the log files for n days

thanks,
sudhakar
i need to know datastage
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

This query may help you

Code: Select all

SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'
Where nn is the jobnumber.
Success consists of getting up just one more time than you fall.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Better to take the 'dsjob' approach as it is more 'future proof'. IMHO.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

hi loveojha2 ,

how can i execute this Code in unix

SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'

thanks,sudhakar
i need to know datastage
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You cannot, this is a command that needs to be executed in TCL or from the ADMINistrator command.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can, by invoking TCL from the command line.

Code: Select all

cd project_dir && . $DSHOME/dsenv && $DSHOME/bin/dssh "SELECT * FROM RT_LOGnn WHERE TIMESTAMP BETWEEN '2006-04-01' AND '2006-04-05';"
But, as Arnd suggests, this is not future proof. In the next release ("Hawk"), job logs are not stored in this fashion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi ray.wurlod and ArndW ,

Thanku.I want to store the result in unix file.how can i do that.


thanks,
sudhakar
i need to know datastage
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

how about a command like dsjob -logsum MyProjectName MyJobName > MyUnixTextFileName.txt from UNIX.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

hi ArndW ,

i want to execute this query in unix
SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'

and i should store this result into one text file in unix.

how to do that?

thanks,
sudhakar
i need to know datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Simply redirect output into your file using the ">" redirection operator.

Note, however, that SQL can not be executed from UNIX, no matter how much you may want to do so, because UNIX is not a database environment. You need some kind of wrapper, such as exemplified in earlier posts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply