Hi all,
I want to automate a set of activities i am doing daily.the activities in the order are:
1.loging in to the unix box.
2.sudo su - tsiap, give pwd
3. cd appsrv
4. cd log
5. run the below cmd one by one, if you find any query which has run for more than 5 secs, open the particular SQL log(sqllog_clrdg5q1 for queue1 & sqllog_clrdg5q2 for queue2) using less command(less <respective log file> and search with the process id to get the SQL.
command or query:cat sqllog_clrdg5q1 | grep SQL_ROUNDTRIP_TIME | cut -d' ' -f4,4,3,3,7,7,8,8 | sort -k 2,2n | tail -5
example ouput:#7835 27.892056 01/18/08 00:01:32
I open that particular process #7835 and copy the query in to word document.
I have to dod this for 4 servers ...so it is tiring and boring
Any idea's and pointers on how this can be implemented are welcome
Thanks in advance,
Cybersandex.