12 Replies Latest reply on Sep 7, 2018 3:38 PM by Mark D Powell

    Need to Move Database from One Server to Another Server

    GTS (DBA)

      Database Name: orcl  on cdc1 server

      Clone Database Name: Clone1 on  cdc3 server

      DB version is : 11201 on LINUX

       

      >> I have rman full db backup  on cdc3 server

       

      $ pwd

      /u02/rman_bkp

       

      [oracle@cdc3 rman_bkp]$ ls -l

      total 1205712

      -rw-r----- 1 oracle oinstall  109322752 Sep  5 16:40 o1_mf_annnn_CLONE_fryyfn5l_.bkp

      -rw-r----- 1 oracle oinstall      15872 Sep  5 16:40 o1_mf_annnn_CLONE_fryyhxm2_.bkp

      -rw-r----- 1 oracle oinstall 1124089856 Sep  5 16:41 o1_mf_nnndf_TAG20180905T163747_fryyfwj9_.bkp

       

      On auxiliary server

       

      $ rlrman auxiliary sys/orcl@CLOEDB target sys/orcl@ORCLDB

       

      Recovery Manager: Release 11.2.0.1.0 - Production on Wed Sep 5 17:54:32 2018

       

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

       

      connected to target database: ORCL (DBID=1492020190)

      connected to auxiliary database: CLONE1 (not mounted)

       

      RMAN> restore controlfile from '/uo2/rman_bkp/';

       

      Starting restore at 05-SEP-18

      using target database control file instead of recovery catalog

      allocated channel: ORA_DISK_1

      channel ORA_DISK_1: SID=39 device type=DISK

       

      RMAN-00571: ===========================================================

      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

      RMAN-00571: ===========================================================

      RMAN-03002: failure of restore command at 09/05/2018 18:01:32

      RMAN-06496: must use the TO clause when the database is mounted or open

       

      1) Why above command is getting failed ?

        • 1. Re: Need to Move Database from One Server to Another Server
          Kamran Agayev A.

          You have to specifi TO clause

           

          RMAN> Restore controlfile to '/tmp/control01.ctl' from '###";

           

          BR,

          Kamran Aghayev A.

          1 person found this helpful
          • 2. Re: Need to Move Database from One Server to Another Server
            GTS (DBA)

            ---- On Source

             

            [oracle@cdc1 ~]$ rlrman target /

             

            Recovery Manager: Release 11.2.0.1.0 - Production on Wed Sep 5 18:15:38 2018

             

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

             

            connected to target database: ORCL (DBID=1492020190)

             

            RMAN> SHOW CONTROLFILE AUTOBACKUP;

             

            using target database control file instead of recovery catalog

            RMAN configuration parameters for database with db_unique_name ORCL are:

            CONFIGURE CONTROLFILE AUTOBACKUP ON;

             

             

            >>  I have full rman backup on cdc3 

             

            [oracle@cdc3 rman_bkp]$ pwd

            /u02/rman_bkp

            [oracle@cdc3 rman_bkp]$ ls -l

            total 1205712

            -rw-r----- 1 oracle oinstall  109322752 Sep  5 16:40 o1_mf_annnn_CLONE_fryyfn5l_.bkp

            -rw-r----- 1 oracle oinstall      15872 Sep  5 16:40 o1_mf_annnn_CLONE_fryyhxm2_.bkp

            -rw-r----- 1 oracle oinstall 1124089856 Sep  5 16:41 o1_mf_nnndf_TAG20180905T163747_fryyfwj9_.bkp

             

             

            RMAN> restore controlfile to '/u01/app/oracle/oradata/clone1/control01.ctl' from '/u02/rman_bkp/o1_mf_annnn_CLONE_fryyfn5l_.bkp';

             

            Starting restore at 05-SEP-18

            using channel ORA_DISK_1

             

            channel ORA_DISK_1: no AUTOBACKUP in 7 days found

            RMAN-00571: ===========================================================

            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

            RMAN-00571: ===========================================================

            RMAN-03002: failure of restore command at 09/05/2018 18:16:43

            RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

             

             

            RMAN> restore controlfile to '/u01/app/oracle/oradata/clone1/control01.ctl' from '/u02/rman_bkp/o1_mf_annnn_CLONE_fryyhxm2_.bkp';

             

            Starting restore at 05-SEP-18

            using channel ORA_DISK_1

             

            channel ORA_DISK_1: no AUTOBACKUP in 7 days found

            RMAN-00571: ===========================================================

            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

            RMAN-00571: ===========================================================

            RMAN-03002: failure of restore command at 09/05/2018 18:17:17

            RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

             

            RMAN> restore controlfile to '/u01/app/oracle/oradata/clone1/control01.ctl' from '/u02/rman_bkp/o1_mf_nnndf_TAG20180905T163747_fryyfwj9_.bkp';

             

            Starting restore at 05-SEP-18

            using channel ORA_DISK_1

             

            channel ORA_DISK_1: no AUTOBACKUP in 7 days found

            RMAN-00571: ===========================================================

            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

            RMAN-00571: ===========================================================

            RMAN-03002: failure of restore command at 09/05/2018 18:17:47

            RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

             

            --> Why above command is not working ?

            • 3. Re: Need to Move Database from One Server to Another Server
              Kamran Agayev A.

              Are you sure the following backup piece is controlfile autobackup?

               

               

              /u02/rman_bkp/o1_mf_nnndf_TAG20180905T163747_fryyfwj9_.bkp

              • 4. Re: Need to Move Database from One Server to Another Server
                GTS (DBA)

                Kamran Agayev A. wrote:

                 

                Are you sure the following backup piece is controlfile autobackup?

                 

                 

                /u02/rman_bkp/o1_mf_nnndf_TAG20180905T163747_fryyfwj9_.bkp

                 

                Once i enabled control file auto back up on source DB , i took rman full backup.

                • 5. Re: Need to Move Database from One Server to Another Server
                  Kamran Agayev A.

                  And you have to provide autobackup file to restore the controlfile

                  Do you have output of RMAN backup? If yes, check the autobackup file name and restore the controlfile from the autobackup file

                   

                  BR,

                  Kamran

                  • 6. Re: Need to Move Database from One Server to Another Server
                    Dude!

                    Why do you have an auxiliary instance? What exactly are you trying to accomplish?

                     

                    There are several ways to restore the spfile and database control file. You can use controlfile autobackup if available, or specify the exact rman backupset that contains the data. The .bkp file you have mentioned is not autobackup, which uses a different file name format.

                     

                    I suggest you review an example:

                     

                    Oracle Database 11g: Disaster Recovery Example

                    1 person found this helpful
                    • 8. Re: Need to Move Database from One Server to Another Server
                      GTS (DBA)

                      Hi,

                       

                      I suggest you review an example:

                       

                      Oracle Database 11g: Disaster Recovery Example

                      Yes, i checked it.

                      The way of your explanation was good !

                       

                      But my approach was bit different.

                      I copied rman backup pieces to  cdc3 server from cdc1 server

                       

                      on cdc3 server, i restored the database.

                       

                      If i do not want to use  following script ..

                       

                      run {

                      set newname for datafile 1 to '/u02/app/oracle/oradata/orcl/system01.dbf';

                      set newname for datafile 2 to '/u02/app/oracle/oradata/orcl/sysaux01.dbf';

                      set newname for datafile 3 to '/u02/app/oracle/oradata/orcl/undotbs01.dbf';

                      set newname for datafile 4 to '/u02/app/oracle/oradata/orcl/users01.dbf';

                      }

                       

                      instead of above script , can i use below parameters in pfile ?

                      Will it workable ?

                      log_file_name_convert

                      db_name_file_convert

                       

                      Thanks

                      • 9. Re: Need to Move Database from One Server to Another Server
                        Mark D Powell

                        GTS, the error message is pretty clear.  Either start the database in nomount mode or include the TO clause in your command as per the error message

                        - -

                        $ oerr rman 06496

                        6496, 1, "must use the TO clause when the database is mounted or open"

                        // *Cause: A control file restore was attempted when the database

                        //         is mounted or open and no alternate destination was specified.

                        // *Action: Specify an alternate destination with the TO clause or dismount

                        //          the database.

                        - -

                        See the following

                        https://community.oracle.com/thread/2431919

                        - -

                        Here is how to get the control file

                        Doc ID 403883.1 How To Restore Controlfile From A Backupset Without A Catalog Or Autobackup

                        - -

                        And here is help with rman duplciate

                        Doc ID 228257.1 RMAN 'Duplicate Database' Feature in Oracle9i / 10G and 11G

                        - -

                        HTH -- Mark D Powell --

                        1 person found this helpful
                        • 10. Re: Need to Move Database from One Server to Another Server
                          Dude!

                          DB_FILE_NAME_CONVERT is useful for creating a duplicate database.

                           

                          You use RMAN duplicate if you want to duplicate database "orcl" to "orcl2".

                           

                          It seems however you want to restore or move "orcl" on server 1 to server 2? In such case, you can restore the database on the new server and use the same directory structure, which is a standard restore and recovery, or change the database file names during the restore. In case of the later, the task is more complex, for example:

                           

                          Restore Database And Rename Database Files Example

                          1 person found this helpful
                          • 11. Re: Need to Move Database from One Server to Another Server
                            GTS (DBA)

                            Hi,

                             

                            Do you have any pages how to restore database from 'TAPE DRIVE' ?

                            Suppose i have a complete rman backup in TAPE DRIVE , now developers are asking me to restore the backup  (which is already taken in TAPE DRIVE) in new server ?

                             

                            How do i restore the database in new server from TAPE DRIVE ?

                            • 12. Re: Need to Move Database from One Server to Another Server
                              Mark D Powell

                              GTS, What difference does it make that the backup is on tape?  Assuming the rman backup was written directly to tape you just change the allocation unit to tape and follow the directions for restoring to a new host.

                              https://docs.oracle.com/database/121/BRADV/rcmadvre.htm#BRADV908

                              - -

                              Check the manual for your version of Oracle for the same instructions.

                              - -

                              If the backup was to disk then the back up was copied to tape you would use your tape management software to copy the backup set to the new server and then restore.

                              - -

                              HTH -- Mark D Powell -

                              1 person found this helpful