在主备库其他设置都做好了以后,进行rman 的duplicate 操作,将主库复制到备库时发生如下错误:
操作过程及问题的发生:
-
[oracle@ming ~]$ rman target sys/oracle@pmxdb auxiliary sys/oracle@smxdb
-
-
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Aug 18 11:57:02 2015
-
-
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
-
-
connected to target database: MXDB (DBID=2294087120)
-
connected to auxiliary database: MXDB (not mounted)
-
-
RMAN> duplicate target database for standby nofilenamecheck from active database;
-
-
Starting Duplicate Db at 18-AUG-15
-
using target database control file instead of recovery catalog
-
allocated channel: ORA_AUX_DISK_1
-
channel ORA_AUX_DISK_1: SID=134 device type=DISK
-
-
contents of Memory Script:
-
{
-
backup as copy reuse
-
targetfile '/yang/u02/oracle/dbs/orapwmxdb' auxiliary format
-
'/yang/u02/oracle/dbs/orapwmxdb' ;
-
}
-
executing Memory Script
-
-
Starting backup at 18-AUG-15
-
allocated channel: ORA_DISK_1
-
channel ORA_DISK_1: SID=15 device type=DISK
-
RMAN-00571: ===========================================================
-
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
-
RMAN-00571: ===========================================================
-
RMAN-03002: failure of Duplicate Db command at 08/18/2015 11:57:48
-
RMAN-05501: aborting duplication of target database
-
RMAN-03015: error occurred in stored script Memory Script
-
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/18/2015 11:57:48
-
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
分析:
关键问题应该在
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
这个部分,通过错误提示,应该是不能连接到远程数据库。
1、可能是密码文件的问题
2、可能是tnsname.ora 配置文件有误或监听文件有问题
尝试解决问题:
1、备库:
分别做主库和备库的登录尝试:
-
[oracle@ming ~]$ sqlplus sys/oracle@pmxdb as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:38:01 2015
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
-
Connected to:
-
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
-
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
-
SQL> exit
-
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
-
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
[oracle@ming ~]$ sqlplus sys/oracle@smxdb as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:38:11 2015
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
-
Connected to:
-
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
-
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
-
SQL> exit
两个都登录成功,说明密码文件和备库的监听文件,以及tnsname.ora都没问题。
2、主库:
分别做主库和备库的登录尝试:
-
[oracle@yang ~]$ sqlplus sys/oracle@pmxdb as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:37:16 2015
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
ERROR:
-
ORA-12154: TNS:could not resolve the connect identifier specified
-
-
-
Enter user-name:
-
ERROR:
-
ORA-01017: invalid username/password; logon denied
-
-
-
Enter user-name:
-
ERROR:
-
ORA-01017: invalid username/password; logon denied
-
-
-
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
-
[oracle@yang ~]$ sqlplus sys/oracle@smxdb as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:37:34 2015
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
ERROR:
-
ORA-12154: TNS:could not resolve the connect identifier specified
-
-
-
Enter user-name:
-
ERROR:
-
ORA-01017: invalid username/password; logon denied
-
-
-
Enter user-name:
-
ERROR:
-
ORA-01017: invalid username/password; logon denied
-
-
-
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
说明,主库的某些配置出现了问题,
首先密码文件:
由于我确定我只前做了密码的更改操作
[oracle@qing ~]$ orapwd file=/u01/oracle/11g/dbs/orapwupdb password=oracle force=y ignorecase=y
所以先排除密码错误的因素。
其次查看
listener.ora 文件
-
LISTENER2 =
-
(ADDRESS_LIST=
-
(ADDRESS=(PROTOCOL=tcp)(HOST=yang.uplooking.com)(PORT=1521))
-
(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER1521)))
-
-
-
SID_LIST_LISTENER=
-
(SID_LIST=
-
(SID_DESC=
-
(GLOBAL_DBNAME=mxdb)
-
(SID_NAME=mxdb)
-
(ORACLE_HOME=/yang/u02/oracle)
-
)
-
(SID_DESC=
-
(GLOBAL_DBNAME=pmxdb)
-
(SID_NAME=mxdb)
-
(ORACLE_HOME=/yang/u02/oracle)
-
)
-
(SID_DESC=
-
(GLOBAL_DBNAME=pmxdb_DGMGRL)
-
(SID_NAME=mxdb)
-
(ORACLE_HOME=/yang/u02/oracle)
-
)
-
)
host以及实例名都与我们设计的相同,所以该文件没有问题,
接下来再查看tnsname.ora文件:
-
mxdb =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = yang.uplooking.com)(PORT = 1521))
-
(CONNECT_DATA =
-
(SERVER = dedicated)
-
(SERVICE_NAME = mxdb)
-
)
-
)
-
-
pupdb =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = yang.uplooking.com)(PORT = 1521))
-
(CONNECT_DATA =
-
(SERVER = dedicated)
-
(SERVICE_NAME = pupdb)
-
)
-
)
-
-
supdb =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = ming.up.com)(PORT = 1521))
-
(CONNECT_DATA =
-
(SERVER = dedicated)
-
(SERVICE_NAME = supdb)
-
)
-
)
发现我们的服务名不对,将所有的updb改为mxdb ,重新在主库上进行连接测试,成功。
重新进行rman的duplicate复制,这下就成功了。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28946321/viewspace-1775678/
,如需转载,请注明出处,否则将追究法律责任。