This discussion is archived
14 Replies Latest reply: Dec 27, 2012 3:27 AM by ggiulian RSS

Help with RMAN duplicate command

ggiulian Newbie
Currently Being Moderated
Hi All,

I need to restore one oracle rac into an other server with other dbname.

I found note 452868.1 (on link https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=452868.1#aref_section31)

On my system there is grid user and listener is managed by grid.
After start nomount a simple test istance as note, i can see service test in listener status. but i read blocked service:

Service "TEST" has 1 instance(s).
Instance "TEST", status BLOCKED, has 1 handler(s) for this service...

When I try to duplicate db from rman from test server:

RMAN>
connect target (to source database)
connected to target database: DBCORP (DBID=2331160416)
connect auxiliary /
connected to auxiliary database: TEST (not mounted)
connect catalog rmancat/rmanpwd@rmancat
connected to recovery catalog database

RMAN> DUPLICATE TARGET DATABASE TO 'TEST' FROM ACTIVE DATABASE;


Starting Duplicate Db at 14-DEC-12
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/14/2012 12:31:27
RMAN-05501: aborting duplication of target database
RMAN-06217: not connected to auxiliary database with a net service name


Where is my mistake ???
  • 1. Re: Help with RMAN duplicate command
    Balazs Papp Expert
    Currently Being Moderated
    as the error states, for active duplication you have to connect both side using a net service name, so "target /" or "auxiliary /" wont work in this scenario
    the proper method is written in the note

    dynamic registration in NOMOUNT state will result a BLOCKED service
    thats why you need to edit your listener.ora and use static registration
  • 2. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    I'don't think I can modify listener.ora.

    I've one grid environment and listener.ora contains:
    [grid@ii02db01 admin]$ more listener.ora
    LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
    LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
    LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
    LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
    ADMIN_RESTRICTIONS_ADMIN=ON
    [grid@ii02db01 admin]$
  • 3. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    Ok, I backup listener.* on grid.

    stop all listener service and create a static listener.ora.

    Now, when I try to connect into rman to the auxiliarydb, i receive:

    RMAN> connect auxiliary sys/sys@test

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-04006: error from auxiliary database: ORA-01031: insufficient privileges
  • 4. Re: Help with RMAN duplicate command
    MahirM.Quluzade Guru
    Currently Being Moderated
    Hi,

    1. Add network service name of TEST database to TNSNAMES.ora

    Did you created password file for target database test, and did you added service to listener.ora?
    After create password file and added service to listener.ora , you must reload or restart listener.
    Start target TEST database nomount mode.
    Connect to target database as auxiliary with RMAN as
     first connect source database with rman use sys/<password>
     rman auxiliary sys/<password>@test
    Check, please.


    Regards
    Mahir M. Quluzade
    www.mahir-quluzade.com
  • 5. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    Hi, thanks for your answer.....

    in listener.ora I have:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = TEST)
    )
    )
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ii02db01)(PORT = 1521))
    )



    in tnsnames.ora I add:
    TEST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ii02db01)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = TEST)
    (UR = A)
    )
    )


    Test instance is in nomount state.
    By tnsping connections in ok
    tnsping test
    TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 14-DEC-2012 15:01:59
    Copyright (c) 1997, 2010, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ii02db01)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TEST) (UR = A)))
    OK (0 msec)

    By sqlplus
    sqlplus sys/sys@test
    SQL*Plus: Release 11.2.0.2.0 Production on Fri Dec 14 15:02:41 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    Process ID: 0
    Session ID: 0 Serial number: 0

    But if I use sysdba i receive
    Enter user-name: sys/sys@test as sysdba
    ERROR:
    ORA-01031: insufficient privileges

    I create passwd file with the following command:
    orapwd file=orapwdTEST password=sys entries=10
  • 6. Re: Help with RMAN duplicate command
    MahirM.Quluzade Guru
    Currently Being Moderated
    I think you must change listener.ora to
    # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = ii02db01)(PORT = 1521))
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
      )
    SID_LIST_LISTENER =
      (SID_LIST =
       (SID_DESC =
          (SID_NAME = test)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome)
        )
       )
    ADR_BASE_LISTENER = /u01/app/oracle
    and reload listener.
    tnsping test
    orapwd file=$ORACLE_HOME/dbs/orapwdTEST password=<password> entries=10; 
    witch user is using connect to database with sqlplus?
    is it oracle? and is this user groups is
    uid=502(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),506(asmdba)
    Please check, again!

    Mahir
  • 7. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    SORRY!

    I found another my mistake.... I created orapwdTEST file but the correct name must be orapwTEST......
  • 8. Re: Help with RMAN duplicate command
    MahirM.Quluzade Guru
    Currently Being Moderated
    Yes, it is true, pasword file name must be : orapwTEST.
    I copied from your post, I wrote mistake, too.


    I think, you are already started duplicate.

    Mahir
  • 9. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    Yes.... now I start duplicate, but now new problem uhm....

    The output:

    RMAN> DUPLICATE TARGET DATABASE TO 'TEST' FROM ACTIVE DATABASE;

    Starting Duplicate Db at 14-DEC-12
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: SID=42 device type=DISK
    allocated channel: ORA_AUX_DISK_2
    channel ORA_AUX_DISK_2: SID=50 device type=DISK
    allocated channel: ORA_AUX_DISK_3
    channel ORA_AUX_DISK_3: SID=58 device type=DISK
    allocated channel: ORA_AUX_DISK_4
    channel ORA_AUX_DISK_4: SID=66 device type=DISK
    allocated channel: ORA_AUX_DISK_5
    channel ORA_AUX_DISK_5: SID=74 device type=DISK
    allocated channel: ORA_AUX_DISK_6
    channel ORA_AUX_DISK_6: SID=82 device type=DISK
    allocated channel: ORA_AUX_DISK_7
    channel ORA_AUX_DISK_7: SID=90 device type=DISK
    allocated channel: ORA_AUX_DISK_8
    channel ORA_AUX_DISK_8: SID=98 device type=DISK

    contents of Memory Script:
    {
    sql clone "alter system set db_name =
    ''DBCORP'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
    sql clone "alter system set db_unique_name =
    ''TEST'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
    shutdown clone immediate;
    startup clone force nomount
    backup as copy current controlfile auxiliary format '/u01/app/oracle/product /11.2.0.2/dbhome_1/dbs/cntrlTEST.dbf';
    alter clone database mount;
    }
    executing Memory Script

    sql statement: alter system set db_name = ''DBCORP'' comment= ''Modified by RM AN duplicate'' scope=spfile

    sql statement: alter system set db_unique_name = ''TEST'' comment= ''Modified by RMAN duplicate'' scope=spfile

    Oracle instance shut down

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 12/14/2012 15:36:00
    RMAN-06174: not connected to auxiliary database
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-04006: error from auxiliary database: ORA-01031: insufficient privileges

    RMAN>


    I run dupllicate command in the destination server....

    The connection to target (production environment) auxiliary (destination server) and catalog (other server) are ok....

    I don't understand..... rman run shutdown auxilary and can not restart it ?
  • 10. Re: Help with RMAN duplicate command
    MahirM.Quluzade Guru
    Currently Being Moderated
    Did you connected auxiliary success?
    RMAN> connect auxiliary sys/sys@test
  • 11. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    Yes... connection to target, auxiliary and catalog is ok.


    RMAN> connect auxiliary sys/sys@test

    connected to auxiliary database: TEST (not mounted)

    RMAN>

    Edited by: ggiulian on 17-dic-2012 0.07
  • 12. Re: Help with RMAN duplicate command
    MahirM.Quluzade Guru
    Currently Being Moderated
    Not duplicate wirking?
  • 13. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    No....

    start duplicate,
    allocate channel

    After this rman creates a memory script for:
    shutdown clone immediate;
    startup clone force nomount
    backup as copy current controlfile auxiliary format '/u01/app/oracle/product /11.2.0.2/dbhome_1/dbs/cntrlTEST.dbf';
    alter clone database mount;

    Shutdown is ok, but at the startup I receive ORA-01031: insufficient privileges
  • 14. Re: Help with RMAN duplicate command
    ggiulian Newbie
    Currently Being Moderated
    Ok, I solved it.

    I need to set the same target sys password for aux db-

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points