DG搭建--做主库复制到备库发生错误

在主备库其他设置都做好了以后,进行rman 的duplicate 操作,将主库复制到备库时发生如下错误:
操作过程及问题的发生:

  1. [oracle@ming ~]$ rman target sys/oracle@pmxdb auxiliary sys/oracle@smxdb

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Tue Aug 18 11:57:02 2015

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

  4. connected to target database: MXDB (DBID=2294087120)
  5. connected to auxiliary database: MXDB (not mounted)

  6. RMAN> duplicate target database for standby nofilenamecheck from active database;

  7. Starting Duplicate Db at 18-AUG-15
  8. using target database control file instead of recovery catalog
  9. allocated channel: ORA_AUX_DISK_1
  10. channel ORA_AUX_DISK_1: SID=134 device type=DISK

  11. contents of Memory Script:
  12. {
  13.    backup as copy reuse
  14.    targetfile '/yang/u02/oracle/dbs/orapwmxdb' auxiliary format
  15.  '/yang/u02/oracle/dbs/orapwmxdb' ;
  16. }
  17. executing Memory Script

  18. Starting backup at 18-AUG-15
  19. allocated channel: ORA_DISK_1
  20. channel ORA_DISK_1: SID=15 device type=DISK
  21. RMAN-00571: ===========================================================
  22. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  23. RMAN-00571: ===========================================================
  24. RMAN-03002: failure of Duplicate Db command at 08/18/2015 11:57:48
  25. RMAN-05501: aborting duplication of target database
  26. RMAN-03015: error occurred in stored script Memory Script
  27. RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/18/2015 11:57:48
  28. ORA-17629: Cannot connect to the remote database server
  29. ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
  30. 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、备库:
分别做主库和备库的登录尝试:

  1. [oracle@ming ~]$ sqlplus sys/oracle@pmxdb as sysdba

  2. SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:38:01 2015

  3. Copyright (c) 1982, 2011, Oracle. All rights reserved.


  4. Connected to:
  5. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  7. SQL> exit
  8. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  9. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  10. [oracle@ming ~]$ sqlplus sys/oracle@smxdb as sysdba

  11. SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:38:11 2015

  12. Copyright (c) 1982, 2011, Oracle. All rights reserved.


  13. Connected to:
  14. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  15. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  16. SQL> exit

两个都登录成功,说明密码文件和备库的监听文件,以及tnsname.ora都没问题。

2、主库:
分别做主库和备库的登录尝试:


  1. [oracle@yang ~]$ sqlplus sys/oracle@pmxdb as sysdba

  2. SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:37:16 2015

  3. Copyright (c) 1982, 2011, Oracle. All rights reserved.

  4. ERROR:
  5. ORA-12154: TNS:could not resolve the connect identifier specified


  6. Enter user-name:
  7. ERROR:
  8. ORA-01017: invalid username/password; logon denied


  9. Enter user-name:
  10. ERROR:
  11. ORA-01017: invalid username/password; logon denied


  12. SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
  13. [oracle@yang ~]$ sqlplus sys/oracle@smxdb as sysdba

  14. SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 18 12:37:34 2015

  15. Copyright (c) 1982, 2011, Oracle. All rights reserved.

  16. ERROR:
  17. ORA-12154: TNS:could not resolve the connect identifier specified


  18. Enter user-name:
  19. ERROR:
  20. ORA-01017: invalid username/password; logon denied


  21. Enter user-name:
  22. ERROR:
  23. ORA-01017: invalid username/password; logon denied


  24. 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 文件


  1. LISTENER2 =
  2. (ADDRESS_LIST=
  3. (ADDRESS=(PROTOCOL=tcp)(HOST=yang.uplooking.com)(PORT=1521))
  4. (ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER1521)))
  5. SID_LIST_LISTENER=
  6. (SID_LIST=
  7. (SID_DESC=
  8. (GLOBAL_DBNAME=mxdb)
  9. (SID_NAME=mxdb)
  10. (ORACLE_HOME=/yang/u02/oracle)
  11. )
  12. (SID_DESC=
  13. (GLOBAL_DBNAME=pmxdb)
  14. (SID_NAME=mxdb)
  15. (ORACLE_HOME=/yang/u02/oracle)
  16. )
  17. (SID_DESC=
  18. (GLOBAL_DBNAME=pmxdb_DGMGRL)
  19. (SID_NAME=mxdb)
  20. (ORACLE_HOME=/yang/u02/oracle)
  21. )
  22. )
host以及实例名都与我们设计的相同,所以该文件没有问题,

接下来再查看tnsname.ora文件:

  1. mxdb =
  2. (DESCRIPTION =
  3. (ADDRESS = (PROTOCOL = TCP)(HOST = yang.uplooking.com)(PORT = 1521))
  4. (CONNECT_DATA =
  5. (SERVER = dedicated)
  6. (SERVICE_NAME = mxdb)
  7. )
  8. )
  9. pupdb =
  10. (DESCRIPTION =
  11. (ADDRESS = (PROTOCOL = TCP)(HOST = yang.uplooking.com)(PORT = 1521))
  12. (CONNECT_DATA =
  13. (SERVER = dedicated)
  14. (SERVICE_NAME = pupdb)
  15. )
  16. )
  17. supdb =
  18. (DESCRIPTION =
  19. (ADDRESS = (PROTOCOL = TCP)(HOST = ming.up.com)(PORT = 1521))
  20. (CONNECT_DATA =
  21. (SERVER = dedicated)
  22. (SERVICE_NAME = supdb)
  23. )
  24. )
发现我们的服务名不对,将所有的updb改为mxdb ,重新在主库上进行连接测试,成功。

重新进行rman的duplicate复制,这下就成功了。



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28946321/viewspace-1775678/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28946321/viewspace-1775678/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值