oracle開啟/關閉歸檔模式

來源:互聯網
上載者:User

標籤:des   style   blog   color   使用   ar   sp   資料   div   

1.改變非歸檔模式到歸檔模式:   
1)SQL> conn / as sysdba (以DBA身份串連資料庫)   
2)SQL> shutdown immediate;(立即關閉資料庫)   
3)SQL> startup mount (啟動執行個體並載入資料庫,但不開啟)   
4)SQL> alter database archivelog; (更改資料庫為歸檔模式)   
5)SQL> alter database open; (開啟資料庫)   
6)SQL> alter system archive log start; (啟用自動歸檔)   
7)SQL> exit (退出)   

使用RMAN做一次完全備份,因為非歸檔記錄模式下產生的備份日誌對于歸檔模式已經不可用。

SQL> archive log list;資料庫記錄模式             非存檔模式自動封存             禁用存檔終點            USE_DB_RECOVERY_FILE_DEST最早的聯機日誌序列     8當前日誌序列           10SQL> select name,log_mode from v$database;NAME      LOG_MODE--------- ------------ORCL      NOARCHIVELOGSQL> shutdown immediate;資料庫已經關閉。已經卸載資料庫。ORACLE 常式已經關閉。SQL> startup mount;ORACLE 常式已經啟動。Total System Global Area  855982080 bytesFixed Size                  2180544 bytesVariable Size             553650752 bytesDatabase Buffers          293601280 bytesRedo Buffers                6549504 bytes資料庫裝載完畢。SQL> alter database archivelog;資料庫已更改。SQL> alter database open;資料庫已更改。SQL> alter system archive log start;系統已更改。SQL> archive log lit;SP2-0718: 非法的        ARCHIVE LOG 選項SQL> archive log list;資料庫記錄模式            存檔模式自動封存             啟用存檔終點            USE_DB_RECOVERY_FILE_DEST最早的聯機日誌序列     8下一個存檔日誌序列   10當前日誌序列           10SQL>

2.改變歸檔模式到非歸檔模式:   
1)SQL>shutdown normal 或shutdown immediate;   
2)SQL>startup mount;   
3)SQL>alter database noarchivelog;
4)SQL>alter database open;

SQL> shutdown immediate;資料庫已經關閉。已經卸載資料庫。ORACLE 常式已經關閉。SQL> startup mount;ORACLE 常式已經啟動。Total System Global Area  855982080 bytesFixed Size                  2180544 bytesVariable Size             553650752 bytesDatabase Buffers          293601280 bytesRedo Buffers                6549504 bytes資料庫裝載完畢。SQL> alter database noarchivelog;資料庫已更改。SQL> alter database open;資料庫已更改。SQL> archive log list;資料庫記錄模式             非存檔模式自動封存             禁用存檔終點            USE_DB_RECOVERY_FILE_DEST最早的聯機日誌序列     8當前日誌序列           10SQL> select name,log_mode from v$database;NAME      LOG_MODE--------- ------------ORCL      NOARCHIVELOGSQL>

3.歸檔相關命令 
select name,log_mode from v$database;查看歸檔狀態
archive log list;查看歸檔狀態
archive log stop;
archive log start;
archive log list;
show parameters;
show parameters log_archive_start;
show parameters log_archive_max_process; #歸檔進程數
alter system set log_archive_max_process=5; #將歸檔進程數改為5
select * from v$bgprocess; #檢察後台進程

oracle開啟/關閉歸檔模式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.