One set to archive mode
1Sql>ArchiveLoglist; #查看是不是归档方式2Sql> AlterSystemSetLog_archive_start=True scope=spfile; #启用主动归档 SQL> AlterSystemSetLog_archive_dest='Location=/oracle/ora9/oradata/arch'Scope=SPFile; #设置归档路径 SQL> AlterSystemSetLog_archive_dest_1='Location=/oracle/ora9/oradata/arch1'Scope=SPFile; SQL> AlterSystemSetLog_archive_dest_2='LOCATION=/ORACLE/ORA9/ORADATA/ARCH2'Scope=SPFile; #如果归档到两个位置, the SQL can be implemented by the top method> AlterSystemSetLog_archive_format='Arch_%d_%t_%r_%s.log'#设置归档日记款式3Sql> shutdownimmediate; 4Sql>startup Mount; #打开控制文件, do not open the data file5Sql> Alter DatabaseArchivelog; #将数据库切换为归档模式6Sql> Alter Database Open; #将数据文件打开7Sql>ArchiveLoglist; #查看此时是否处于归档模式8query to determine that the database is in Archivelog mode and the archive process is running SQL> SelectLog_mode fromv$Database; SQL> SelectArchiver fromv$instance; 9Log Switching SQL> Altersystem switch logfile; in the Oracle scenario, run the following query: SQL> SelectName fromV$archived_log;
Two set non-archive mode
1Sql>ArchiveLoglist; #查看是否是归档方式2Sql> AlterSystemSetLog_archive_start=False scope=SPFile; #禁用自动归档3Sql> shutdownimmediate; 4Sql>startup Mount; #打开控制文件, do not open the data file5Sql> Alter DatabaseNoarchivelog; #将数据库切换为非归档模式6Sql> Alter Database Open; #将数据文件打开7Sql>ArchiveLogList #查看此时便处于非归档模式
Three-Archive related commands
Log stop; Log start; Log list; Show parameters; Show parameters Log_archive_start; Show Parameters log_archive_max_process; #归档进程数 alterset log_archive_max_process=5; #将归档进程数改为5 Select * from v$bgprocess; #检察后台进程
ORACLE Archive Log Open Close method (reprint)