SYS@airforecast> conn / as sysdba SYS@airforecast> alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/airforecast/archivelog' scope = spfile; SYS@airforecast> alter system set log_archive_format='arch_%d_%t_%r_%s.log' scope = spfile;
Total System Global Area 4977278976 bytes Fixed Size 2261768 bytes Variable Size 1006636280 bytes Database Buffers 3959422976 bytes Redo Buffers 8957952 bytes Database mounted. SYS@airforecast> alter database archivelog;
Database altered.
SYS@airforecast> alter database open;
Database altered.
确认数据库是否为归档模式
1 2 3 4 5 6 7 8 9 10 11
SYS@airforecast> select log_mode from v$database;
LOG_MODE ------------ ARCHIVELOG
SYS@airforecast> select archiver from v$instance;
ARCHIVE ------- STARTED
切换日志检查归档日志是否正常
1 2 3 4 5 6 7 8 9 10
SYS@airforecast> alter system switch logfile;
System altered.
SYS@airforecast> select name from v$archived_log;
NAME ------------------------------------------------------------------------------------------------------------------------ /u01/app/oracle/oradata/airforecast/archivelog/arch_a9652e7f_1_1000805313_5.log /u01/app/oracle/oradata/airforecast/archivelog/arch_a9652e7f_1_1000805313_6.log