-
hi all
can anyboby help me to make shell scripts to do
1.Maintanence of alert log files-to have only last two months of log files
2.maintanence of listner.log and sqlnet.log files to have only two weeks of logs.
meaning Scripts to delete log files everymonth/2weeks.
I badly need those immediatly to implement in our office.(Right now we are manually doing)
Please help me.
Thanks in Advance.
Thanigaivasan
-
Check the oracle magazine's tips archive and they have a few which ou have to customize for your need.
Sam
Thanx
Sam
Life is a journey, not a destination!
-
shell scripty to maintain the log files
Thanks,
sam,
Let me try and get back.
Thanks onceagain.
Thanigaivasan
-
shell script to
hi sam,
I have gone thru that page and there is no scripts for the alert log cleaning
I need to create even to check the error in alertlog file too.I made the script to clean the the files and I am testing it.Once it is ok I can post that in scripts.Now I am in need for the error check script
any help please.
Thanks.
Thanigaivasan.
-
#!/bin/ksh
. /oracle1/.profile
ORACLE_HOME=/oracle1/product/8.1.6; export ORACLE_HOME
ORACLE_SID=THANIGAI; export ORACLE_SID
egrep "ORA-|Shut|shut" /backup/scripts/pagertest.txt>/dev/null 2>&1
if test $? -eq 0
then mailx -s "Check alert log THANIGAI for oracle errors.."
123456@abcde.com < /backup/scripts/pagertext.log
mailx -s "Check alert Log THANIGAI for Oracle Error.. "
thanigai@xyz.com < /backup/scripts/pagertest.txt
fi
~
HTH
manjunath
-
Try this:
find /.../exp -name \*.log -mtime +60 -exec rm -f {} \;
This short script will delete the files older than 60 days.
Hope it helps
dragon
-
shell script to maintain
Thanks Dragon and Manju
I will try and it will work.
Thanks.
Thanigaivasan
-
for alert file,
find $ORACLE_BASE/admin/$ORACLE_SID/bdump -ctime +60 -name alert_$ORACLE_SID.log -exec rm {} \;
listener file,
find $ORACLE_HOME/network/log -name listener.log -ctime +14 -exec rm {} \;
sqlnet file,
find $ORACLE_HOME/network/log -name sqlnet.log -ctime +14 -exec rm {} \;
-
shell sript
Thanks.Jim
it is working.
Thanks again.
thanigaivasan
-
Hi,
I notice that in the above replties jm has used the -ctime to check for older file name and dragon99 has used the -mtime parameter. whats the difference between the two. Please bear with my little knowledge of unix.
Also is there any way we can do a similar thing on NT also. This script is basically for unix.
Thanks
Anurag
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|