8i中的noarchivelog和archivelog

查看歸檔:archive log list
1、log_archive_start=true  
這個參數控制數據庫實例啓動的時候,是否啓動歸檔進程,通常爲ora_arc0_SID
在init.ora文件中手工修改:
log_archive_start = true
log_archive_dest_1 = "location=C:/oracle/oradata/orcl/archive"
log_archive_format = %%ORACLE_SID%%T%TS%S.ARC
--在init.ora中指定了log_archive_start爲true後重啓DB後仍會保持爲自動歸檔方式。

2、歸檔進程啓動了,並不意味着一定可以產生歸檔日誌,因爲還有一個開關控制它,那就是:
alter database archivelog;       打開歸檔
alter database noarchivelog;     停止歸檔
--只有在mount狀態下纔可以在archivelog和noarchivelog之間切換。

3、打開歸檔了之後,我們還有一個選擇,就是自動歸檔和手動歸檔:
archive log start;    打開自動歸檔
archive log stop;    打開手動歸檔
--自動歸檔方式可以在DB處於打開狀態時用{archvie log start|stop}任意改變。

4、如果自動歸檔是disabled,執行了alter system switch logfile,雖然進行了日誌組的切換,但是歸檔進程並不把之前的online redo log歸檔,需要進行手工歸檔:alter system archive log all;  把所有沒有歸檔的日誌歸檔。

5、在手工歸檔模式下,需要注意的問題是,如果系統在進行了幾次日誌組的切換之後,如果dba還沒有把日誌歸檔,所有的online redo log group都是未歸檔狀態,那麼切換日誌組的進程將會hang住,出現這種情況,應及時打開另外一個窗口,手工進行歸檔。

6、如果啓動了自動歸檔,命令alter system switch logfile 和alter system archive log current/all 都切換和歸檔;如果自動歸檔disable,則alter system switch logfile只是切換不歸檔,alter system archive log current/all既切換又歸檔。
--只有在archivelog模式和自動歸檔方式同時存在時纔可以生成歸檔日誌文件。 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章