Sets the method for archiving.
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 do this by using the top method
Sql> alter system set log_archive_format= ' Arch_%d_%t_%r_%s.log ' #设置归档日记款式
3 sql> 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 the archive process is running
Sql> select Log_mode from V$database;
Sql> Select Archiver from V$instance;
9th Log Toggle
sql> alter system switch logfile;
10 This log switch writes the archive 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 the Oracle scenario, run the following query:
Sql> select name from V$archived_log;
The files listed in the query are then confirmed in the operating system.
Close the archive.
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; #查看此时便处于非归档模式
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; #检察后台进程
ORACLE Archive Log Open shutdown method