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 Dataguard故障轉移(failover)操作OracleAI
- Oracle rman duplicate遷移測試Oracle
- NBU恢復Oracle通道完成後RMAN沒有進度Oracle
- oracle ORA-01180 ORA-01110(rman恢復問題)Oracle
- RMAN中的通道分配
- 故障分析 | show processlist 引起的效能問題
- Oracle使用RMAN從Windows遷移資料到LinuxOracleWindowsLinux
- dolphinscheduler 實現master當機故障轉移能力原始碼分析AST原始碼
- Oracle RMAN備份以及壓縮原理分析Oracle
- Mysql MHA部署-05故障轉移MySql
- 【Azure Redis】因為Redis升級引發了故障轉移後的問題討論Redis
- 4.2.14.3 為Oracle呼叫介面客戶端啟用快速連線故障轉移Oracle客戶端
- redis健康檢查與故障轉移Redis
- Sentinel哨兵模式解決故障轉移模式
- 5 切換和故障轉移操作
- SQLServer 2012 AG強制故障轉移SQLServer
- [20190116]rman的老問題.txt
- [20190522]rman備份問題.txt
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 3模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 6模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 5模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 4模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 2模式
- [AlwaysOn] AlwaysOn可用性組的故障轉移和故障轉移模式[中英文對照] 1模式
- RMAN(轉)
- ORACLE rman與RMAN-00054&ORA-09945Oracle
- 故障分析 | 租戶 memstore 記憶體滿問題排查記憶體
- RabbitMQ真實生產故障問題還原與分析MQ
- 【ASK_ORACLE】手動配置DataGuard的自動化Client Failover(故障轉移)的serviceOracleclientAI
- Elixir 分散式 Application 故障轉移和接管分散式APP
- 【Redis】Redis Cluster-叢集故障轉移Redis
- Oracle 修改預設監聽埠故障分析Oracle
- 【RMAN】Oracle rman 常用命令參考Oracle
- Oracle使用RMAN將普通資料檔案轉成ASMOracleASM
- Oracle 19C RAC腦裂問題分析Oracle
- Redis 故障轉移、高可用方案,都在這了!Redis
- 伺服器叢集的故障轉移方案伺服器