10g閃回區和歸檔目錄的關係

seagull76發表於2008-03-27
Oracle10g 有一項新功能稱為:自動的基於磁碟的備份與恢復( Automatic Disk-Based Backup and Recovery )。實現該功能的基礎為本文要講述的閃回恢復區( FlashRecovery Area )。閃回恢復區是 Oracle 10g 中的新事物。簡單的說,閃回恢復區是一塊用以儲存恢復相關的檔案的儲存空間。
如果資料庫採用歸檔模式,那麼預設情況下歸檔檔案也會產生在閃回區裡面.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 9
Next log sequence to archive 11
Current log sequence 11
SQL> show paramter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /oracle10/flash_recovery_area
db_recovery_file_dest_size big integer 512M
recovery_parallelism integer 0
如果此時更改log_archive_dest引數,將會報錯(意思是log_archive_dest和db_recovery_file_dest不能同時使用):
SQL> alter system set log_archive_dest='/oracle10/archive_test/';
alter system set log_archive_dest='/oracle10/archive_test/'
*
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
不過可以透過更改spfile來更改log_archive_dest
SQL> alter system set log_archive_dest='/oracle10/archive_test/' scope=spfile;
System altered.
然後重啟資料庫,經過測試,發現此時歸檔會產生到log_archive_dest和db_recovery_file_dest兩個目錄,且檔名根據各自不同的風格
如果想停用閃回區,可以這樣修改:
SQL> alter system set db_recovery_file_dest='' scope=spfile;
System altered.
然後重啟資料庫,此時歸檔後可以發現,歸檔檔案已經不在閃回區裡產生了,只會在log_archive_dest裡面產生
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle10/archive_test/
Oldest online log sequence 17
Next log sequence to archive 19
Current log sequence 19
[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8861952/viewspace-1034681/,如需轉載,請註明出處,否則將追究法律責任。

相關文章