RMAN duplicate from active 时遭遇 RMAN-06136 ORA-17627 ORA-17629 ORA-12154
报错:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/08/2018 10:51:07
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: Oracle error from auxiliary database: ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
解决:
将oracle用户下的tnsnames.ora的内容拷贝到grid用户下的tnsnames.ora文件中。
(Doc ID 1144273.1):
If the listener is started from a different environment to rman client
Then server processes will try to resolve the AUXILIARY service name using $TNS_ADMIN/tnsnames.ora where the value of TNS_ADMIN is as set in the 'listener runtime environment'.
Duplicate From Active Database Errors : ORA-17629 ORA-17627 ORA-12154 (文档 ID 1144273.1)
In this Document
|
Symptoms |
|
Cause |
|
Solution |
Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Oracle Net Services - Version 11.2.0.4 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.
The duplicate database from active failed with the following errors :
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
Cause 1:
For Active Duplication you need to connect to the target and Auxiliary DB using net service name ,even if you are running RMAN at the Auxiliary DB.
The net service name to connect to the Auxiliary DB should also be configured at the target Database.
Possible Cause 2:
Mismatch of Parameters DEFAULT_DOMAIN and DB_DOMAIN
db_domain=PROD.world # init
default_domain=PROD.WORLD # sqlnet.ora
# DEFAULT_DOMAIN defined on sqlnet.ora is 'case' sensitive and when defined must match
DB_DOMAIN initialization parameter
1. To be sure that the tnsnames.ora file of each machine (machine where is the source database and machine where is the auxiliary database) has the service name to connect to auxiliary database.
If you are running with LDAP where there is no tnsnames.ora, then make sure ldap.ora file under Target's and Auxiliary's $ORACLE_HOMEs
2. Verify that there are not duplicate service_name with different configuration in the tnsnames.ora file.
As per the Step 2 of the below RMAN doc :
http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#i1008564
.
Step 2: Establish Oracle Net Connectivity to the Auxiliary Instance
When duplicating from an active database, you must first have connected as SYSDBA to the auxiliary instance by means of a net service name. This net service name must also be available on the source database instance.
The source database instance, to which RMAN is connected as TARGET, uses this net service name to connect directly to the auxiliary database instance.
Double check using the following commands on the TARGET and AUXILIARY
% tnsping
% tnsping
Once this is executed for the TARGET and AUXILIARY, it should return the same 'connect' information.
Additional Note:
If the listener is started from a different environment to rman client then server processes will try to resolve the AUXILIARY service name using $TNS_ADMIN/tnsnames.ora where the value of TNS_ADMIN is as set in the 'listener runtime environment'.
1、故障现象
--下面的操作在auxiliary DB所在的机器上完成
[oracle@linux4 ~]$ export ORACLE_SID=sybo3
[oracle@linux4 ~]$ sqlplus / as sysdba
SQL> startup nomount;
[oracle@linux4 ~]$ rman target sys/oracle@TAR auxiliary sys/oracle@AUX
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jul 31 16:00:59 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SYBO3 (DBID=2347733014)
connected to auxiliary database: SYBO3 (not mounted)
RMAN> duplicate database to sybo3 from active database spfile nofilenamecheck;
Starting Duplicate Db at 31-JUL-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=125 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/oracle/db_1/dbs/spfilesybo3.ora' auxiliary format
'/u01/oracle/db_1/dbs/spfilesybo3.ora' ;
sql clone "alter system set spfile= ''/u01/oracle/db_1/dbs/spfilesybo3.ora''";
}
executing Memory Script
Starting backup at 31-JUL-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/31/2013 16:01:07
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/31/2013 16:01:07
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
2、故障分析与解决
上面是一堆的RMAN与ORA相关错误号了
在执行脚本backup as copy reuse时出现了错误,也就是说备份的时候出现错误RMAN-03009
其次是ORA-17629,不能连接到远程数据库服务器,ORA-17627后跟着ORA-12154,说明是由于无法解析字符串
下面来看看ORA-17629到底是什么问题
[oracle@linux4 ~]$ oerr ora 17629
17629, 00000, "Cannot connect to the remote database server"
// *Cause: Connecting to the remote server specified by database connect
// string for netowrk file transfer failed.
// *Action: Check additional error messages
重要的提示信息:for netowrk file transfer failed,网络文件传输失败。
由于我们使用的是从活动数据库进行克隆,因此活动数据库的数据文件等等应当会通过网络复制到辅助数据库,更确切地是说是通过Oracle Net。
也就是说尽管我们在辅助数据库端配置了到target DB以及到Auxiliary DB的tnsnames的连接是不够的,target DB端也要连接到Auxiliary DB传送文件。
上面只是一个初步的推测,从Oracle Metalink找到了关于这个问题的描述。就是需要在两个服务器之间都配置到target DB与Auxiliary DB的tnsnames。
检查一下两个主机的tnsnames.ora的配置
[oracle@linux3 admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/oracle/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TAR = #Target Server只有到Target DB的tnsnames.ora
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.25)(PORT = 1531))
)
(CONNECT_DATA =
(SERVICE_NAME = SYBO3.ORASRV.COM)
)
)
[oracle@linux4 admin]$ more tnsnames.ora #Auxiliary Server有到Target DB和Auxiliary DB的tnsnames.ora
TAR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.25)(PORT = 1531))
)
(CONNECT_DATA =
(SERVICE_NAME = SYBO3.ORASRV.COM)
)
)
AUX =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.26)(PORT = 1531))
)
(CONNECT_DATA =
(SERVICE_NAME = SYBO3.ORASRV.COM)
)
)
解决方案
在Target Server端添加到Auxiliary DB的tnsnames.ora,即与Auxiliary server端使用相同的tnsnames entry
下面测试tnsnames的连通性
[oracle@linux3 admin]$ tnsping aux
[oracle@linux3 admin]$ tnsping tar
[oracle@linux4 admin]$ tnsping aux
[oracle@linux4 admin]$ tnsping tar
再次duplicate时,成功鸟,喝茶哟!
About Me
........................................................................................................................ ● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除 ● 本文在itpub( http://blog.itpub.net/26736162 )、博客园( http://www.cnblogs.com/lhrbest )和个人weixin公众号( xiaomaimiaolhr )上有同步更新 ● 本文itpub地址: http://blog.itpub.net/26736162 ● 本文博客园地址: http://www.cnblogs.com/lhrbest ● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/ ● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/ ● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826 ........................................................................................................................ ● QQ群号: 230161599 (满) 、618766405 ● weixin群:可加我weixin,我拉大家进群,非诚勿扰 ● 联系我请加QQ好友 ( 646634621 ) ,注明添加缘由 ● 于 2018-10-01 06:00 ~ 2018-10-31 24:00 在魔都完成 ● 最新修改时间:2018-10-01 06:00 ~ 2018-10-31 24:00 ● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解 ● 版权所有,欢迎分享本文,转载请保留出处 ........................................................................................................................ ● 小麦苗的微店 : https://weidian.com/s/793741433?wfr=c&ifr=shopdetail ● 小麦苗出版的数据库类丛书 : http://blog.itpub.net/26736162/viewspace-2142121/ ● 小麦苗OCP、OCM、高可用网络班 : http://blog.itpub.net/26736162/viewspace-2148098/ ● 小麦苗腾讯课堂主页 : https://lhr.ke.qq.com/ ........................................................................................................................ 使用 weixin客户端 扫描下面的二维码来关注小麦苗的weixin公众号( xiaomaimiaolhr )及QQ群(DBA宝典)、添加小麦苗weixin, 学习最实用的数据库技术。
........................................................................................................................ |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26736162/viewspace-2215543/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26736162/viewspace-2215543/