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
- RAC 開啟歸檔日誌
- postgresql開啟歸檔日誌SQL
- oracle 歸檔日誌開啟,關閉Oracle
- 關閉和開啟歸檔日誌
- 恢復歸檔日誌檔案的常用方法
- 歸檔日誌
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- RAC下啟動日誌歸檔模式模式
- 歸檔日誌刪除的五種方法
- oracle歸檔日誌Oracle
- Oracle 歸檔日誌Oracle
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- 歸檔日誌的刪除
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- 控制檔案/歸檔日誌
- RMAN備份整庫和歸檔日誌的方法
- 歸檔日誌多歸檔路徑 duplex
- 日誌檔案和歸檔日誌檔案的關係以及如何切換日誌
- 歸檔oracle alert日誌Oracle
- 14. 日誌歸檔
- PostgreSQL歸檔日誌配置SQL
- rman清理歸檔日誌
- archive log 歸檔日誌Hive
- 備份歸檔日誌
- 歸檔日誌 現象
- Oracle歸檔日誌清理Oracle
- 歸檔模式下的日誌檔案丟失的解決方法模式
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- 當ORACLE歸檔日誌滿後如何正確刪除歸檔日誌Oracle
- 用RMAN備份歸檔日誌時檢查歸檔日誌是否存在
- 誤刪歸檔日誌除導致備份歸檔日誌失敗
- dataguard的啟動和應用歸檔日誌的語句
- 聯機重做日誌、歸檔日誌、備用重做日誌
- 備份歸檔日誌檔案
- 日誌檔案和歸檔管理
- 刪除歸檔日誌檔案