Oracle歸檔模式的命令及參數說明

來源:互聯網
上載者:User

Oracle資料庫可以運行在2種模式下:歸檔模式(archivelog)和非歸檔模式(noarchivelog)。歸檔模式可以提高Oracle資料庫的可恢複性,生產資料庫都應該運行在此模式下,歸檔模式應該和相應的備份策略相結合,只有歸檔模式沒有相應的備份策略只會帶來麻煩。

檢查歸檔模式命令:

SQL> archive log listDatabase log mode No Archive ModeAutomatic archival DisabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 15Current log sequence 17

設定歸檔模式:

SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 1258291200 bytesFixed Size 1219160 bytesVariable Size 318768552 bytesDatabase Buffers 922746880 bytesRedo Buffers 15556608 bytesDatabase mounted.SQL> alter database archivelog;Database altered.SQL> alter database open;Database altered.SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 15Next log sequence to archive 17Current log sequence 17

如果需要停止歸檔模式,使用:alter database noarchivelog 命令。Oracle10g之前,你還需要修改初始化參數使資料庫處於自動歸檔模式。在pfile/spfile中設定如下參數:

log_archive_start = true

重啟資料庫此參數生效,此時資料庫處於自動歸檔模式。也可以在資料庫啟動過程中,手工執行:

archive log start

使資料庫啟用自動歸檔,但是重啟後資料庫仍然處於手工歸檔模式。10g使用db_recovery_file_dest來作為歸檔日誌的存放地。

SQL> show parameter db_recoveryNAME TYPE VALUEdb_recovery_file_dest string /home/oracle/ora10g/flash_recovery_area/db_recovery_file_dest_size big integer 20G

可以修改db_recovery_file_dest_size參數的大小

alter system set db_recovery_file_dest_size=21474836480

(

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.