Restore RMAN Incremental Backup to New DR Server

download Restore RMAN Incremental Backup to New DR Server

of 3

Transcript of Restore RMAN Incremental Backup to New DR Server

  • 8/12/2019 Restore RMAN Incremental Backup to New DR Server

    1/3

    Restore RMAN Incremental backup to new serverI will present in this blog how to restore 10gR2 Database incremental backup to a new server

    using RMAN. The method I used here will not use RMAN catalog database assuming that you

    have only database backup.

    RMAN Backup Configuration

    Daily : Incremental Level 1 cumulative

    Weekly: Incremental Level 0

    Retention Policy: RECOVERY WINDOW OF 7 DAYS

    Device: Disk

    Control File Autobackup: on

    In this, assume that following directories are used to restoring DBDB Name ORCL1u04/ORCL1/flash_recovery_area Flash Recovery Area/u01/ ORCL1/oracle/admin ORACLE_BASE/u04/ ORCL1/oradata To store datafile

    Pre-requisite for restore

    1. You must know DBID of the database to be restored.

    2. A valid backup is required.

    3. Sufficient Disk Space on the server to restore the backup.

    4. If restoring from tape, Tape Library must be configured to the server for restoring.

    5. Server OS/Architecture must be same as the backed up database server. 6. All recommended patches and tuning must be done on the server as per Oracle documentation.

    7. Oracle Software of same version of backed up database must be installed.

    8. Oracle Software must be patched similar to backed up database.

    Performing Complete Recovery

    1. Restore the backup: Once the server is ready with all pre-requisites, restore the backup to the

    specific directory/directories. Here it will be to the flash recovery area

    2. Verify the directory and file permissions:Oracle user and dba group must have full permission

    on the restored directory and files. Owner of the files must be oracle user.

    3. Parameter file: Identify the backup piece from the Latest CONTROLFILE and SPFILE backupslocated in restored $Flash_Recovery_Area/autobackup/

    4. Parameter file: Identify the backup piece from the Latest CONTROLFILE and SPFILE backups

    located in restored $Flash_Recovery_Area/autobackup/. Filename usually starts with

    o1_mf_s_ if you are backing up spfile with controlfile autobackup, otherwise Filename look like

    o1_mf_n_

    If the parameter file is not backed up as part of your backup strategy, you must create it manually.

  • 8/12/2019 Restore RMAN Incremental Backup to New DR Server

    2/3

    5. Add entry for LISTENER_ORCL1 in $ORACLE_HOME/network/admin/tnsnames.ora

    6. Restore SPFILE as follows. SPIFLE will be restored in $ORACLE_HOME/dbs (If you dont have

    spfile in autobackup you will have to create it manually)

    $ export ORACLE_SID=ORCL1

    $ rman target /

    RMAN> startup nomount

    RMAN> set DBID=

    RMAN> restore spfile from "/autobackup//o1_mf_s_751194987_6wyrfc7d_.bkp ";

    7. Create PFILE (initORCL1.ora) from SPFILE;

    RMAN> sql 'create pfile from spfile';

    8. Modify the PFILE(initORCL1.ora) and make the required changes.

    9. Correct the following parameters as per new environment.

    Control File = /new/path/controln1.dbf,/new/path/controln1.dbf

    user_dump_dest = /admin//udump

    background_dump_dest = /admin//bdump

    core_dump_dest = /admin//bdump

    log_archive_dest_1 = 'location=/new/path'

    10.Restore control file as follows

    restore controlfile to '' from "";

    11. Force Mount the Instance as follows:

    RMAN> startup force mount pfile=$ORACLE_HOME/dbs/initORCL1.ora

    12. Create SPFILE from PFILE.

    RMAN> sql 'create spfile from pfile'

    13. Shutdown the Database and Mount the database:

    RMAN> shutdown

    RMAN> startup mount;14. Disable Flashback Database as follows:

    SQ> alter database flashback off;

    15. Disable Block Change Tracking as follows:

    SQ> alter database disable block change tracking;

  • 8/12/2019 Restore RMAN Incremental Backup to New DR Server

    3/3

    16. Restore the Database as follows. Tail the alert log file and make sure database files are getting

    restored. Since we are restoring datafiles to new location, files to be renamed(Yu can generate a

    script to do this). This needs to be executed as one command in run

    $ export ORACLE_SID= ORCL1

    $ rman target /

    RMAN>

    run{

    set newname for datafile 'orcl1_system01.dbf' to

    '/u04/ORCL1/oradata/orcl1_system01.dbf';

    .

    .

    .

    .

    .

    restore database;switch datafile all;

    recover database;

    }

    17. Rename Log File:If the restored log file path is different, then rename the restored log files in the control fileUse the

    below SQL to generate script to rename all data files and execute the generated script.

    select 'alter database rename file '''|| member ||''' to '''||replace(member,'','')||''';' from v$logfile

    18. Open Database:Open the Database by executing following commandSQL> Alter database open resetlogs;

    19. Create Temp Tablespace

    SQL> CREATE TEMPORARY TABLESPACE temp2 TEMPFILE '/new/path/_temp02.dbf' size

    500m autoextend off ;

    SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

    SQL> DROP TABLESPACE temp;

    20. Configure & change Flash Recovery Area:

    SQL> alter system set db_recovery_file_dest='/flash_recovery_area' scope=both;

    Posted bybirdman at1:49 PMLabels:incremental backup,new server,oracle dba blog,oracle rman,recoverdatabase,restore,rman

    http://www.blogger.com/profile/07807149442096903534http://www.blogger.com/profile/07807149442096903534http://24x7dba.blogspot.com/2011/07/restore-rman-incremental-backup-to-new.htmlhttp://24x7dba.blogspot.com/2011/07/restore-rman-incremental-backup-to-new.htmlhttp://24x7dba.blogspot.com/2011/07/restore-rman-incremental-backup-to-new.htmlhttp://24x7dba.blogspot.com/search/label/incremental%20backuphttp://24x7dba.blogspot.com/search/label/incremental%20backuphttp://24x7dba.blogspot.com/search/label/incremental%20backuphttp://24x7dba.blogspot.com/search/label/new%20serverhttp://24x7dba.blogspot.com/search/label/new%20serverhttp://24x7dba.blogspot.com/search/label/new%20serverhttp://24x7dba.blogspot.com/search/label/oracle%20dba%20bloghttp://24x7dba.blogspot.com/search/label/oracle%20dba%20bloghttp://24x7dba.blogspot.com/search/label/oracle%20dba%20bloghttp://24x7dba.blogspot.com/search/label/oracle%20rmanhttp://24x7dba.blogspot.com/search/label/oracle%20rmanhttp://24x7dba.blogspot.com/search/label/oracle%20rmanhttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/restorehttp://24x7dba.blogspot.com/search/label/restorehttp://24x7dba.blogspot.com/search/label/rmanhttp://24x7dba.blogspot.com/search/label/rmanhttp://24x7dba.blogspot.com/search/label/rmanhttp://www.blogger.com/email-post.g?blogID=1146857283314945782&postID=7992471584860668786http://24x7dba.blogspot.com/search/label/rmanhttp://24x7dba.blogspot.com/search/label/restorehttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/recover%20databasehttp://24x7dba.blogspot.com/search/label/oracle%20rmanhttp://24x7dba.blogspot.com/search/label/oracle%20dba%20bloghttp://24x7dba.blogspot.com/search/label/new%20serverhttp://24x7dba.blogspot.com/search/label/incremental%20backuphttp://24x7dba.blogspot.com/2011/07/restore-rman-incremental-backup-to-new.htmlhttp://www.blogger.com/profile/07807149442096903534