RAC--歸檔日誌的開啟方法
oracle RAC--歸檔日誌的開啟方法
==================================
10g R1 要修改cluster_database引數 ,10G R2和以後的版本就不需要了
1. 例子(10g R1或之前):
srvctl stop database -d RAC
節點1
sql>startup mount
SQL> alter system set log_archive_dest_1='location=/racdb1_arch' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_1='location=/racdb2_arch' scope=spfile sid='RAC2';
SQL> alter system set log_archive_dest_2='service=rac2' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_2='service=rac1' scope=spfile sid='RAC2';
SQL> alter system set standby_archive_dest='/racdb2_arch' scope=spfile sid='RAC1';
SQL> alter system set standby_archive_dest='/racdb1_arch' scope=spfile sid='RAC2';
sql>alter system set cluster_database=false scope=spfile;
sql>shutdown immediate
sql>startup mount
sql>alter database archivelog
sql>alter database open
sql>alter system set cluster_database=true scope=spfile;
sql>shutdown immediate
srvctl start database -d RAC
1. 例子(10g R1或之前):
srvctl stop database -d RAC
節點1
sql>startup mount
SQL> alter system set log_archive_dest_1='location=/racdb1_arch' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_1='location=/racdb2_arch' scope=spfile sid='RAC2';
SQL> alter system set log_archive_dest_2='service=rac2' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_2='service=rac1' scope=spfile sid='RAC2';
SQL> alter system set standby_archive_dest='/racdb2_arch' scope=spfile sid='RAC1';
SQL> alter system set standby_archive_dest='/racdb1_arch' scope=spfile sid='RAC2';
sql>alter system set cluster_database=false scope=spfile;
sql>shutdown immediate
sql>startup mount
sql>alter database archivelog
sql>alter database open
sql>alter system set cluster_database=true scope=spfile;
sql>shutdown immediate
srvctl start database -d RAC
2. 例子(10g R2或之後):
節點1
SQL>startup mount;
SQL> alter system set log_archive_dest_1='location=/racdb1_arch' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_1='location=/racdb2_arch' scope=spfile sid='RAC2';
SQL> alter system set log_archive_dest_2='service=rac2' scope=spfile sid='RAC1';
SQL> alter system set log_archive_dest_2='service=rac1' scope=spfile sid='RAC2';
SQL> alter system set standby_archive_dest='/racdb2_arch' scope=spfile sid='RAC1';
SQL> alter system set standby_archive_dest='/racdb1_arch' scope=spfile sid='RAC2';
srvctl stop database -d RAC
節點1
SQL> startup mount
SQL> alter database archivelog;
SQL> startup mount
SQL> alter database archivelog;
srvctl start database -d RAC
3. 測試歸檔日誌的切換:
節點一,二上分別執行切換日誌操作如下:
SQL> alter system switch logfile; 操作執行這條語句5次
節點一查詢:
SQL> !ls -l /racdb*
/racdb1_arch:
total 1072
-rw-r----- 1 oracle oinstall 93696 Oct 7 08:57 1_82_762368314.dbf
-rw-r----- 1 oracle oinstall 980992 Oct 7 09:10 1_83_762368314.dbf
-rw-r----- 1 oracle oinstall 1536 Oct 7 09:10 1_84_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 1_85_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 1_86_762368314.dbf
/racdb1_arch:
total 1072
-rw-r----- 1 oracle oinstall 93696 Oct 7 08:57 1_82_762368314.dbf
-rw-r----- 1 oracle oinstall 980992 Oct 7 09:10 1_83_762368314.dbf
-rw-r----- 1 oracle oinstall 1536 Oct 7 09:10 1_84_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 1_85_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 1_86_762368314.dbf
/racdb2_arch:
total 980
-rw-rw---- 1 oracle oinstall 166400 Oct 7 08:56 2_57_762368314.dbf
-rw-rw---- 1 oracle oinstall 811520 Oct 7 09:10 2_58_762368314.dbf
-rw-rw---- 1 oracle oinstall 2560 Oct 7 09:10 2_59_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 2_60_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 2_61_762368314.dbf
total 980
-rw-rw---- 1 oracle oinstall 166400 Oct 7 08:56 2_57_762368314.dbf
-rw-rw---- 1 oracle oinstall 811520 Oct 7 09:10 2_58_762368314.dbf
-rw-rw---- 1 oracle oinstall 2560 Oct 7 09:10 2_59_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 2_60_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 2_61_762368314.dbf
節點二查詢:
SQL> !ls -l /racdb*
/racdb1_arch:
total 1072
-rw-rw---- 1 oracle oinstall 93696 Oct 7 08:57 1_82_762368314.dbf
-rw-rw---- 1 oracle oinstall 980992 Oct 7 09:10 1_83_762368314.dbf
-rw-rw---- 1 oracle oinstall 1536 Oct 7 09:10 1_84_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 1_85_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 1_86_762368314.dbf
/racdb1_arch:
total 1072
-rw-rw---- 1 oracle oinstall 93696 Oct 7 08:57 1_82_762368314.dbf
-rw-rw---- 1 oracle oinstall 980992 Oct 7 09:10 1_83_762368314.dbf
-rw-rw---- 1 oracle oinstall 1536 Oct 7 09:10 1_84_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 1_85_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 Oct 7 09:10 1_86_762368314.dbf
/racdb2_arch:
total 980
-rw-r----- 1 oracle oinstall 166400 Oct 7 08:56 2_57_762368314.dbf
-rw-r----- 1 oracle oinstall 811520 Oct 7 09:10 2_58_762368314.dbf
-rw-r----- 1 oracle oinstall 2560 Oct 7 09:10 2_59_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 2_60_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 2_61_762368314.dbf
total 980
-rw-r----- 1 oracle oinstall 166400 Oct 7 08:56 2_57_762368314.dbf
-rw-r----- 1 oracle oinstall 811520 Oct 7 09:10 2_58_762368314.dbf
-rw-r----- 1 oracle oinstall 2560 Oct 7 09:10 2_59_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 2_60_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 7 09:10 2_61_762368314.dbf
節點一:
SQL> show parameter archive_dest
NAME TYPE
VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb1_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac2
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb2_arch
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb1_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac2
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb2_arch
節點二:
SQL> show parameter archive_dest
NAME TYPE
VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb2_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac1
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb1_arch
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb2_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac1
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb1_arch
===========================================
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22990797/viewspace-745952/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- oracle歸檔日誌Oracle
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- RMAN備份整庫和歸檔日誌的方法
- 歸檔oracle alert日誌Oracle
- 14. 日誌歸檔
- Oracle歸檔日誌清理Oracle
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- 批量註冊歸檔日誌
- DG歸檔日誌缺失恢復
- ArgoWorkflow教程(四)---Workflow & 日誌歸檔Go
- logminer異機挖掘歸檔日誌
- oracle 刪除過期的歸檔日誌Oracle
- PostgreSQL的xlog/Wal歸檔及日誌清理SQL
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- rman 還原歸檔日誌(restore archivelogRESTHive
- oracle11G歸檔日誌管理Oracle
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- 測試在丟失歸檔日誌的情況下,跳過部分歸檔日誌進行資料恢復資料恢復
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- oracle dg 歸檔日誌恢復情況Oracle
- 【SQL】Oracle 歸檔日誌暴增原因分析SQLOracle
- Oracle歸檔日誌暴增排查優化Oracle優化
- DG_保證歸檔日誌不能隨意被刪除的四種方法
- 限制 Apache日誌檔案大小的方法Apache
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- [20221121]rman刪除歸檔日誌問題.txt
- oracle資料庫歸檔日誌量陡增分析Oracle資料庫
- mysql開啟慢日誌MySql
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle
- 對歸檔模式下CLEAR 未歸檔日誌後恢復資料庫的一點看法模式資料庫
- MogDB/openGauss誤刪未歸檔的xlog日誌如何解決
- 測試,ogg從歸檔日誌中抽取資料
- 開啟PHP的錯誤log日誌PHP
- Ubuntu 下開啟 crontab日誌Ubuntu
- 通過RMAN設定standby接收日誌後主庫歸檔日誌才可刪除