How to force a log switch- forcibly switches logs
Log switching is usually performed automatically by the system without human intervention. However, in some cases, you need to force log switching, here are a few ways.
1. Modify system parameters
The following initialization parameter setting sets the log switch interval to 30 minutes (a typical value). ARCHIVE_LAG_TARGET = 1800 # # ADG environment is more commonly used.
2. Switch manually
SQL > conn / as sysdbaSQL > ALTER SYSTEM SWITCH LOGFILE
3. Create a JOB and execute it regularly.
Alter session nls_date_format='DD/MM/YYYY HH:MM:SS AM';BEGINDBMS_SCHEDULER.CREATE_JOB (job_name = > 'manual_log_switch',job_type = >' PLSQL_BLOCK',job_action = > 'BEGIN alter system switch logfile; END;',start_date = > sysdate,repeat_interval = >' FREQ=HOURLY; BYMINUTE=00,30;',-- every 30 minutesenabled = > TRUE,comments = > 'force a log switch'); END;/
Summary:
The above methods provide us with different ideas, when considering the problem can be considered from an incomprehensible point of view, each method has a suitable scenario.