Oracle Rman多通道故障轉移問題分析
問題現象:
近期公司做資料庫冗餘測試,停掉RAC其中一個節點後,發現本地自動備份和清理歸檔的指令碼執行失敗。
指令碼類似如下:
run { allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; ****** }
報錯如下:
RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-12001: could not open channel ch1 RMAN-10008: could not create channel context RMAN-10003: unable to connect to target database ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
原因分析:
經測試,此多通道寫法無法實現故障轉移。
測試過程如下:
[oracle@rac2 cjc]$ rman target / RMAN> run { allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; show all; }2> 3> 4> 5>
allocated channel: ch1 channel ch1: SID=716 instance=oradb1 device type=DISK allocated channel: ch2 channel ch2: SID=730 instance=oradb2 device type=DISK RMAN configuration parameters for database with db_unique_name ORADB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/db/product/19.0.0/dbs/snapcf_oradb1.f'; # default released channel: ch1 released channel: ch2
停掉節點1例項後:
[oracle@rac1 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 9 18:51:48 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> shutdown immediate
再次連線rman,報錯
oracle@rac2 ~]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 9 18:56:39 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADB (DBID=2810081861) RMAN> run { allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; show all; }2> 3> 4> 5> using target database control file instead of recovery catalog RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-12001: could not open channel ch1 RMAN-10008: could not create channel context RMAN-10003: unable to connect to target database ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
是否和通道順序有關呢?將ch2寫到前面,測試報錯依舊,看來和順序無關
RMAN> run { allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; show all; }2> 3> 4> 5> allocated channel: ch2 channel ch2: SID=25 instance=oradb2 device type=DISK released channel: ch2 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-12001: could not open channel ch1 RMAN-10008: could not create channel context RMAN-10003: unable to connect to target database ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
把停掉的節點通道註釋掉以後可以正常執行命令
run { #allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; show all; } [oracle@rac2 ~]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 9 18:59:03 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADB (DBID=2810081861) RMAN> run { #allocate channel ch1 type disk connect sys/oracle@rac1:1521/oradb; allocate channel ch2 type disk connect sys/oracle@rac2:1521/oradb; show all; }2> 3> 4> 5> using target database control file instead of recovery catalog allocated channel: ch2 channel ch2: SID=479 instance=oradb2 device type=DISK RMAN configuration parameters for database with db_unique_name ORADB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/db/product/19.0.0/dbs/snapcf_oradb2.f'; # default released channel: ch2
如何在RAC兩個節點都保持正常的情況下,可以使用多個節點併發通道提高速度,在某個節點出現故障,通道自動轉移到另一個節點呢?
可以嘗試使用10g連線RAC的指定多個vip的方式。
將如下內容加入到tnsnames.ora檔案中。
vip1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) #(LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb) ) ) vip2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) #(LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb) ) )
測試在不使用LOAD_BALANCE = yes情況下,優先連線第一個地址,當第一個地址連不通了,會自動去連線第二個地址,實現故障轉移。
[oracle@rac2 admin]$ sqlplus system/oracle@vip1 show parameter name [oracle@rac2 admin]$ sqlplus system/oracle@vip2 show parameter name
修改RMAN指令碼
run { allocate channel ch1 type disk connect sys/oracle@vip1; allocate channel ch2 type disk connect sys/oracle@vip2; show all; release channel ch1; release channel ch2; }
在節點1例項不啟動的情況下,可以正常執行命令了。
[oracle@rac2 admin]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 9 19:36:14 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADB (DBID=2810081861) RMAN> run { allocate channel ch1 type disk connect sys/oracle@vip1; allocate channel ch2 type disk connect sys/oracle@vip2; show all; release channel ch1; release channel ch2; }2> 3> 4> 5> 6> 7> using target database control file instead of recovery catalog allocated channel: ch1 channel ch1: SID=717 instance=oradb1 device type=DISK allocated channel: ch2 channel ch2: SID=489 instance=oradb2 device type=DISK RMAN configuration parameters for database with db_unique_name ORADB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/db/product/19.0.0/dbs/snapcf_oradb2.f'; # default released channel: ch1 released channel: ch2
###chenjuchao 20210509 20:30###
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2771455/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- weblogic多資料來源故障轉移問題Web
- Oracle 轉移符問題Oracle
- 【故障-ORACLE】_NEXT_OBJE Exclusive鎖問題分析OracleOBJ
- Oracle Dataguard故障轉移(failover)操作OracleAI
- ORACLE RAC TAF 配置(透明故障轉移)Oracle
- 深度分析ORACLE熱點塊問題(轉)Oracle
- 故障分析 | show processlist 引起的效能問題
- Oracle RAC 客戶端故障轉移(failover) TAFOracle客戶端AI
- 搭建Windows故障轉移群集Windows
- 理解透明應用程式故障轉移 (TAF) 和快速連線故障轉移 (FCF)
- 利用RMAN遷移表空間碰到的問題(五)
- 利用RMAN遷移表空間碰到的問題(四)
- 利用RMAN遷移表空間碰到的問題(三)
- 利用RMAN遷移表空間碰到的問題(二)
- 利用RMAN遷移表空間碰到的問題(一)
- [WK-T]ORACLE 10G 配置故障轉移(Failover)Oracle 10gAI
- NBU恢復Oracle通道完成後RMAN沒有進度Oracle
- Backup And Recovery User's Guide-RMAN架構-RMAN通道-通道和裝置GUIIDE架構
- 【Azure Redis】因為Redis升級引發了故障轉移後的問題討論Redis
- Mysql MHA部署-05故障轉移MySql
- dolphinscheduler 實現master當機故障轉移能力原始碼分析AST原始碼
- Oracle rman duplicate遷移測試Oracle
- 故障分析 | 租戶 memstore 記憶體滿問題排查記憶體
- RabbitMQ真實生產故障問題還原與分析MQ
- Oracle RMAN 備份控制檔案報錯問題Oracle
- 【Oracle 12c Flex Cluster專題 】— Leaf Node的故障遷移OracleFlex
- (轉)linux下rman沒有反應問題Linux
- 【轉】Oracle rman備份Oracle
- Backup And Recovery User's Guide-RMAN架構-RMAN通道-自動和手動通道GUIIDE架構
- 多版本oracle 軟體的問題Oracle
- 5 切換和故障轉移操作
- Sentinel哨兵模式解決故障轉移模式
- redis健康檢查與故障轉移Redis
- Oracle 利用RMAN 完成資料遷移Oracle
- Oracle 使用RMAN COPY 移動 Datafile 位置Oracle
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 3模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 6模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 5模式