關閉時:
SQL> archive log list Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 2178 Current log sequence 2180 SQL> select log_mode, open_mode, name from v$database; LOG_MODE OPEN_MODE NAME ------------ ---------- --------- NOARCHIVELOG READ WRITE WIN
開啟時:
NOTE: 要啟用 Archive Log 時,必須重啟一次 DB,為了縮短 downtime,可以在停機前先設定參數 log_archive_dest_1。
設定 Archive Log 的儲存路徑
sqlplus / as sysdba SQL> show parameters recovery_file_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /opt/oracle/flash_recovery_area db_recovery_file_dest_size big integer 2G SQL> alter system set log_archive_dest_1='LOCATION=/opt/oracle/arclog' scope=spfile; SQL> alter system set log_archive_format='mydb_%s_%t_%r.arc' scope=spfile; SQL> show parameters log_archive; SQL> shutdown immediate SQL> startup mount SQL> alter database archivelog; SQL> alter databse open; SQL> show parameters log_archive SQL> archive log list