ORACLE 歸檔日誌開啟關閉方法(轉載)

來源:互聯網
上載者:User

標籤:ram   base   資料檔案   查看   ada   sel   location   spfile   後台   

一 設定為歸檔方式

    1 sql> archive log list;   #查看是不是歸檔方式      2 sql> alter system set log_archive_start=true scope=spfile; #啟用主動歸檔        sql> alter system set log_archive_dest=‘location=/oracle/ora9/oradata/arch‘ scope=spfile;            #設定歸檔路徑        sql> alter system set log_archive_dest_1=‘location=/oracle/ora9/oradata/arch1‘ scope=spfile;        sql> alter system set log_archive_dest_2=‘location=/oracle/ora9/oradata/arch2‘ scope=spfile;            #如果歸檔到兩個位置,則可以通過上邊方法實現        sql> alter system set log_archive_format=‘arch_%d_%t_%r_%s.log‘  #設定歸檔日記款式      3 sql> shutdown immediate;      4 sql> startup mount;    #開啟控制檔案,不開啟資料檔案      5 sql> alter database archivelog; #將資料庫切換為歸檔模式      6 sql> alter database open;   #將資料檔案開啟      7 sql> archive log list;   #查看此時是否處于歸檔模式      8 查詢以確定資料庫位於archivelog模式中且歸檔過程正在運行      sql> select log_mode from v$database;      sql> select archiver from v$instance;      9 日誌切換      sql> alter system switch logfile;      在oracle情況中運行如下查詢:      sql> select name from v$archived_log;      

 

 

二 設定非歸檔方式

    1 sql> archive log list;   #查看是否是歸檔方式      2 sql> alter system set log_archive_start=false scope=spfile; #禁用自動歸檔      3 sql> shutdown immediate;      4 sql> startup mount;    #開啟控制檔案,不開啟資料檔案      5 sql> alter database noarchivelog; #將資料庫切換為非歸檔模式      6 sql> alter database open;   #將資料檔案開啟      7 sql> 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.