理解oracle數據庫歸檔參數

1.log_archive_dest.
使用log_archive_dest參數最多可設置2個歸檔路徑,通過log_archive_dest設置一個主歸檔路徑,通過LOG_ARCHIVE_DUPLEX_DEST 參數設置一個從歸檔路徑。所有的路徑必須是本地的,該參數的設置格式如下:
LOG_ARCHIVE_DEST = '/disk1/archive'
LOG_ARCHIVE_DUPLEX_DEST = '/disk2/archive'
 
2.LOG_ARCHIVE_DEST_n
LOG_ARCHIVE_DEST_n參數可以設置最多10(n=[1..10])個不同的歸檔路徑,通過設置關鍵詞location或service,該參數指向的路徑可以是本地或遠程的。
LOG_ARCHIVE_DEST_1 = 'LOCATION = /disk1/archive'
LOG_ARCHIVE_DEST_2 = 'LOCATION = /disk2/archive'
LOG_ARCHIVE_DEST_3 = 'LOCATION = /disk3/archive'
如果要歸檔到遠程的standby數據庫,可以設置service:
LOG_ARCHIVE_DEST_4 = 'SERVICE = standby1'

可見,這兩個參數都可以設置歸檔路徑,不同的是後者可以設置遠程歸檔到standby端,而前者只能歸檔到本地,且最多同時歸檔到2個路徑下。
 
log_archive_dest與log_archive_dest_n這兩個參數是互斥的,Oracle之所以保留log_archive_dest和 log_archive_duplex_dest是爲了保證向後的兼容。
見下面的官方文檔:
LOG_ARCHIVE_DEST is applicable only if you are running the database in ARCHIVELOG mode or are recovering a database from archived redo logs. LOG_ARCHIVE_DEST is incompatible with the LOG_ARCHIVE_DEST_n parameters, and must be defined as the null string ("") or (' ') when any LOG_ARCHIVE_DEST_n parameter has a value other than a null string. Use a text string to specify the default location and root of the disk file or tape device when archiving redo log files. (Archiving to tape is not supported on all operating systems.) The value cannot be a raw partition.
其中:
and must be defined as the null string ("") or (' ') when any LOG_ARCHIVE_DEST_n parameter has a value other than a null string.
就是這個意思:
下面做個實驗證明下這兩個參數不能同時使用:
 
SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/bak/arch1';
System altered.
SQL> alter system set log_archive_dest_2='location=/u01/app/oracle/bak/arch2';
System altered.
 
SQL> alter system set log_archive_dest='location=/u01/app/oracle/bak/arch3';
alter system set log_archive_dest='location=/u01/app/oracle/bak/arch3'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or
DB_RECOVERY_FILE_DEST
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章