日志切换通常是系统自动执行,不需要人为干涉。但是在某些情况下,需要强制日志切换,以下就几种方法。
1、修改系统参数
The following initialization parameter setting sets the log switch interval to 30 minutes (a typical value). ARCHIVE_LAG_TARGET = 1800 ##ADG环境用的比较多。
2、手动切换
sql> conn / as sysdba sql> ALTER SYSTEM SWITCH LOGFILE;
3、创建JOB,定时执行
alter session nls_date_format='DD/MM/YYYY HH:MM:SS AM'; BEGIN DBMS_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 minutes enabled => TRUE,comments => 'force a log switch'); END; /原文链接:https://www.f2er.com/oracle/206528.html