A set of SQL code for archive mode
sql> archive log list;
#查看是不是归档方式
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"
#设置归档日记款式
sql> shutdown immediate;
sql> startup Mount;
#打开控制文件, do not open the data file
sql> ALTER DATABASE Archivelog;
#将数据库切换为归档模式
sql> ALTER DATABASE open;
#将数据文件打开
sql> archive log list;
#查看此时是否处于归档模式 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;
SQL code Log switching
sql> alter system switch logfile;
This log switch writes the archive to two destinations, the top/oracle/ora9/oradata/arch1 and/oracle/ora9/oradata/arch1,
If you want to verify the directory, run the following query in Oracle case:
Sql> select name from V$archived_log;
The files listed in the query are then confirmed in the operating system.
Two set non-archive SQL code
sql> archive log list;
#查看是否是归档方式
Sql> alter system set LOG_ARCHIVE_START=FALSE Scope=spfile;
#禁用自动归档
sql> shutdown immediate;
sql> startup Mount;
#打开控制文件, do not open the data file
sql> ALTER DATABASE Noarchivelog;
#将数据库切换为非归档模式
sql> ALTER DATABASE open;
#将数据文件打开
sql> archive log list;
#查看此时便处于非归档模式
Three archive related commands SQL code
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 Archiving Mode settings