1 2 Previous Next 21 Replies Latest reply: Sep 25, 2013 2:39 PM by 817202 RSS

    Problem While Creating Physical Standby Using RMAN

    817202

      Hi Guru's

       

      May be this incidence you all face while creating physical standby DB. I try to create Physical standby database Using RMAN Duplicate Command from one server

      (pri machine) to Standby Machine.

       

      The steps i followed to create the above are as follows:

      Step 1:- Enable Forced Logging

      SQL> ALTER DATABASE FORCE LOGGING;

      Step 2:- Configure a Standby Redo Log

      SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 10

        2> ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500M;

      Step 3:- Set Primary Database Initialization Parameters

      SQL> create pfile='?/dbs/pfileorcl.ora' from spfile;

       

      Edit the pfile to add the standby parameters, here shown:

       

      db_unique_name='orcl'

      LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldr)'

      LOG_ARCHIVE_DEST_2='SERVICE=orcldr LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldr'

      *.fal_server=orcldr

      *.fal_client=orcl

      *.standby_file_management=auto

       

      Step 4:- Enable Archiving

      SQL> SHUTDOWN IMMEDIATE;

      SQL> STARTUP MOUNT;

      SQL> ALTER DATABASE ARCHIVELOG;

      SQL> ALTER DATABASE OPEN;

       

      Step 5:- Setup tnsnames for standby database

      This should be done on primary database by altering tnsnames.ora or using NetCA command, and create it by the name orcldr

       

      orcldr =

      (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = orcldr)

      )

      )

       

       

      Step 6:- Backup database and copy it to standby

      This backup script should be run on primary and copied to standby on the same mount point, running this scripts using RMAN, all files under /rman_backup should be copied to /rman_backup on standby server.

       

      $rman target /

      RMAN> run

      {

      allocate channel c1 type disk;

      allocate channel c2 type disk;

      backup database format '/rman_backup/%U';

      backup archivelog all format '/rman_backup /%U';

      backup current controlfile for standby format '/rman_backup/%U';

      }

       

      Step 7:- Standby Database Steps

       

       

      Installing Oracle Software

      This should be same release and patchset with exactly same ORACLE_HOME mount point.

       

       

      Setting Up listener

      Create and start a listener on standby database using NetCA, or creating listener.ora in $ORACLE_HOME/network/admin

       

      LISTENER =

        (DESCRIPTION =

          (ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))

        )

       

      Step 8:- Set Standby Database Initialization Parameters

       

      Copying the pfile created in primary database and renames it to initorcldr.ora, and changes these parameters:

       

      db_unique_name='orcldr'

      LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcldr,orcl)'

      LOG_ARCHIVE_DEST_2='SERVICE=orcl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'

      *.fal_server=orcl

      *.fal_client=orcldr

      *.LOG_ARCHIVE_DEST_STATE_2='ENABLE'

       

      Step 9:- Setup tnsnames for primary database

      This should be done on standby database by altering tnsnames.ora or using NetCA command, and create it by the name orcl

       

      orcl =

      (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = primary-svr)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = orcl)

      )

      )

       

      Step 10:- Copy a Password File

      A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. Copy orapworcl to $ORACLE_HOME/dbs and rename file to orapworcldr

       

      Step 11:- Create mount points for Oracle

      Mount point should be created on standby server with the same convention used in primary, this includes the location for controlfiles, redo logs, datafiles, archive log destination and alert logs.

       

      $ mkdir -p /u01/app/oracle/oradata/orcl/

      $ mkdir -p /u01/app/oracle/flash_recovery_area/

      $ mkdir -p /u01/app/oracle/admin/orcl/adump

      $ mkdir -p /u01/app/oracle/admin/orcl/bdump

      $ mkdir -p /u01/app/oracle/admin/orcl/cdump

      $ mkdir -p /u01/app/oracle/admin/orcl/udump

       

      Step 12:- Use RMAN to restore backup and setup standby

      Connect to RMAN and execute the following command to create standby database, this should be performed on standby server after copying backup and setting tnsnames.

       

      $ export ORACLE_SID=orcldr

      $ rman target sys/tiger@orcl auxiliary sys/tiger@orcldr

       

      RMAN> duplicate target database for standby dorecover;

       

       

      Here i am getting problem as :

       

      While trying to connect to traget database and auxiliary database i notice that when RMAN is connect to both databases it shows

      orcl ( DBID xyz)

      orcl (not mounted)

       

      Here in my view the second database must be standby database name or auxiiary db name is standby db name which in my case is orcldr

       

      after this issue i am facing the second issues as :

      in command

       

      duplicate target database for standby dorecover;

      After modifying the command to

       

      RMAN> duplicate target database to "standby";

       

      rman-05520 database name mismatch

       

      Can u please let me know where i am mistaking

        • 1. Re: Problem While Creating Physical Standby Using RMAN
          mseberg

          Hello;

           

          duplicate target database to "standby";

           

          I would expect you to start the standby nomount:

           

          startup nomount pfile ='....'

           

          Then connect like this:

           

          rman target sys/password@PRIMARY auxiliary /

           

          and run something like this

           

          RMAN> run {

          allocate channel C1 device type disk;

          allocate auxiliary channel C2 device type disk;

          duplicate target database for standby nofilenamecheck;

          }

           

           

          The db_name in the pfile should be the same as the Primary database. Make sure that you specify the same database name as specified in init.ora file, otherwise, you would get “RMAN-05520: database name mismatch”

           

          DETAILED RMAN DUPLICATE FOR STANDBY

           

          Best Regards

           

          mseberg

          • 2. Re: Problem While Creating Physical Standby Using RMAN
            817202

            As you mentioned i already done that

            Like on standby database set oracle_sid=orcl

            rman target sys/tiger@orcl auxiliary sys/tiger@orcldr

             

            RMAN> run {

            allocate channel C1 device type disk;

            allocate auxiliary channel C2 device type disk;

            duplicate target database for standby nofilenamecheck;

            }

             

            but after this the script is going to be hanged. i am watching side by side whether datafiles or control files are created they are created but the above mentioned script is hanged.

             

            One thing as above i mentioned as well

             

            While trying to connect to traget database and auxiliary database i notice that when RMAN is connect to both databases it shows

            orcl ( DBID xyz)

            orcl (not mounted)

             

            Here in my view the second database must be standby database name or auxiiary db name is standby db name which in my case is orcldr

            • 3. Re: Problem While Creating Physical Standby Using RMAN
              mseberg

              So does "orcldr" match "orcl" ?

               

              I think the mismatch is the cause of your error.

               

              Here's the exact error using Oracle 10


               

              http://jmehtablog.blogspot.com/2010/09/cloning-oracle-database-on-different.html

               

              Check out step 10.

               

              http://oratip.com/RMAN-05520.html

               

              Best Regards

               

              mseberg

               

              Message was edited by: mseberg

              • 4. Re: Problem While Creating Physical Standby Using RMAN
                817202

                thanks for your update but when i click over this link it show problem in loading page.

                 

                Moreover my questions are whether i need to enter the pri db name as well as standby db name in tnsnames.ora file locate don standby file or shall i do this task on primary side only.

                • 5. Re: Problem While Creating Physical Standby Using RMAN
                  Hemant K Chitale

                  >db_unique_name='orcl'

                  The DB_UNIQUE_NAME at the Standby must be different from the DB_NAME.  The DB_NAME is the same at both Primary and Standby.

                   

                   

                  Hemant K Chitale


                  • 6. Re: Problem While Creating Physical Standby Using RMAN
                    817202

                    I done the same that is changing the db_unique_name of both databases. And keeping the DB_NAME same.

                     

                    But still facing the same problem .

                     

                     

                    Can one of you provide me a link that describes the step by step procedure because most of the link does not help at all.

                    • 7. Re: Problem While Creating Physical Standby Using RMAN
                      Shivananda Rao

                      Hello,

                       

                      From the primary and standby, please post:

                       

                      SQL>show parameter db_name

                      SQL>show parameter db_unique_name

                       

                       

                       

                      Regards,
                      Shivananda

                      • 8. Re: Problem While Creating Physical Standby Using RMAN
                        817202

                        ok for pri:

                        db_name=orcl

                        db_unique_name=orcl


                        for standby:

                        db_name=orcl 

                        db_unique_name=sbyorcl ( i change orcldr to sbyorcl later)for new testing



                        but now what i am getting on

                          Verify connectivity

                         

                        On Primary Server:

                         

                        C:\> lsnrctl stop LISTENERI (working fine)

                         

                        C:\> lsnrctl start LISTENER (working fine)

                         

                        C:\> tnsping orcl (working fine)

                         

                        C:\> tnsping sbyorcl (working fine)

                         

                        C:\> sqlplus sys/xxxxx@orcl (working fine)

                         

                        C:\> sqlplus sys/xxxxx@sbyorcl (not working fine)

                         

                         

                        ERROR:

                        ORA-12514: TNS:listener does not currently know of service requested in connect

                        descriptor

                         

                        On Standby Server:

                         

                        C:\>lsnrctl stop LISTENER

                         

                        C:\> lsnrctl start LISTENER

                         

                        C:\> tnsping orcl

                         

                        C:\> tnsping sbyorcl

                         

                        C:\> sqlplus sys/xxxxx@orcl

                         

                        C:\> sqlplus sys/xxxxx@sbyorcl

                         

                         

                        My listner file for pri :-

                        SID_LIST_LISTENER =

                          (SID_LIST =

                            (SID_DESC =

                              (GLOBAL_DBNAME = orcl)

                              (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

                              (SID_NAME = ORCL)

                            )

                          )

                         

                        LISTENER =

                          (DESCRIPTION =

                            (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))

                          )

                         

                        tnsnames.ora file on pri is:

                         

                        sbyorcl =

                          (DESCRIPTION =

                            (ADDRESS_LIST =

                              (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))

                            )

                            (CONNECT_DATA =

                              (SERVICE_NAME = sbyorcl)

                            )

                          )

                         

                        ORCL =

                          (DESCRIPTION =

                            (ADDRESS_LIST =

                              (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))

                            )

                            (CONNECT_DATA =

                              (SERVICE_NAME = orcl)

                            )

                          )

                         

                        and listener file on standby :

                        SID_LIST_LISTENER =

                          (SID_LIST =

                            (SID_DESC =

                              (SID_NAME = PLSExtProc)

                              (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

                              (PROGRAM = extproc)

                            )

                            (SID_DESC =

                              (GLOBAL_DBNAME = orcl)

                              (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

                              (SID_NAME = orcl)

                            )

                          )

                         

                        LISTENER =

                          (DESCRIPTION_LIST =

                            (DESCRIPTION =

                              (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))

                            )

                            (DESCRIPTION =

                              (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

                            )

                          )

                         

                        and tnsnames.ora file on standby:

                         

                        ORCL =

                          (DESCRIPTION =

                            (ADDRESS_LIST =

                              (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))

                            )

                            (CONNECT_DATA =

                              (SERVICE_NAME = orcl)

                            )

                          )

                        sbyorcl =

                          (DESCRIPTION =

                            (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))

                            )

                        (CONNECT_DATA =

                               SERVICE_NAME = sbyorcl)

                            )

                          )

                         

                        EXTPROC_CONNECTION_DATA =

                          (DESCRIPTION =

                            (ADDRESS_LIST =

                              (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

                            )

                            (CONNECT_DATA =

                              (SID = PLSExtProc)

                              (PRESENTATION = RO)

                            )

                          )

                         

                         

                        Kinldy guide me where i am mistaking it's urgent

                        • 9. Re: Problem While Creating Physical Standby Using RMAN
                          mseberg

                          Expected result:

                           

                          sqlplus sys/xxxxx@sbyorcl (not working fine)

                           

                          What do you have there that you can connect to? Have you started the new Standby in nomount? 

                           

                          TNSPING has limits.

                           

                          SQL> startup nomount

                           

                          -- on the side you are running the duplicate on.

                           

                          $ORACLE_HOME/bin/rman target=sys/@primary auxiliary=sys/@standby

                           

                          Best Regards

                           

                          mseberg

                          • 10. Re: Problem While Creating Physical Standby Using RMAN
                            817202

                            Thanks for your reply

                            as per your guidance i start the db on standby in nomount mode

                             

                            and do the following from standby

                             

                             

                            C:\oracle\product\10.2.0\db_1\BIN>rman target=sys/tiger@orcl auxiliary=sys/tige

                             

                            Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 24 23:17:16 2013

                             

                            Copyright (c) 1982, 2005, Oracle.  All rights reserved.

                             

                            connected to target database: ORCL (DBID=1354502282)

                            connected to auxiliary database: ORCL (not mounted)

                             

                            But here i am confused my prim db is orcl and standby is sbyorcl so according to that the above results appears as:

                             

                             

                            C:\oracle\product\10.2.0\db_1\BIN>rman target=sys/tiger@orcl auxiliary=sys/tige

                             

                            Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 24 23:17:16 2013

                             

                            Copyright (c) 1982, 2005, Oracle.  All rights reserved.

                             

                            connected to target database: ORCL (DBID=1354502282)

                            connected to auxiliary database: SBYORCL (not mounted)

                             

                            which it seems dosen't appears

                             

                            Also please let me know as well when i am restoring the backup on standby server the backups are placed in the same directory structure as it is backuped in primary server for e.g i take the backup in flash_recovery_area/orcl/backup on primary server. The same structure i need to create on standby server right, but there is i want to restore the database files in oradata/stby folder instead of oradata/orcl as in primary server. Because when i restore the backups i think they by default restore the datafiles on /oradata/orcl folder.

                            can you please clarify this

                            • 11. Re: Problem While Creating Physical Standby Using RMAN
                              Hemant K Chitale

                              To avoid confusion, I would have the Instance Name  (ORACLE_SID)  to be sbyoracle at the standby server.

                               

                              Thus :

                              Primary

                              SID = orcl

                              DB_NAME=orcl

                              DB_UNIQUE_NAME=orcl

                              tnsnames=orcl

                               

                              Standby

                              SID=sbyorcl

                              DB_NAME=orcl

                              DB_UNIQUE_NAME=sbyorcl

                              tnsnames=sbyorcl

                               

                              You seem to have configure SID=orcl at the standby.

                               

                              Hemant K Chitale

                              • 12. Re: Problem While Creating Physical Standby Using RMAN
                                817202

                                Hi Hemant,

                                Thanks for your reply. But on the standby i set ORACLE_SID=sbyorcl. after that i connect with the db and started it in nomount . But when i try to connect the auxiliary database from primary database using

                                 

                                C:\> rman target sys\tiger@orcl auxiliary sys/tiger@sbyorcl

                                 

                                it shows me that

                                 

                                connected to ORCL( DBID XXXXXX)

                                connected to ORCL ( not mounted)

                                • 13. Re: Problem While Creating Physical Standby Using RMAN
                                  Hemant K Chitale

                                  Your standby server listener.ora has this entry :

                                  (SID_NAME = orcl)

                                   

                                  But you say you have set the SID to sbyoracle.  So the listener, too, should have SID_NAME = sbyoracle.

                                   

                                  Hemant K Chitale

                                  • 14. Re: Problem While Creating Physical Standby Using RMAN
                                    817202

                                    Sorry that is posted by mistake .

                                     

                                    ok i tried to sort out this problem. Now i am able to connect to auxiliary database from primary.

                                     

                                    But what happened now when i run the command to duplicate the database for standby dorecover nofilenamecheck.

                                     

                                    everything is working fine as i already placed the primary db backup on standby site with the same directory structure say orcl folder

                                     

                                    but at the end the error coming in front of meis

                                     

                                    ORA-01152 : File 1

                                    ORA-01110

                                    FMAN-0025: no backup of log thread sequence 15 lowscn 642210 found to restore

                                     

                                     

                                    is this because i didn't do current log switch on primary site and move all archive log to standby site

                                     

                                     

                                    Please provide your valuable advice over the same

                                    1 2 Previous Next