One set to archive mode
[XHTML]View Plaincopyprint?
- 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.
Two set non-archive mode
[Java] view plaincopyprint?
- 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
[Java] view plaincopyprint?
- 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