最近在从活动数据库进行异机克隆时碰到了ORA-17629,ORA-17627,ORA-12154的错误,起初以为是一个Bug呢。Oracle Bug着实太多了,已经成了习惯性思维了。汗!错误提示是无法连接到连接到远程数据库,连接字符串无法解析。咦,配置了从auxiliary DB到target DB的tnsnames,且都是连通的阿......

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)
        )
      )

-- Author : Robinson Cheng
    -- Blog   : http://blog.csdn.net/robinson_0612

解决方案
        在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时,成功鸟,喝茶哟!

3、MetaLink的描述(Doc ID 1144273.1)
    Applies to: 
    Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
    Information in this document applies to any platform.

Symptoms

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
        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.
  
        In the tnsnames.ora on the machine of the TARGET database, there are 2 services created to connect to auxiliary database that have the same "service name" but "different" configuration.

Possible Cause 2:
  
        Mismatch of Parameters DEFAULT_DOMAIN and DB_DOMAIN
  
        db_domain=PROD.world         # init.ora
        default_domain=PROD.WORLD    # sqlnet.ora
  
        # DEFAULT_DOMAIN defined on sqlnet.ora is 'case' sensitive and when defined must match 
           DB_DOMAIN initialization parameter

Solution

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.
  
        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 <target_db>
        % tnsping <auxiliary_db>
      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'.

RMAN duplicate from active遇到ora-17167,ora-12154的更多相关文章

  1. 使用RMAN DUPLICATE...FROM ACTIVE DATABASE创建物理standby database

    Applies to: Oracle Server - Enterprise Edition - Version 11.1.0.6 to 11.2.0.4 [Release 11.1 to 11.2] ...

  2. 基于RMAN从活动数据库异机克隆(rman duplicate from active DB)

    Oracle 11g RMAN能够实现基于活动数据库进行异机克隆,从而省去需要先备份再ftp到辅助服务器的过程.这一切可以全部交给Oracle来搞定.在克隆期间,Oracle会读取Target DB的 ...

  3. RMAN 'Duplicate From Active Database' Feature in Oracle11g (Doc ID 452868.1)

    RMAN 'Duplicate From Active Database' Feature in Oracle11g (Doc ID 452868.1) APPLIES TO: Oracle Data ...

  4. 关于 rman duplicate from active database 搭建dataguard--系列一

    关于 rman duplicate from active database.详细操作实际为backup as copy .会拷贝非常多空块.对于那些数据库数据文件超过100G的都不是非常建议用:在非 ...

  5. RMAN duplicate from active 时遭遇 ORA-17627 ORA-12154

    最近在从活动数据库进行异机克隆时碰到了ORA-17629,ORA-17627,ORA-12154的错误,起初以为是一个Bug呢.Oracle Bug着实太多了,已经成了习惯性思维了.汗!错误提示是无法 ...

  6. RMAN duplicate from active database

    在Oracle 11G有二种方法实现duplicate: 1.Active database duplication 2.Backup-based duplication Active databas ...

  7. Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE执行结果

    > run { > allocate channel prmy1 type disk; > allocate channel prmy2 type disk; > alloca ...

  8. 使用 rman duplicate from active database 搭建dataguard 手记--系列二

    run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 typ ...

  9. Oracle 11gR2使用RMAN duplicate复制数据库

    11g的RMAN duplicate 个人感觉比10g的先进了很多,10g需在rman备份的基础上进行复制,使用RMAN duplicate创建一个数据完全相同但DBID不同的数据库.而11g的RMA ...

随机推荐

  1. hdu 2389(最大匹配bfs版)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2389 思路:纯裸的一个最大匹配题,不过悲摧的是以前一直用的dfs版一直过不了,TLE无数次啊,然后改成 ...

  2. iOS开发--开发者帐号

    iOS应用上线 http://www.jianshu.com/p/ffddc5e5f0b9 http://www.jianshu.com/p/986e02d38f1b 好不容易终于申请下来了ios 公 ...

  3. MySql对空间数据库的支持

    地址: MySQL5.1中文在线API:http://doc.mysql.cn/mysql5/refman-5.1-zh.html-chapter/spatial-extensions-in-mysq ...

  4. oracle11g 修改字符集 修改为ZHS16GBK

    1.cmd下,cd到oracle数据库软件的服务器端 如:D:\app\Administrator\product\11.2.0\dbhome_1\BIN 2.输入set ORACLE_SID=你想进 ...

  5. 解密ThreadLocal

    原文:http://qifuguang.me/2015/09/02/%5BJava%E5%B9%B6%E5%8F%91%E5%8C%85%E5%AD%A6%E4%B9%A0%E4%B8%83%5D%E ...

  6. nodpad++正则替换

    则表达式是一个查询的字符串,它包含一般的字符和一些特殊的字符,特殊字符可以扩展查找字符串的能力,正则表达式在查找和替换字符串的作用不可忽视,它 能很好提高工作效率. EditPlus的查找,替换,文件 ...

  7. 将SQL Azure数据库备份到本地SQL Server 2012

    整个备份过程可以分为如下两大步骤进行: 一.通过“Export Data-tier Application”先将目标SQL Azure的数据库备份到本地,详细步骤如下: 1.启动SQL Server ...

  8. dojo 六 使用query dojo/query

    要使用query,就要引入dojo/query包.query可以根据Dom里节点的标签名.id名.class名来检索一个或多个节点.---------------------------------- ...

  9. Java 全角字符转半角字符

    1.java代码里有时候会遇到代码注入的安全问题,为了防止这种问题,增加了一个过滤功能.主要是过滤全角字符,把url不能识别的全角字符转换成半角字符 public class Test { publi ...

  10. 《OD学hadoop》第一周0626

    一.磁盘管理 Linux添加新硬盘.分区.格式化.自动挂载 http://lxsym.blog.51cto.com/1364623/321643 给Linux系统新增加一块硬盘 http://www. ...