1 2 Previous Next 17 Replies Latest reply on Apr 5, 2013 2:29 AM by SHANOJ

    RMAN Backup Doubt

    Data Boy
      I Have taken a full backup of our TEST Database using below command in different path due to disk space issues.

      Backup database plus archivelog format '/u01/ora_rman_bkups/%d_%u_%s';

      When i go to RMAN and LIST BACKUP i dont see the above backup set. When i go to OS i see the two files created in that directory

      [oracle@enash ora_rman_bkups]$ ls -l
      total 1428312
      -rw-r----- 1 oracle oinstall 1460956160 Apr 2 13:36 AMAZTST_0oo62q17_24 *(I Think this is database backup) This is a different backup piece correct ?*
      -rw-r----- 1 oracle oinstall 189952 Apr 2 13:37 AMAZTST_0ro62qlf_27 *(I Think these are archive logs) -- This is different backup piece correct ?*


      I Want to Clone my AMAZPRD with above AMAZTST backup ...

      please suggest me if i can use the above backup pieces for duplicating database.

      Thank you for looking into my post ..
        • 1. Re: RMAN Backup Doubt
          Veeresh.S
          do you use rman catalog ?

          try below command and see if below files are listed.

          RMAN>catalog start with '/u01/ora_rman_bkups/';
          • 2. Re: RMAN Backup Doubt
            SHANOJ
            Yes you can...

            1. Produce a pfile for the new database
            assumes that the source database is using a spfile. If that is not the case, simply make a copy the existing pfile.

            Connect to the source database as sysdba and run the following:

            create pfile='init<new database sid>.ora' from spfile;

            This will create a new pfile in the $ORACLE_HOME/dbs directory.

            The new pfile will need to be edited immediately. If the cloned database is to have a different name to the source, this will need to be changed, as will any paths. Review the contents of the file and make alterations as necessary.

            assume that the cloned database will reside on the same machine as the source, Oracle must be told how convert the filenames during the RMAN duplicate operation. This is achieved by adding the following lines to the newly created pfile:

            db_file_name_convert=(<source_db_path>,<target_db_path>)
            log_file_name_convert=(<source_db_path>,<target_db_path>)



            2. Create bdump, udump & cdump directories
            Create bdump, udump & cdump directories as specified in the pfile from the previous step.

            3. Add a new entry to oratab, and source the environment
            Edit the /etc/oratab (or /opt/oracle/oratab) and add an entry for the new database.

            Source the new environment with '. oraenv' and verify that it has worked by issuing the following command:

            echo $ORACLE_SID

            If this doesn't output the new database sid go back and investigate why not.

            4. Create a password file
            Use the following command to create a password file (add an appropriate password to the end of it):

            orapwd file=${ORACLE_HOME}/dbs/orapw${ORACLE_SID} password=<your password>

            5. Duplicate the database
            From sqlplus, start the instance up in nomount mode:

            startup nomount

            Exit sqlplus, start RMAN and duplicate the database. As in step 1, it is assumed that no recovery catalog is available. If one is available, simply amend the RMAN command to include it.

            rman target sys@<source_database> nocatalog auxiliary /

            duplicate target database to <clone database name>;

            This will restore the database and apply some archive logs. It can appear to hang at the end sometimes. Just give it time - I think it is because RMAN does a 'shutdown normal'.

            If you see the following error, it is probably due to the file_name_convert settings being wrong. Return to step 2 and double check the settings.

            RMAN-05001: auxiliary filename '%s' conflicts with a file used by the target database

            Once the duplicate has finished RMAN will display a message similar to this:

            database opened
            Finished Duplicate Db at 26-FEB-05

            RMAN>

            Exit RMAN.

            6. Create an spfile
            From sqlplus:

            create spfile from pfile;

            shutdown immediate
            startup

            Now that the clone is built, we no longer need the file_name_convert settings:

            alter system reset db_file_name_convert scope=spfile sid='*'
            /

            alter system reset log_file_name_convert scope=spfile sid='*'
            /

            7. Optionally take the clone database out of archive log mode
            RMAN will leave the cloned database in archive log mode. If archive log mode isn't required, run the following commands from sqlplus:

            shutdown immediate
            startup mount
            alter database noarchivelog;
            alter database open;

            8. Configure TNS
            Add entries for new database in the listener.ora and tnsnames.ora as necessary.
            • 3. Re: RMAN Backup Doubt
              Data Boy
              Hi Veeresh,

              Thank you for responding .. I Got the below message

              RMAN> catalog start with '/u01/ora_rman_bkups/';

              searching for all files that match the pattern /u01/ora_rman_bkups/

              List of Files Unknown to the Database
              =====================================
              File Name: /u01/ora_rman_bkups/AMAZTST_0ro62qlf_27
              File Name: /u01/ora_rman_bkups/AMAZTST_0oo62q17_24

              Do you really want to catalog the above files (enter YES or NO)? YES
              cataloging files...
              no files cataloged

              List of Files Which Where Not Cataloged
              =======================================
              File Name: /u01/ora_rman_bkups/AMAZTST_0ro62qlf_27
              RMAN-07518: Reason: Foreign database file DBID: 1050683335 Database Name: AMAZTST
              File Name: /u01/ora_rman_bkups/AMAZTST_0oo62q17_24
              RMAN-07518: Reason: Foreign database file DBID: 1050683335 Database Name: AMAZTST
              • 4. Re: RMAN Backup Doubt
                Data Boy
                hi shanoj thank you i am exactly following same steps

                but at this below steps from your response i got doubt
                duplicate target database to <clone database name>;
                This will restore the database and apply some archive logs. It can appear to hang at the end sometimes. Just give it time - I think it is because RMAN does a 'shutdown normal'.
                This will restore which backup ? if i have multiple backups and i want to restore using a specific backup then how to proceed ?
                • 5. Re: RMAN Backup Doubt
                  Data Boy
                  Can someone please respond ..

                  Will it restore latest backup ? How can i provide the above backupset to RMAN which i want to duplicate to the CLONE Database ?
                  • 6. Re: RMAN Backup Doubt
                    SHANOJ
                    duplicate target database to <clone database name>;

                    for example: duplicate target database to newDataboy;


                    This will restore which backup ? if i have multiple backups and i want to restore using a specific backup then how to proceed ?

                    http://docs.oracle.com/cd/B19306_01/backup.102/b14191/rcmdupdb.htm
                    • 7. Re: RMAN Backup Doubt
                      SHANOJ
                      You can set the path...or you need to set the last sequence no. of the backup piece which you want to be clone using 'the until sequence XXX'
                      • 8. Re: RMAN Backup Doubt
                        JohnWatson
                        Data Boy wrote:
                        I Have taken a full backup of our TEST Database using below command in different path due to disk space issues.

                        Backup database plus archivelog format '/u01/ora_rman_bkups/%d_%u_%s';

                        When i go to RMAN and LIST BACKUP i dont see the above backup set. When i go to OS i see the two files created in that directory

                        [oracle@enash ora_rman_bkups]$ ls -l
                        total 1428312
                        -rw-r----- 1 oracle oinstall 1460956160 Apr 2 13:36 AMAZTST_0oo62q17_24 *(I Think this is database backup) This is a different backup piece correct ?*
                        -rw-r----- 1 oracle oinstall 189952 Apr 2 13:37 AMAZTST_0ro62qlf_27 *(I Think these are archive logs) -- This is different backup piece correct ?*
                        So you have backup up your AMAZTST database. OK.
                        >
                        >
                        I Want to Clone my AMAZPRD with above AMAZTST backup ...
                        This is impossible: it is the wrong database. That is also why your use of CATALOG fails.
                        >
                        please suggest me if i can use the above backup pieces for duplicating database.
                        You can use them to clone your AMAZTST database, not your AMAZPRD database.
                        >
                        Thank you for looking into my post ..
                        • 9. Re: RMAN Backup Doubt
                          Data Boy
                          Hi John watson

                          Thank you for your response .

                          So you mean to say we cannot clone a PRODUCTION Instance with the help of backup of TEST INSTANCE ? Please correct me if i am wrong.
                          • 10. Re: RMAN Backup Doubt
                            Data Boy
                            Now I am getting below error please help .. otherwise i will be fired from amazon please save my job

                            Starting restore at 2013-04-03:05:30:55
                            using channel ORA_AUX_DISK_1

                            channel ORA_AUX_DISK_1: starting datafile backupset restore
                            channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
                            restoring datafile 00001 to /u01/app/oracle/oradata/amaztst/system01.dbf
                            restoring datafile 00002 to /u01/app/oracle/oradata/amaztst/undotbs01.dbf
                            restoring datafile 00003 to /u01/app/oracle/oradata/amaztst/sysaux01.dbf
                            restoring datafile 00004 to /u01/app/oracle/oradata/amaztst/users01.dbf
                            restoring datafile 00005 to /u01/app/oracle/oradata/amaztst/system02.dbf
                            restoring datafile 00006 to /u01/app/oracle/oradata/amaztst/streams01.dbf
                            channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/flash_recovery_area/amaztst/AMAZTST/backupset/2013_04_02/o1_mf_nnndf_TAG20130402T133610_8op5rc17_.bkp
                            ORA-19870: error reading backup piece /home/oracle/flash_recovery_area/amaztst/AMAZTST/backupset/2013_04_02/o1_mf_nnndf_TAG20130402T133610_8op5rc17_.bkp
                            ORA-19504: failed to create file "/u01/app/oracle/oradata/amaztst/users01.dbf"
                            ORA-27086: unable to lock file - already in use
                            Linux Error: 11: Resource temporarily unavailable
                            Additional information: 8
                            Additional information: 8068
                            failover to previous backup

                            RMAN-00571: ===========================================================
                            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                            RMAN-00571: ===========================================================
                            RMAN-03002: failure of Duplicate Db command at 04/03/2013 05:30:59
                            RMAN-03015: error occurred in stored script Memory Script
                            RMAN-06026: some targets not found - aborting restore
                            RMAN-06023: no backup or copy of datafile 6 found to restore
                            RMAN-06023: no backup or copy of datafile 5 found to restore
                            RMAN-06023: no backup or copy of datafile 4 found to restore
                            RMAN-06023: no backup or copy of datafile 3 found to restore
                            RMAN-06023: no backup or copy of datafile 2 found to restore
                            RMAN-06023: no backup or copy of datafile 1 found to restore

                            I Did not taken the backup to default flash recovery area ..i have to taken other location as mentioned above due to disk space issue.
                            • 11. Re: RMAN Backup Doubt
                              Fran
                              post your rman script.

                              probably you don't catalog the backup or you aren't using "allocate channel"
                              • 12. Re: RMAN Backup Doubt
                                SHANOJ
                                To perform AMAZTST duplicate to AMAZPRD :- (connect as oraAMAZPRD user and then run this below script)

                                =======================================

                                run {

                                allocate auxiliary channel t1 type disk format '/u01/ora_rman_bkups/%d_%u_%s';

                                allocate auxiliary channel t2 type disk format '/u01/ora_rman_bkups/%d_%u_%s';

                                allocate auxiliary channel t3 type disk format '/u01/ora_rman_bkups/%d_%u_%s';

                                duplicate target database to AMAZPRD;

                                }


                                Note: please configure TNS for both the DB to connect each other.
                                1 person found this helpful
                                • 13. Re: RMAN Backup Doubt
                                  Fran
                                  an appoinment of SHANOJ's post:

                                  you must connect into AMAZTST server, set backups in same directory/path in both servers, and connect rman like:

                                  *AMAZPRD must be in nomount state
                                  **backup must have current controlfile and archivelogs.

                                  $ rman
                                  rman> connect auxiliary sys/password@AMAZPRD
                                  rman> connect target /

                                  later follow shanoj's post:

                                  rman> run {
                                  allocate auxiliary channel t1 type disk format '/u01/ora_rman_bkups/%d_%u_%s';
                                  allocate auxiliary channel t2 type disk format '/u01/ora_rman_bkups/%d_%u_%s';
                                  allocate auxiliary channel t3 type disk format '/u01/ora_rman_bkups/%d_%u_%s';
                                  duplicate target database to AMAZPRD;
                                  }
                                  1 person found this helpful
                                  • 14. Re: RMAN Backup Doubt
                                    Data Boy
                                    Thank you everyone for helping me so much ..

                                    I finall Resolved the issue by modifying the parameter value on both the source and destination instances.



                                    *.db_recovery_file_dest='/u01/ora_rman_bkups'
                                    1 2 Previous Next