how to force a log switch
How to be sure to force a log switch every 20 minutes.
Thanks in advance
Leave a comment...
- 14 Comments
- Why do you want to force a switch log ?
Nicolas.#1; Sat, 23 Feb 2008 13:59:00 GMT
- Can't think of why you would want to do that.
One silly way I can think of, is to have a cron job that runs (every 20 min) below sql as dba:
alter system switch logfile;
00,20,40 * * * * /home/oracle/my_db_log_switch.sh
Nazrul#2; Sat, 23 Feb 2008 14:00:00 GMT
If your database is running on unix flavor, then we can do this by writing a shell script and using cron job.
I am not sure why don't you try using DBMS_JOB
Thanks,#3; Sat, 23 Feb 2008 14:01:00 GMT
- you can check out checkpint paramtere!!!
but it may hamper perfrmance!!!#4; Sat, 23 Feb 2008 14:02:00 GMT
- Hi and thanks for these first respons.
why ? : to garantee that i'll never lose more than 20 minutes of user job.
of course unix cron or dbms_job are the solution but i was thinking that a way could exists with oarcle parameters.
Den#5; Sat, 23 Feb 2008 14:03:00 GMT
- >>of course unix cron or dbms_job are the solution but i was thinking that a way could exists with oarcle parameters.
Do not schedule a switch log. You will generate some contention during load or high database activity when redolog switch are raise by the database itself.
And if there is no switch, that's because there is a very low activity. So you won't lose more data than redolog can contains if no switch during one hour. Just tune the redolog size.
Nicolas.#6; Sat, 23 Feb 2008 14:04:00 GMT
Why do you want to do log switch often.#7; Sat, 23 Feb 2008 14:05:00 GMT
- You would be better off tuning the size of redo logs then trying to force a log switch every 20 minutes.#8; Sat, 23 Feb 2008 14:06:00 GMT
- You can used "archive_lag_target" parameter to switch logfile in desired intervals.
Satheesh Babu.S#9; Sat, 23 Feb 2008 14:07:00 GMT
- Huh ! is this parameter (archive_lag_target) available only on dataguard environment ?
Den#10; Sat, 23 Feb 2008 14:08:00 GMT
- In fact, we have one fo our database with a very small activity. So we have a switch at 09 am but next switch 3 days later. In this context i think that the cron is the best way because the activity is low.
Den#11; Sat, 23 Feb 2008 14:09:00 GMT
- Are you not backing up the database on regular intervals? If so then you are not loosing anything as the backup process should switch the log files.#12; Sat, 23 Feb 2008 14:10:00 GMT
- >>So we have a switch at 09 am but next switch 3 days later.
What are their actual size ?
As I said above, reduce the logfile size seems to me a better way than schedule by cron.
Nicolas.#13; Sat, 23 Feb 2008 14:11:00 GMT
- > why ? : to garantee that i'll never lose more than 20
> minutes of user job.
What kind of environment would require such a concept? This sounds like a MS-Word + Autosave solution.
C.#14; Sat, 23 Feb 2008 14:12:00 GMT