歸檔日誌,oracle歸檔日誌

來源:互聯網
上載者:User

歸檔日誌,oracle歸檔日誌

RAC
 sqlplus / as sysdba
 SQL> alter system set cluster_database=false scope=spfile; --in node1
 SQL> create pfile='/opt/oracle/pfile_20120301' from spfile; --in node1
 SQL> alter system set log_archive_format='ora11g_%r_%t_%s.log' scope=spfile; --in node1, using default value is ok
 SQL> alter system set log_archive_start=TRUE scope=spfile; --in node1
 SQL> alter system set  log_archive_dest='' scope=spfile; --in node1
 SQL> alter system set  log_archive_dest_1='LOCATION=/oracle/ora_arch' scope=spfile; --in node1 using the specificated DIR
 SQL> shutdown immediate; --two nodes
 SQL> startup mount; --in node1
 SQL> alter database archivelog; --in node1
 SQL> alter database open; --in node1
 SQL> alter system set cluster_database=true scope=spfile; --in node1
 SQL> shutdown immediate; --in node1
 SQL> startup; --in two nodes

 NORAC
 sqlplus / as sysdba
 SQL> create pfile='/opt/oracle/pfile_20120301' from spfile;
 SQL> alter system set log_archive_format='ora11g_%r_%t_%s.log' scope=spfile; --using default value is ok
 SQL> alter system set log_archive_start=TRUE scope=spfile;
 SQL> alter system set  log_archive_dest='' scope=spfile;
 SQL> alter system set  log_archive_dest_1='LOCATION=/oracle/ora_arch' scope=spfile; --using the specificated DIR
 SQL> shutdown immediate;
 SQL> startup mount;
 SQL> alter database archivelog;
 SQL> alter database open;
 SQL> archive log list;


聯機日誌與歸檔日誌有什不同?

一、NO ARCHIVELOG
資料庫有聯機重做日誌,這個日誌是記錄對資料庫所做的修改,比如插入,刪除,更新資料等,對這些操作都會記錄在聯機重做日誌裡。一般資料庫至少要有2個聯機重做日誌組。當一個聯機重做日誌組被寫滿的時候,就會發生日誌切換,這時聯機重做日誌組2成為當前使用的日誌,當聯機重做日誌組2寫滿的時候,又會發生日誌切換,去寫聯機重做日誌組1,就這樣反覆進行。
二、ARCHIVELOG
基本情況和上面是一致的,唯一不同在於,當發生日誌切換的時候,被切換的日誌會進行歸檔。比如,當前在使用聯機重做日誌1,當1寫滿的時候,發生日誌切換,開始寫聯機重做日誌2,這時聯機重做日誌1的內容會被拷貝到另外一個指定的目錄下。這個目錄叫做歸檔目錄,拷貝的檔案叫歸檔重做日誌。
他們的區別在於一個歸檔,一個不歸檔。資料庫使用歸檔方式運行時才可以進行災難性恢複。
 
oracle中的歸檔日誌與Database Backup的不同

歸檔日誌就是重做日誌的備份, 而重做日誌記錄了資料的所有變化(DML,DDL或管理員對資料所作的結構性更改等),可以使用者資料恢複,也可使用者其他檔案的恢複。

而Database Backup,可以分為很多種,常用的exp及rman等,rman備份需要開啟歸檔狀態,也就是rman備份和歸檔日誌是緊密相關的,rman備份可以備份控制檔案,資料檔案,重做記錄檔等各類檔案,比較全面。
而exp邏輯備份,備份的是資料檔案中的資料。
區別就是exp只能恢複資料庫的資料,歸檔日誌可以恢複資料及其他檔案(使用rman備份)。
歸檔日誌需要和rman備份一起使用,不能單獨拿出來與Database Backup做比較,這樣沒有什麼意義。

希望可以幫到你!
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.