Monday, July 03, 2006

How can I rotate log from schdule job on oracle

we have used schedule job every 10 seconds for sendmail.
So we had many logs


whem i queried

select count(*) from dba_schedule_job_run_detail;
263201 rows selected.

So I used DBMS_SCHEDULER.PURGE_LOG package for purge log

keep 10 days of MAIL_ALERT_TIME job
SQL> exec dBMS_SCHEDULER.PURGE_LOG(log_history => 10, job_name => 'MAIL_ALERT_TIME');

or purge all every jobs
SQL>DBMS_SCHEDULER.PURGE_LOG();

2 comments:

sonu said...

Is there any way how to make schedule for Listener log file purge once it reaches at 2GB in size...

HunterX said...

about listener log, you can rotate log, if you haven't set password:
it's about "set log_status [on|off]" command.
http://surachart.blogspot.com/2006/04/example-shell-script-for-rotate_05.html