Set to archive mode
1 sql> archive log list; #查看是不是归档方式 2 sql> alter system set LOG_ARCHIVE_START=TRUE Scope=spfile; #启用主动归档 sql> alter system set log_archive_dest= ' Location=/oracle/ora9/oradata/arch ' scope=spfile; #设置归档路径 sql> alter system set log_archive_dest_1= ' Location=/oracle/ora9/oradata/arch1 ' scope=spfile; Sql> alter system set log_archive_dest_2= ' Location=/oracle/ora9/oradata/arch2 ' scope=spfile; #如果归档到两个位置, you can implement sql> alter system set log_archive_format= ' Arch_%d_%t_%r_%s.log ' #设置归档日记款式 3 sql> by the top method shutdown Immediate 4 sql> startup Mount; #打开控制文件, do not open the data file 5 sql> ALTER DATABASE archivelog; #将数据库切换为归档模式 6 sql> ALTER DATABASE open; #将数据文件打开 7 sql> archive log list; #查看此时是否处于归档模式 8 Query to determine that the database is in Archivelog mode and that the archive process is running sql> select Log_mode from V$database; Sql> Select Archiver from V$instance; 9th log Switch sql> alter system switch logfile; 10 This log switch will be archived to two destinations, 1, that is, the second step of/oracle/ora9/oradata/arch1 and/oracle/ora9/oradata/arch1, if you want to confirm the directory in Oracle run the following query: SQL > select name FroM V$archived_log; Then confirm the files listed in the query in the operating system
Two sets of non-archival method
1 sql> archive log list; #查看是否是归档方式 2 sql> alter system set LOG_ARCHIVE_START=FALSE Scope=spfile; #禁用自动归档 3 sql> shutdown immediate; 4 sql> startup Mount; #打开控制文件, do not open the data file 5 sql> ALTER DATABASE noarchivelog; #将数据库切换为非归档模式 6 sql> ALTER DATABASE open; #将数据文件打开 7 sql> archive log list; #查看此时便处于非归档模式
three archive related commands
Archive log stop; Archive log start; Archive log list; Show parameters; Show Parameters Log_archive_start; Show Parameters log_archive_max_process; #归档进程数 alter system set log_archive_max_process=5; #将归档进程数改为5 select * from V$bgprocess; #检察后台进程