Rman Withou Catalog

10
Home About Contact Us Terms of Use Search Categories Oracle Database (76) Backup and Recovery (20) Troubleshooting (21) Errors (11) Administration (14) Database Control (3) Network (6) High Availability (13) Data Guard (13) Performance (2) SecureFiles and Large Objects (1) Security (1) Utilities (1) OCI/OCCI (1) Internals (1) Grid Control (19) TimesTen (14) Linux (9) Java (13) JDBC (8) JavaFX (4) Windows (5) VirtualBox (4) Grid Infrastructure (4) NetBeans (2) Berkeley DB (2) JDeveloper (2) Golden Gate (2) Oracle Fusion Middleware (1) Weblogic (1) Video (1) MySQL (1) Cloud Control (1) announcements (1) Restore database to another host using RMAN by Eric Jenkinson on April 28, 2010 Categories: Backup and Recovery ,Oracle Database Tagged: host , recover , restore , rman This document will detail the steps to restore a database on a new host using RMAN. For this demonstration we will be using Oracle Database 11gR2 on Linux and disk based backup. One of the first things we want to do is get the Database ID (DBID) from the database in which we will be restoring its backup. You can find the DBID by connecting to the database with RMAN as shown below. If you are unable to connect to the database you can also find the DBID by inspecting the file name of the control file autobackup. For example, c-1239150297-20100427-00, is a control file autobackup. The first group of numbers appearing after the c-, 123915029, is the DBID. When we restore the database we are not going to have the active redo logs from the original database so we want to stop the recovery at the last SCN in the archive logs. We can find the last SCN by querying V$ARCHIVED_LOG. Here we see that the archive logs contain log information up to SCN 1375117. That is our stopping SCN. We can also find the last SCN in our archive logs through RMAN using LIST BACKUP OF ARCHIVELOG ALL. 1 2 3 4 5 6 7 8 9 1 0 1 1 [ o r a c l e @ o r a 1 ~ ] $ r m a n R e c o v e r y M a n a g e r : R e l e a s e 1 1 . 2 . 0 . 1 . 0 - P r o d u c t i o n o n T u e A p r 2 7 0 9 : 4 0 : 3 4 2 0 1 0 C o p y r i g h t ( c ) 1 9 8 2 , 2 0 0 9 , O r a c l e a n d / o r i t s a f f i l i a t e s . A l l r i g h t s r e s e r v e d . R M A N > c o n n e c t t a r g e t / c o n n e c t e d t o t a r g e t d a t a b a s e : O R C L ( D B I D = 1 2 3 9 1 5 0 2 9 7 ) R M A N > 1 2 3 4 5 6 7 8 9 1 0 S Q L > s e l e c t m a x ( n e x t _ c h a n g e # ) 2 f r o m v $ a r c h i v e d _ l o g 3 w h e r e a r c h i v e d = ' Y E S ' 4 g r o u p b y t h r e a d # ; M A X ( N E X T _ C H A N G E # ) - - - - - - - - - - - - - - - - - 1 3 7 5 1 1 7 S Q L > 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 R M A N > l i s t b a c k u p o f a r c h i v e l o g a l l ; L i s t o f B a c k u p S e t s = = = = = = = = = = = = = = = = = = = B S K e y S i z e D e v i c e T y p e E l a p s e d T i m e C o m p l e t i o n T i m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 4 2 . 0 9 M D I S K 0 0 : 0 0 : 0 1 2 7 - A P R - 1 0 B P K e y : 5 4 S t a t u s : A V A I L A B L E C o m p r e s s e d : N O T a g : T A G 2 0 1 0 0 4 2 7 T 0 9 4 3 5 0 P i e c e N a m e : / u 0 3 / a p p / o r a c l e / o r a d a t a / o r c l / b a c k u p / 1 v l c 5 n q n _ 1 _ 1 L i s t o f A r c h i v e d L o g s i n b a c k u p s e t 5 4 T h r d S e q L o w S C N L o w T i m e N e x t S C N N e x t T i m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 1 2 1 3 5 9 0 0 5 2 6 - A P R - 1 0 1 3 5 9 5 2 8 2 6 - A P R - 1 0 1 1 3 1 3 5 9 5 2 8 2 6 - A P R - 1 0 1 3 5 9 6 0 9 2 6 - A P R - 1 0 1 1 4 1 3 5 9 6 0 9 2 6 - A P R - 1 0 1 3 6 2 0 1 8 2 6 - A P R - 1 0 B S K e y S i z e D e v i c e T y p e E l a p s e d T i m e C o m p l e t i o n T i m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 5 1 3 . 8 2 M D I S K 0 0 : 0 0 : 0 2 2 7 - A P R - 1 0 B P K e y : 5 5 S t a t u s : A V A I L A B L E C o m p r e s s e d : N O T a g : T A G 2 0 1 0 0 4 2 7 T 0 9 4 3 5 0 P i e c e N a m e : / u 0 3 / a p p / o r a c l e / o r a d a t a / o r c l / b a c k u p / 2 0 l c 5 n q r _ 1 _ 1 L i s t o f A r c h i v e d L o g s i n b a c k u p s e t 5 5 T h r d S e q L o w S C N L o w T i m e N e x t S C N N e x t T i m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 1 1 3 6 2 0 1 9 2 6 - A P R - 1 0 1 3 7 4 9 9 1 2 7 - A P R - 1 0 B S K e y S i z e D e v i c e T y p e E l a p s e d T i m e C o m p l e t i o n T i m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 0 1 3 6 . 0 0 K D I S K 0 0 : 0 0 : 0 0 2 7 - A P R - 1 0 B P K e y : 6 0 S t a t u s : A V A I L A B L E C o m p r e s s e d : N O T a g : T A G 2 0 1 0 0 4 2 7 T 0 9 4 6 5 2 P i e c e N a m e : / u 0 3 / a p p / o r a c l e / o r a d a t a / o r c l / b a c k u p / 2 4 l c 5 o 0 c _ 1 _ 1 L i s t o f A r c h i v e d L o g s i n b a c k u p s e t 6 0 T h r d S e q L o w S C N L o w T i m e N e x t S C N N e x t T i m e Generated with www.html-to-pdf.net Page 1 / 10

Transcript of Rman Withou Catalog

  • Home About Contact Us Terms of Use Search

    CategoriesOracle Database (76)

    Backup and Recovery (20)

    Troubleshooting (21)

    Errors (11)

    Administration (14)

    Database Control (3)

    Network (6)

    High Availability (13)

    Data Guard (13)

    Performance (2)

    SecureFiles and Large Objects

    (1)

    Security (1)

    Utilities (1)

    OCI/OCCI (1)

    Internals (1)

    Grid Control (19)

    TimesTen (14)

    Linux (9)

    Java (13)

    JDBC (8)

    JavaFX (4)

    Windows (5)

    VirtualBox (4)

    Grid Infrastructure (4)

    NetBeans (2)

    Berkeley DB (2)

    JDeveloper (2)

    Golden Gate (2)

    Oracle Fusion Middleware (1)

    Weblogic (1)

    Video (1)

    MySQL (1)

    Cloud Control (1)

    announcements (1)

    Restore database to another host using RMANby Eric Jenkinson on April 28, 2010

    Categories: Backup and Recovery,Oracle Database

    Tagged: host, recover, restore, rman

    This document will detail the steps to restore a database on a new host using RMAN. For this demonstration we will be

    using Oracle Database 11gR2 on Linux and disk based backup.

    One of the first things we want to do is get the Database ID (DBID) from the database in which we will be restoring its

    backup. You can find the DBID by connecting to the database with RMAN as shown below.

    If you are unable to connect to the database you can also find the DBID by inspecting the file name of the control file

    autobackup. For example, c-1239150297-20100427-00, is a control file autobackup. The first group of numbers

    appearing after the c-, 123915029, is the DBID.

    When we restore the database we are not going to have the active redo logs from the original database so we want to stop

    the recovery at the last SCN in the archive logs. We can find the last SCN by querying V$ARCHIVED_LOG.

    Here we see that the archive logs contain log information up to SCN 1375117. That is our stopping SCN. We can also find

    the last SCN in our archive logs through RMAN using LIST BACKUP OF ARCHIVELOG ALL.

    Looking through the output above we see that highest Next SCN is 1375117 which is part of backup set 60.

    Next we need to make the backup available to the new host. If the backups reside on a shared file system that the new host

    has access to then there is nothing more to do. If the backups are on local storage we will need to transfer the backups to

    the new host.

    All of the rest of the steps will take place on the new host.

    Set the ORACLE_SID to the SID of the database that made the backup and start up RMAN and connect to the target.

    We now need to set the DBID and bring the database in mount mode. When we bring the database up in mount mode we

    will receive errors because the parameter file is not found. This is to be expected as we are restoring to a new host. Oracle

    willuseadummyparameterfileforthetimebeing.

    Now with the database in mount mode we need to restore the SPFILE. We are going to need to make some changes to the

    SPFILE so we will restore SPFILE to a PFILE. The SPFILE is stored in the control file autobackup. All of the RMAN

    configuration parameters values are at their defaults so we will need to set the location for the control file autobackup.

    Below we will set the location for the control file autobackup and restore the SPFILE to a PFILE and then we shutdown the

    database.

    Now that we have the SPFILE weneedtoeditthesomeoftheparametertoreflectthenewhostsfilesystemwereappropriate. Below is a list of the some of the parameter you might need to change in your environment. These directories

    must exist on the new host.

    Note: If you are using 11g you to ensure your kernel parameters are set appropriately to avoid a possible ORA-00845.

    After making the necessary changes to the PFILE we now will bring the database back up in NOMOUNT mode so we can

    restore the control files. When bringing the database up in NOMOUNT mode we will use the PFILE we edited earlier.

    Just like the SPFILE we will use the autobackup to restore the control file after setting the control file autobackup format.

    After restoring the control files we mount the database.

    Now that the control files have been restored and mounted, all of the RMAN configuration parameters have been set. You

    should verify the paths to make sure they are appropriate for this host.

    Given the current settings RMAN is going to look in /u03/app/oracle/oradata/orcl/backup for both the control file

    autobackups and database/archive log backups. The backup we copied over is located in

    /u01/app/oracle/oradata/orcl/backup. There are two ways to resolve this issue. Either move the backup to the

    location were RMAN is configured or change the configuration. It may be that moving the backups may not be an option so

    we document what needs to be done next.

    RMAN has record of a backup in /u03/app/oracle/oradata/orcl/backup but has no record of the backup we have in

    /u01/app/oracle/oradata/orcl/backup/. We need remove the record of the old location and the backup of the new

    location.

    In order to let RMAN know about the backup in /u01/app/oracle/oradata/orcl/backup we use the CATALOG

    command.

    As a result of the CATALOG command RMAN performed a CROSSCHECK. The backup registered at

    /u03/app/oracle/oradata/orcl/backup/ was marked expired as a result of the CROSSCHECK because they were not

    present.

    We are almost ready to restore the database the last thing to be done is to build the restore script. During the restore we

    can change the location of the data files by using SET NEWNAME FOR DATAFILE. The data files in the backup are on

    various locations but we would like to restore them to only one.

    Also we would like to change the location of the redo logs as well. In order to change the redo log locations the ALTER

    DATABASE RENAME FILE command has to be issued. Below are examples of both.

    If you remember we stated that we wanted the restore to stop at SCN 1375117 because that was the latest SCN in which

    we have archive logs. In order to stop at a specific SCN we will use the SET UNTIL SCN 1375117.

    After all of that we just need to restore the database, switch the data files so the control files have the new path and recover

    the database. Not much at all.

    Below is the entire script to do just that.

    The script above was saved to the file restore.rman. Below is the output.

    All that is left is to open the database with the RESETLOGS option.

    Share this:

    Facebook Twitter Reddit Tumblr Print Email

    Comments

    eshant (November 25, 2010 11:09 pm)

    * how

    * to

    * restore

    * complete

    * database

    * on

    * another

    * system

    * (in

    * oracle)

    Morad (December 20, 2012 7:35 am)

    Excellentdocumentation

    Many Many Thanks

    sunil (February 4, 2013 5:14 am)

    Can we use multiple channels to do the RESTORE ? We have 4tb db and around 800gb of RMAN backup size. We

    need 5 channels to be configured.

    fazlarabbi (March 12, 2013 8:23 am)

    its a good documents

    but do u have any idea that when i use (/data/app/oracle/rman_backup/ its my BK dirictory

    RMAN>catalogstartwith/data/app/oracle/rman_backup/'

    Starting implicit crosscheck backup at 12-MAR-13

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=63 device type=DISK

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

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

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

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

    RMAN-03002: failure of catalog command at 03/12/2013 19:01:48

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

    ****

    i copy this files from rac database using backup database plus archivelog delete input and then backup backupset

    1,2,3,4format/data/app/oracle/rman_backup/%U'

    and i also try backup as copy command but this message is appear

    MTDBA (July 17, 2013 5:34 pm)

    BestcomprehensivedisasterrecoveryinstructionsIveeverfound.Thanksforsavingmybacon.Systemsadminsthanks you too

    enrique ortiz (January 9, 2014 7:24 am)

    nice post

    i think i sone of the mos comprensive documentation in order to recover a database in another host

    tanks

    Elayaraja (April 1, 2014 3:23 pm)

    Hi,

    please give doc for rman restore script from local server database to production standby database.

    Thanks

    Elayaraja

    Elayaraja (April 1, 2014 3:25 pm)

    Hi,

    please give me doc rman restore script from test to production standby database.

    Thanks

    Elayaraja

    Benny (May 8, 2014 6:59 am)

    good doccumentation

    Rooster (July 4, 2014 1:23 am)

    This is an excellent doc.

    What about when I have to restore/duplicate to a different SID. At what point and how to change the name from PROD

    to DEV2?

    Rooster

    arab (November 17, 2014 3:51 am)

    Thisthegreatestdocumentationiveeverseen.Thank you very much!

    Dale Brooks (January 2, 2015 12:05 pm)

    Superb documentation of a complex matter! Thank you very much!

    Amar (February 4, 2015 4:40 am)

    Nice post!!

    Ganesh@ (February 17, 2015 2:08 am)

    Very Nice Arcticle !!!

    Many Many Thanks

    Mridul Gupta (April 27, 2015 12:23 am)

    Thanks for this wonderful document which is really helpful.

    Post A Comment

    Name (required)

    Email (will not be published) (required)

    Submit Comment

    Notify me of follow-up comments by email.

    Notify me of new posts by email.

    123456789

    1011

    [oracle@ora1 ~]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 09:40:34 2010

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

    RMAN> connect target /

    connected to target database: ORCL (DBID=1239150297)

    RMAN>

    123456789

    10

    SQL> select max(next_change#)2 from v$archived_log3 where archived = 'YES'4 group by thread#;

    MAX(NEXT_CHANGE#)-----------------

    1375117

    SQL>

    123456789

    10111213141516171819202122232425262728293031323334353637383940414243

    RMAN> list backup of archivelog all;

    List of Backup Sets===================

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------54 2.09M DISK 00:00:01 27-APR-10

    BP Key: 54 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1

    List of Archived Logs in backup set 54Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 12 1359005 26-APR-10 1359528 26-APR-101 13 1359528 26-APR-10 1359609 26-APR-101 14 1359609 26-APR-10 1362018 26-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------55 13.82M DISK 00:00:02 27-APR-10

    BP Key: 55 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/20lc5nqr_1_1

    List of Archived Logs in backup set 55Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 1 1362019 26-APR-10 1374991 27-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------60 136.00K DISK 00:00:00 27-APR-10

    BP Key: 60 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094652Piece Name: /u03/app/oracle/oradata/orcl/backup/24lc5o0c_1_1

    List of Archived Logs in backup set 60Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 2 1374991 27-APR-10 1375117 27-APR-10

    RMAN>

    123456789

    1011121314151617181920212223

    [oracle@ora1 backup]$ sftp oracle@ora2Connecting to ora2...oracle@ora2's password: sftp> cd /u01/app/oracle/oradata/orcl/backupsftp> mput *Uploading 1vlc5nqn_1_1 to /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_11vlc5nqn_1_1 100% 2142KB 2.1MB/s Uploading 20lc5nqr_1_1 to /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_120lc5nqr_1_1 100% 14MB 13.8MB/s Uploading 21lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_121lc5nqv_1_1 100% 1009MB 13.3MB/s Uploading 22lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_122lc5nqv_1_1 100% 80MB 13.4MB/s Uploading 23lc5ns4_1_1 to /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_123lc5ns4_1_1 100% 33MB 16.6MB/s Uploading 24lc5o0c_1_1 to /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_124lc5o0c_1_1 100% 137KB 136.5KB/s Uploading c-1239150297-20100426-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100426-00 100% 9600KB 9.4MB/s Uploading c-1239150297-20100427-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100427-00 100% 9632KB 9.4MB/s sftp> exit[oracle@ora1 backup]$

    123456789

    101112

    [oracle@ora2 backup]$ export ORACLE_SID=orcl[oracle@ora2 backup]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 11:27:23 2010

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

    RMAN> connect target /

    connected to target database (not started)

    RMAN>

    123456789

    1011121314151617181920

    RMAN> set dbid 1239150297

    executing command: SET DBID

    RMAN> startup nomount

    startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/ini

    starting Oracle instance without parameter file for retrieval of spfileOracle instance started

    Total System Global Area 159019008 bytes

    Fixed Size 1335192 bytesVariable Size 75497576 bytesDatabase Buffers 79691776 bytesRedo Buffers 2494464 bytes

    RMAN>

    123456

    RMAN> show controlfile autobackup format;

    RMAN configuration parameters for database with db_unique_name DUMMY are:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

    RMAN>

    123456789

    1011121314151617181920212223

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore spfile2> to pfile '/u01/app/oracle/oradata/orcl/initorcl.ora'3> from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    channel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/oradata/orcl/backup/channel ORA_DISK_1: SPFILE restore from AUTOBACKUP completeFinished restore at 27-APR-10

    RMAN> shutdown abort;

    Oracle instance shut down

    RMAN>

    1234567

    *.audit_file_dest='/u01/app/oracle/admin/orcl/adump'*.control_files='/u02/app/oracle/oradata/orcl/ctl/control01.ctl','/u01/app/oracle/flash_re*.db_recovery_file_dest_size=4039114752*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'*.diagnostic_dest='/u01/app/oracle'*.log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl/arch'*.local_listener='LISTENER_ORCL'

    12345

    [oracle@ora2 orcl]$ oerr ora 0084500845, 00000, "MEMORY_TARGET not supported on this system"// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/// *Action: Refer to documentation for a list of supported operating systems. Or, size /de[oracle@ora2 orcl]$

    123456789

    10111213

    RMAN> startup nomount pfile='/u01/app/oracle/oradata/orcl/initorcl.ora';

    connected to target database (not started)Oracle instance started

    Total System Global Area 849530880 bytes

    Fixed Size 1339824 bytesVariable Size 528485968 bytesDatabase Buffers 314572800 bytesRedo Buffers 5132288 bytes

    RMAN>

    123456789

    10111213141516171819202122232425262728

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore controlfile from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    recovery area destination: /u01/app/oracle/flash_recovery_areadatabase name (or database unique name) used for search: ORCLchannel ORA_DISK_1: no AUTOBACKUPS found in the recovery areachannel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/oradata/orcl/bchannel ORA_DISK_1: control file restore from AUTOBACKUP completeoutput file name=/u02/oradata/orcl/ctl/control01.ctloutput file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctloutput file name=/u03/app/oracle/oradata/orcl/ctl/control03.ctlFinished restore at 27-APR-10

    RMAN> alter database mount;

    database mountedreleased channel: ORA_DISK_1

    RMAN>

    123456789

    1011121314151617181920

    RMAN> show all;

    RMAN configuration parameters for database with db_unique_name ORCL are:CONFIGURE RETENTION POLICY TO REDUNDANCY 1;CONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/app/oracle/oradata/CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/app/oracle/oradata/orcl/backup/%U' MAXPCONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapc

    RMAN>

    123456789

    101112131415161718192021222324252627282930313233343536373839404142434445464748

    RMAN> catalog start with '/u01/app/oracle/oradata/orcl/backup';

    Starting implicit crosscheck backup at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=20 device type=DISKCrosschecked 32 objectsFinished implicit crosscheck backup at 27-APR-10

    Starting implicit crosscheck copy at 27-APR-10using channel ORA_DISK_1using channel ORA_DISK_2Finished implicit crosscheck copy at 27-APR-10

    searching for all files in the recovery areacataloging files...no files cataloged

    searching for all files that match the pattern /u01/app/oracle/oradata/orcl/backup

    List of Files Unknown to the Database=====================================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

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

    List of Cataloged Files=======================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

    RMAN>

    123456789

    101112131415161718192021222324

    SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";

    123456789

    10111213141516171819202122232425262728293031323334

    RUN {SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";

    SET UNTIL SCN 1375117;

    RESTORE DATABASE;SWITCH DATAFILE ALL;

    RECOVER DATABASE;}

    123456789

    101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899

    100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138

    RMAN> @restore.rman

    RMAN> RUN {2> SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';3> SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';4> SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';5> SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';6> SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';7> SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';8> SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';9> 10> 11> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''12> TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";13> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''14> TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";15> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''16> TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";17> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''18> TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";19> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' 20> TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' "; 21> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''22> TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";23> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' 24> TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";25> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''26> TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";27> 28> SET UNTIL SCN 1375117;29> 30> RESTORE DATABASE;31> SWITCH DATAFILE ALL;32> 33> RECOVER DATABASE;34> }executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    using target database control file instead of recovery catalogsql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.lo

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.l

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.l

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.l

    executing command: SET until clause

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=17 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=1 device type=DISK

    channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dchannel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/example01.dchannel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/test.dbfchannel ORA_DISK_1: reading from backup piece /u01/app/oracle/oradata/orcl/backup/22lc5nchannel ORA_DISK_2: starting datafile backup set restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setchannel ORA_DISK_2: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbfchannel ORA_DISK_2: reading from backup piece /u01/app/oracle/oradata/orcl/backup/23lc5nchannel ORA_DISK_2: piece handle=/u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1 tag=TAchannel ORA_DISK_2: restored backup piece 1channel ORA_DISK_2: restore complete, elapsed time: 00:00:07channel ORA_DISK_2: starting datafile backup set restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setchannel ORA_DISK_2: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbchannel ORA_DISK_2: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbchannel ORA_DISK_2: restoring datafile 00007 to /u01/app/oracle/oradata/orcl/dbfs01.dbfchannel ORA_DISK_2: reading from backup piece /u01/app/oracle/oradata/orcl/backup/21lc5nchannel ORA_DISK_1: piece handle=/u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1 tag=TAchannel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:23channel ORA_DISK_2: piece handle=/u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1 tag=TAchannel ORA_DISK_2: restored backup piece 1channel ORA_DISK_2: restore complete, elapsed time: 00:00:56Finished restore at 27-APR-10

    datafile 1 switched to datafile copyinput datafile copy RECID=9 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/systedatafile 2 switched to datafile copyinput datafile copy RECID=10 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/sysadatafile 3 switched to datafile copyinput datafile copy RECID=11 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/undodatafile 4 switched to datafile copyinput datafile copy RECID=12 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/userdatafile 5 switched to datafile copyinput datafile copy RECID=13 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/examdatafile 6 switched to datafile copyinput datafile copy RECID=14 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/testdatafile 7 switched to datafile copyinput datafile copy RECID=15 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/dbfs

    Starting recover at 27-APR-10using channel ORA_DISK_1using channel ORA_DISK_2

    starting media recovery

    channel ORA_DISK_1: starting archived log restore to default destinationchannel ORA_DISK_1: restoring archived logarchived log thread=1 sequence=2channel ORA_DISK_1: reading from backup piece /u01/app/oracle/oradata/orcl/backup/24lc5ochannel ORA_DISK_1: piece handle=/u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1 tag=TAchannel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01archived log file name=/u02/oradata/orcl/arch/1_2_717335393.dbf thread=1 sequence=2media recovery complete, elapsed time: 00:00:01Finished recover at 27-APR-10

    RMAN> RMAN> **end-of-file**

    RMAN>

    12345

    RMAN> alter database open resetlogs;

    database opened

    RMAN>

    Generated with www.html-to-pdf.net Page 1 / 10

  • Home About Contact Us Terms of Use Search

    CategoriesOracle Database (76)

    Backup and Recovery (20)

    Troubleshooting (21)

    Errors (11)

    Administration (14)

    Database Control (3)

    Network (6)

    High Availability (13)

    Data Guard (13)

    Performance (2)

    SecureFiles and Large Objects

    (1)

    Security (1)

    Utilities (1)

    OCI/OCCI (1)

    Internals (1)

    Grid Control (19)

    TimesTen (14)

    Linux (9)

    Java (13)

    JDBC (8)

    JavaFX (4)

    Windows (5)

    VirtualBox (4)

    Grid Infrastructure (4)

    NetBeans (2)

    Berkeley DB (2)

    JDeveloper (2)

    Golden Gate (2)

    Oracle Fusion Middleware (1)

    Weblogic (1)

    Video (1)

    MySQL (1)

    Cloud Control (1)

    announcements (1)

    Restore database to another host using RMANby Eric Jenkinson on April 28, 2010

    Categories: Backup and Recovery,Oracle Database

    Tagged: host, recover, restore, rman

    This document will detail the steps to restore a database on a new host using RMAN. For this demonstration we will be

    using Oracle Database 11gR2 on Linux and disk based backup.

    One of the first things we want to do is get the Database ID (DBID) from the database in which we will be restoring its

    backup. You can find the DBID by connecting to the database with RMAN as shown below.

    If you are unable to connect to the database you can also find the DBID by inspecting the file name of the control file

    autobackup. For example, c-1239150297-20100427-00, is a control file autobackup. The first group of numbers

    appearing after the c-, 123915029, is the DBID.

    When we restore the database we are not going to have the active redo logs from the original database so we want to stop

    the recovery at the last SCN in the archive logs. We can find the last SCN by querying V$ARCHIVED_LOG.

    Here we see that the archive logs contain log information up to SCN 1375117. That is our stopping SCN. We can also find

    the last SCN in our archive logs through RMAN using LIST BACKUP OF ARCHIVELOG ALL.

    Looking through the output above we see that highest Next SCN is 1375117 which is part of backup set 60.

    Next we need to make the backup available to the new host. If the backups reside on a shared file system that the new host

    has access to then there is nothing more to do. If the backups are on local storage we will need to transfer the backups to

    the new host.

    All of the rest of the steps will take place on the new host.

    Set the ORACLE_SID to the SID of the database that made the backup and start up RMAN and connect to the target.

    We now need to set the DBID and bring the database in mount mode. When we bring the database up in mount mode we

    will receive errors because the parameter file is not found. This is to be expected as we are restoring to a new host. Oracle

    willuseadummyparameterfileforthetimebeing.

    Now with the database in mount mode we need to restore the SPFILE. We are going to need to make some changes to the

    SPFILE so we will restore SPFILE to a PFILE. The SPFILE is stored in the control file autobackup. All of the RMAN

    configuration parameters values are at their defaults so we will need to set the location for the control file autobackup.

    Below we will set the location for the control file autobackup and restore the SPFILE to a PFILE and then we shutdown the

    database.

    Now that we have the SPFILE weneedtoeditthesomeoftheparametertoreflectthenewhostsfilesystemwereappropriate. Below is a list of the some of the parameter you might need to change in your environment. These directories

    must exist on the new host.

    Note: If you are using 11g you to ensure your kernel parameters are set appropriately to avoid a possible ORA-00845.

    After making the necessary changes to the PFILE we now will bring the database back up in NOMOUNT mode so we can

    restore the control files. When bringing the database up in NOMOUNT mode we will use the PFILE we edited earlier.

    Just like the SPFILE we will use the autobackup to restore the control file after setting the control file autobackup format.

    After restoring the control files we mount the database.

    Now that the control files have been restored and mounted, all of the RMAN configuration parameters have been set. You

    should verify the paths to make sure they are appropriate for this host.

    Given the current settings RMAN is going to look in /u03/app/oracle/oradata/orcl/backup for both the control file

    autobackups and database/archive log backups. The backup we copied over is located in

    /u01/app/oracle/oradata/orcl/backup. There are two ways to resolve this issue. Either move the backup to the

    location were RMAN is configured or change the configuration. It may be that moving the backups may not be an option so

    we document what needs to be done next.

    RMAN has record of a backup in /u03/app/oracle/oradata/orcl/backup but has no record of the backup we have in

    /u01/app/oracle/oradata/orcl/backup/. We need remove the record of the old location and the backup of the new

    location.

    In order to let RMAN know about the backup in /u01/app/oracle/oradata/orcl/backup we use the CATALOG

    command.

    As a result of the CATALOG command RMAN performed a CROSSCHECK. The backup registered at

    /u03/app/oracle/oradata/orcl/backup/ was marked expired as a result of the CROSSCHECK because they were not

    present.

    We are almost ready to restore the database the last thing to be done is to build the restore script. During the restore we

    can change the location of the data files by using SET NEWNAME FOR DATAFILE. The data files in the backup are on

    various locations but we would like to restore them to only one.

    Also we would like to change the location of the redo logs as well. In order to change the redo log locations the ALTER

    DATABASE RENAME FILE command has to be issued. Below are examples of both.

    If you remember we stated that we wanted the restore to stop at SCN 1375117 because that was the latest SCN in which

    we have archive logs. In order to stop at a specific SCN we will use the SET UNTIL SCN 1375117.

    After all of that we just need to restore the database, switch the data files so the control files have the new path and recover

    the database. Not much at all.

    Below is the entire script to do just that.

    The script above was saved to the file restore.rman. Below is the output.

    All that is left is to open the database with the RESETLOGS option.

    Share this:

    Facebook Twitter Reddit Tumblr Print Email

    Comments

    eshant (November 25, 2010 11:09 pm)

    * how

    * to

    * restore

    * complete

    * database

    * on

    * another

    * system

    * (in

    * oracle)

    Morad (December 20, 2012 7:35 am)

    Excellentdocumentation

    Many Many Thanks

    sunil (February 4, 2013 5:14 am)

    Can we use multiple channels to do the RESTORE ? We have 4tb db and around 800gb of RMAN backup size. We

    need 5 channels to be configured.

    fazlarabbi (March 12, 2013 8:23 am)

    its a good documents

    but do u have any idea that when i use (/data/app/oracle/rman_backup/ its my BK dirictory

    RMAN>catalogstartwith/data/app/oracle/rman_backup/'

    Starting implicit crosscheck backup at 12-MAR-13

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=63 device type=DISK

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

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

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

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

    RMAN-03002: failure of catalog command at 03/12/2013 19:01:48

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

    ****

    i copy this files from rac database using backup database plus archivelog delete input and then backup backupset

    1,2,3,4format/data/app/oracle/rman_backup/%U'

    and i also try backup as copy command but this message is appear

    MTDBA (July 17, 2013 5:34 pm)

    BestcomprehensivedisasterrecoveryinstructionsIveeverfound.Thanksforsavingmybacon.Systemsadminsthanks you too

    enrique ortiz (January 9, 2014 7:24 am)

    nice post

    i think i sone of the mos comprensive documentation in order to recover a database in another host

    tanks

    Elayaraja (April 1, 2014 3:23 pm)

    Hi,

    please give doc for rman restore script from local server database to production standby database.

    Thanks

    Elayaraja

    Elayaraja (April 1, 2014 3:25 pm)

    Hi,

    please give me doc rman restore script from test to production standby database.

    Thanks

    Elayaraja

    Benny (May 8, 2014 6:59 am)

    good doccumentation

    Rooster (July 4, 2014 1:23 am)

    This is an excellent doc.

    What about when I have to restore/duplicate to a different SID. At what point and how to change the name from PROD

    to DEV2?

    Rooster

    arab (November 17, 2014 3:51 am)

    Thisthegreatestdocumentationiveeverseen.Thank you very much!

    Dale Brooks (January 2, 2015 12:05 pm)

    Superb documentation of a complex matter! Thank you very much!

    Amar (February 4, 2015 4:40 am)

    Nice post!!

    Ganesh@ (February 17, 2015 2:08 am)

    Very Nice Arcticle !!!

    Many Many Thanks

    Mridul Gupta (April 27, 2015 12:23 am)

    Thanks for this wonderful document which is really helpful.

    Post A Comment

    Name (required)

    Email (will not be published) (required)

    Submit Comment

    Notify me of follow-up comments by email.

    Notify me of new posts by email.

    123456789

    1011

    [oracle@ora1 ~]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 09:40:34 2010

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

    RMAN> connect target /

    connected to target database: ORCL (DBID=1239150297)

    RMAN>

    123456789

    10

    SQL> select max(next_change#)2 from v$archived_log3 where archived = 'YES'4 group by thread#;

    MAX(NEXT_CHANGE#)-----------------

    1375117

    SQL>

    123456789

    10111213141516171819202122232425262728293031323334353637383940414243

    RMAN> list backup of archivelog all;

    List of Backup Sets===================

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------54 2.09M DISK 00:00:01 27-APR-10

    BP Key: 54 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1

    List of Archived Logs in backup set 54Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 12 1359005 26-APR-10 1359528 26-APR-101 13 1359528 26-APR-10 1359609 26-APR-101 14 1359609 26-APR-10 1362018 26-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------55 13.82M DISK 00:00:02 27-APR-10

    BP Key: 55 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/20lc5nqr_1_1

    List of Archived Logs in backup set 55Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 1 1362019 26-APR-10 1374991 27-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------60 136.00K DISK 00:00:00 27-APR-10

    BP Key: 60 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094652Piece Name: /u03/app/oracle/oradata/orcl/backup/24lc5o0c_1_1

    List of Archived Logs in backup set 60Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 2 1374991 27-APR-10 1375117 27-APR-10

    RMAN>

    123456789

    1011121314151617181920212223

    [oracle@ora1 backup]$ sftp oracle@ora2Connecting to ora2...oracle@ora2's password: sftp> cd /u01/app/oracle/oradata/orcl/backupsftp> mput *Uploading 1vlc5nqn_1_1 to /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_11vlc5nqn_1_1 100% 2142KB 2.1MB/s Uploading 20lc5nqr_1_1 to /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_120lc5nqr_1_1 100% 14MB 13.8MB/s Uploading 21lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_121lc5nqv_1_1 100% 1009MB 13.3MB/s Uploading 22lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_122lc5nqv_1_1 100% 80MB 13.4MB/s Uploading 23lc5ns4_1_1 to /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_123lc5ns4_1_1 100% 33MB 16.6MB/s Uploading 24lc5o0c_1_1 to /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_124lc5o0c_1_1 100% 137KB 136.5KB/s Uploading c-1239150297-20100426-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100426-00 100% 9600KB 9.4MB/s Uploading c-1239150297-20100427-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100427-00 100% 9632KB 9.4MB/s sftp> exit[oracle@ora1 backup]$

    123456789

    101112

    [oracle@ora2 backup]$ export ORACLE_SID=orcl[oracle@ora2 backup]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 11:27:23 2010

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

    RMAN> connect target /

    connected to target database (not started)

    RMAN>

    123456789

    1011121314151617181920

    RMAN> set dbid 1239150297

    executing command: SET DBID

    RMAN> startup nomount

    startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/ini

    starting Oracle instance without parameter file for retrieval of spfileOracle instance started

    Total System Global Area 159019008 bytes

    Fixed Size 1335192 bytesVariable Size 75497576 bytesDatabase Buffers 79691776 bytesRedo Buffers 2494464 bytes

    RMAN>

    123456

    RMAN> show controlfile autobackup format;

    RMAN configuration parameters for database with db_unique_name DUMMY are:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

    RMAN>

    123456789

    1011121314151617181920212223

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore spfile2> to pfile '/u01/app/oracle/oradata/orcl/initorcl.ora'3> from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    channel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/oradata/orcl/backup/channel ORA_DISK_1: SPFILE restore from AUTOBACKUP completeFinished restore at 27-APR-10

    RMAN> shutdown abort;

    Oracle instance shut down

    RMAN>

    1234567

    *.audit_file_dest='/u01/app/oracle/admin/orcl/adump'*.control_files='/u02/app/oracle/oradata/orcl/ctl/control01.ctl','/u01/app/oracle/flash_re*.db_recovery_file_dest_size=4039114752*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'*.diagnostic_dest='/u01/app/oracle'*.log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl/arch'*.local_listener='LISTENER_ORCL'

    12345

    [oracle@ora2 orcl]$ oerr ora 0084500845, 00000, "MEMORY_TARGET not supported on this system"// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/// *Action: Refer to documentation for a list of supported operating systems. Or, size /de[oracle@ora2 orcl]$

    123456789

    10111213

    RMAN> startup nomount pfile='/u01/app/oracle/oradata/orcl/initorcl.ora';

    connected to target database (not started)Oracle instance started

    Total System Global Area 849530880 bytes

    Fixed Size 1339824 bytesVariable Size 528485968 bytesDatabase Buffers 314572800 bytesRedo Buffers 5132288 bytes

    RMAN>

    123456789

    10111213141516171819202122232425262728

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore controlfile from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    recovery area destination: /u01/app/oracle/flash_recovery_areadatabase name (or database unique name) used for search: ORCLchannel ORA_DISK_1: no AUTOBACKUPS found in the recovery areachannel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/oradata/orcl/bchannel ORA_DISK_1: control file restore from AUTOBACKUP completeoutput file name=/u02/oradata/orcl/ctl/control01.ctloutput file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctloutput file name=/u03/app/oracle/oradata/orcl/ctl/control03.ctlFinished restore at 27-APR-10

    RMAN> alter database mount;

    database mountedreleased channel: ORA_DISK_1

    RMAN>

    123456789

    1011121314151617181920

    RMAN> show all;

    RMAN configuration parameters for database with db_unique_name ORCL are:CONFIGURE RETENTION POLICY TO REDUNDANCY 1;CONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/app/oracle/oradata/CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/app/oracle/oradata/orcl/backup/%U' MAXPCONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapc

    RMAN>

    123456789

    101112131415161718192021222324252627282930313233343536373839404142434445464748

    RMAN> catalog start with '/u01/app/oracle/oradata/orcl/backup';

    Starting implicit crosscheck backup at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=20 device type=DISKCrosschecked 32 objectsFinished implicit crosscheck backup at 27-APR-10

    Starting implicit crosscheck copy at 27-APR-10using channel ORA_DISK_1using channel ORA_DISK_2Finished implicit crosscheck copy at 27-APR-10

    searching for all files in the recovery areacataloging files...no files cataloged

    searching for all files that match the pattern /u01/app/oracle/oradata/orcl/backup

    List of Files Unknown to the Database=====================================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

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

    List of Cataloged Files=======================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

    RMAN>

    123456789

    101112131415161718192021222324

    SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";

    123456789

    10111213141516171819202122232425262728293031323334

    RUN {SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";

    SET UNTIL SCN 1375117;

    RESTORE DATABASE;SWITCH DATAFILE ALL;

    RECOVER DATABASE;}

    123456789

    101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899

    100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138

    RMAN> @restore.rman

    RMAN> RUN {2> SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';3> SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';4> SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';5> SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';6> SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';7> SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';8> SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';9> 10> 11> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''12> TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";13> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''14> TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";15> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''16> TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";17> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''18> TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";19> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' 20> TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' "; 21> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''22> TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";23> SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' 24> TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";25> SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''26> TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";27> 28> SET UNTIL SCN 1375117;29> 30> RESTORE DATABASE;31> SWITCH DATAFILE ALL;32> 33> RECOVER DATABASE;34> }executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    using target database control file instead of recovery catalogsql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.lo

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.l

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.l

    sql statement: ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log

    sql statement: ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.l

    executing command: SET until clause

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=17 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=1 device type=DISK

    channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dchannel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/example01.dchannel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/test.dbfchannel ORA_DISK_1: reading from backup piece /u01/app/oracle/oradata/orcl/backup/22lc5nchannel ORA_DISK_2: starting datafile backup set restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setchannel ORA_DISK_2: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbfchannel ORA_DISK_2: reading from backup piece /u01/app/oracle/oradata/orcl/backup/23lc5nchannel ORA_DISK_2: piece handle=/u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1 tag=TAchannel ORA_DISK_2: restored backup piece 1channel ORA_DISK_2: restore complete, elapsed time: 00:00:07channel ORA_DISK_2: starting datafile backup set restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setchannel ORA_DISK_2: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbchannel ORA_DISK_2: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbchannel ORA_DISK_2: restoring datafile 00007 to /u01/app/oracle/oradata/orcl/dbfs01.dbfchannel ORA_DISK_2: reading from backup piece /u01/app/oracle/oradata/orcl/backup/21lc5nchannel ORA_DISK_1: piece handle=/u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1 tag=TAchannel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:23channel ORA_DISK_2: piece handle=/u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1 tag=TAchannel ORA_DISK_2: restored backup piece 1channel ORA_DISK_2: restore complete, elapsed time: 00:00:56Finished restore at 27-APR-10

    datafile 1 switched to datafile copyinput datafile copy RECID=9 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/systedatafile 2 switched to datafile copyinput datafile copy RECID=10 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/sysadatafile 3 switched to datafile copyinput datafile copy RECID=11 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/undodatafile 4 switched to datafile copyinput datafile copy RECID=12 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/userdatafile 5 switched to datafile copyinput datafile copy RECID=13 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/examdatafile 6 switched to datafile copyinput datafile copy RECID=14 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/testdatafile 7 switched to datafile copyinput datafile copy RECID=15 STAMP=717436375 file name=/u01/app/oracle/oradata/orcl/dbfs

    Starting recover at 27-APR-10using channel ORA_DISK_1using channel ORA_DISK_2

    starting media recovery

    channel ORA_DISK_1: starting archived log restore to default destinationchannel ORA_DISK_1: restoring archived logarchived log thread=1 sequence=2channel ORA_DISK_1: reading from backup piece /u01/app/oracle/oradata/orcl/backup/24lc5ochannel ORA_DISK_1: piece handle=/u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1 tag=TAchannel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01archived log file name=/u02/oradata/orcl/arch/1_2_717335393.dbf thread=1 sequence=2media recovery complete, elapsed time: 00:00:01Finished recover at 27-APR-10

    RMAN> RMAN> **end-of-file**

    RMAN>

    12345

    RMAN> alter database open resetlogs;

    database opened

    RMAN>

    Generated with www.html-to-pdf.net Page 2 / 10

  • Home About Contact Us Terms of Use Search

    CategoriesOracle Database (76)

    Backup and Recovery (20)

    Troubleshooting (21)

    Errors (11)

    Administration (14)

    Database Control (3)

    Network (6)

    High Availability (13)

    Data Guard (13)

    Performance (2)

    SecureFiles and Large Objects

    (1)

    Security (1)

    Utilities (1)

    OCI/OCCI (1)

    Internals (1)

    Grid Control (19)

    TimesTen (14)

    Linux (9)

    Java (13)

    JDBC (8)

    JavaFX (4)

    Windows (5)

    VirtualBox (4)

    Grid Infrastructure (4)

    NetBeans (2)

    Berkeley DB (2)

    JDeveloper (2)

    Golden Gate (2)

    Oracle Fusion Middleware (1)

    Weblogic (1)

    Video (1)

    MySQL (1)

    Cloud Control (1)

    announcements (1)

    Restore database to another host using RMANby Eric Jenkinson on April 28, 2010

    Categories: Backup and Recovery,Oracle Database

    Tagged: host, recover, restore, rman

    This document will detail the steps to restore a database on a new host using RMAN. For this demonstration we will be

    using Oracle Database 11gR2 on Linux and disk based backup.

    One of the first things we want to do is get the Database ID (DBID) from the database in which we will be restoring its

    backup. You can find the DBID by connecting to the database with RMAN as shown below.

    If you are unable to connect to the database you can also find the DBID by inspecting the file name of the control file

    autobackup. For example, c-1239150297-20100427-00, is a control file autobackup. The first group of numbers

    appearing after the c-, 123915029, is the DBID.

    When we restore the database we are not going to have the active redo logs from the original database so we want to stop

    the recovery at the last SCN in the archive logs. We can find the last SCN by querying V$ARCHIVED_LOG.

    Here we see that the archive logs contain log information up to SCN 1375117. That is our stopping SCN. We can also find

    the last SCN in our archive logs through RMAN using LIST BACKUP OF ARCHIVELOG ALL.

    Looking through the output above we see that highest Next SCN is 1375117 which is part of backup set 60.

    Next we need to make the backup available to the new host. If the backups reside on a shared file system that the new host

    has access to then there is nothing more to do. If the backups are on local storage we will need to transfer the backups to

    the new host.

    All of the rest of the steps will take place on the new host.

    Set the ORACLE_SID to the SID of the database that made the backup and start up RMAN and connect to the target.

    We now need to set the DBID and bring the database in mount mode. When we bring the database up in mount mode we

    will receive errors because the parameter file is not found. This is to be expected as we are restoring to a new host. Oracle

    willuseadummyparameterfileforthetimebeing.

    Now with the database in mount mode we need to restore the SPFILE. We are going to need to make some changes to the

    SPFILE so we will restore SPFILE to a PFILE. The SPFILE is stored in the control file autobackup. All of the RMAN

    configuration parameters values are at their defaults so we will need to set the location for the control file autobackup.

    Below we will set the location for the control file autobackup and restore the SPFILE to a PFILE and then we shutdown the

    database.

    Now that we have the SPFILE weneedtoeditthesomeoftheparametertoreflectthenewhostsfilesystemwereappropriate. Below is a list of the some of the parameter you might need to change in your environment. These directories

    must exist on the new host.

    Note: If you are using 11g you to ensure your kernel parameters are set appropriately to avoid a possible ORA-00845.

    After making the necessary changes to the PFILE we now will bring the database back up in NOMOUNT mode so we can

    restore the control files. When bringing the database up in NOMOUNT mode we will use the PFILE we edited earlier.

    Just like the SPFILE we will use the autobackup to restore the control file after setting the control file autobackup format.

    After restoring the control files we mount the database.

    Now that the control files have been restored and mounted, all of the RMAN configuration parameters have been set. You

    should verify the paths to make sure they are appropriate for this host.

    Given the current settings RMAN is going to look in /u03/app/oracle/oradata/orcl/backup for both the control file

    autobackups and database/archive log backups. The backup we copied over is located in

    /u01/app/oracle/oradata/orcl/backup. There are two ways to resolve this issue. Either move the backup to the

    location were RMAN is configured or change the configuration. It may be that moving the backups may not be an option so

    we document what needs to be done next.

    RMAN has record of a backup in /u03/app/oracle/oradata/orcl/backup but has no record of the backup we have in

    /u01/app/oracle/oradata/orcl/backup/. We need remove the record of the old location and the backup of the new

    location.

    In order to let RMAN know about the backup in /u01/app/oracle/oradata/orcl/backup we use the CATALOG

    command.

    As a result of the CATALOG command RMAN performed a CROSSCHECK. The backup registered at

    /u03/app/oracle/oradata/orcl/backup/ was marked expired as a result of the CROSSCHECK because they were not

    present.

    We are almost ready to restore the database the last thing to be done is to build the restore script. During the restore we

    can change the location of the data files by using SET NEWNAME FOR DATAFILE. The data files in the backup are on

    various locations but we would like to restore them to only one.

    Also we would like to change the location of the redo logs as well. In order to change the redo log locations the ALTER

    DATABASE RENAME FILE command has to be issued. Below are examples of both.

    If you remember we stated that we wanted the restore to stop at SCN 1375117 because that was the latest SCN in which

    we have archive logs. In order to stop at a specific SCN we will use the SET UNTIL SCN 1375117.

    After all of that we just need to restore the database, switch the data files so the control files have the new path and recover

    the database. Not much at all.

    Below is the entire script to do just that.

    The script above was saved to the file restore.rman. Below is the output.

    All that is left is to open the database with the RESETLOGS option.

    Share this:

    Facebook Twitter Reddit Tumblr Print Email

    Comments

    eshant (November 25, 2010 11:09 pm)

    * how

    * to

    * restore

    * complete

    * database

    * on

    * another

    * system

    * (in

    * oracle)

    Morad (December 20, 2012 7:35 am)

    Excellentdocumentation

    Many Many Thanks

    sunil (February 4, 2013 5:14 am)

    Can we use multiple channels to do the RESTORE ? We have 4tb db and around 800gb of RMAN backup size. We

    need 5 channels to be configured.

    fazlarabbi (March 12, 2013 8:23 am)

    its a good documents

    but do u have any idea that when i use (/data/app/oracle/rman_backup/ its my BK dirictory

    RMAN>catalogstartwith/data/app/oracle/rman_backup/'

    Starting implicit crosscheck backup at 12-MAR-13

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=63 device type=DISK

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

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

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

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

    RMAN-03002: failure of catalog command at 03/12/2013 19:01:48

    ORA-03113: end-of-file on communication channel

    ORA-01403: no data found

    ORA-01403: no data found

    ****

    i copy this files from rac database using backup database plus archivelog delete input and then backup backupset

    1,2,3,4format/data/app/oracle/rman_backup/%U'

    and i also try backup as copy command but this message is appear

    MTDBA (July 17, 2013 5:34 pm)

    BestcomprehensivedisasterrecoveryinstructionsIveeverfound.Thanksforsavingmybacon.Systemsadminsthanks you too

    enrique ortiz (January 9, 2014 7:24 am)

    nice post

    i think i sone of the mos comprensive documentation in order to recover a database in another host

    tanks

    Elayaraja (April 1, 2014 3:23 pm)

    Hi,

    please give doc for rman restore script from local server database to production standby database.

    Thanks

    Elayaraja

    Elayaraja (April 1, 2014 3:25 pm)

    Hi,

    please give me doc rman restore script from test to production standby database.

    Thanks

    Elayaraja

    Benny (May 8, 2014 6:59 am)

    good doccumentation

    Rooster (July 4, 2014 1:23 am)

    This is an excellent doc.

    What about when I have to restore/duplicate to a different SID. At what point and how to change the name from PROD

    to DEV2?

    Rooster

    arab (November 17, 2014 3:51 am)

    Thisthegreatestdocumentationiveeverseen.Thank you very much!

    Dale Brooks (January 2, 2015 12:05 pm)

    Superb documentation of a complex matter! Thank you very much!

    Amar (February 4, 2015 4:40 am)

    Nice post!!

    Ganesh@ (February 17, 2015 2:08 am)

    Very Nice Arcticle !!!

    Many Many Thanks

    Mridul Gupta (April 27, 2015 12:23 am)

    Thanks for this wonderful document which is really helpful.

    Post A Comment

    Name (required)

    Email (will not be published) (required)

    Submit Comment

    Notify me of follow-up comments by email.

    Notify me of new posts by email.

    123456789

    1011

    [oracle@ora1 ~]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 09:40:34 2010

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

    RMAN> connect target /

    connected to target database: ORCL (DBID=1239150297)

    RMAN>

    123456789

    10

    SQL> select max(next_change#)2 from v$archived_log3 where archived = 'YES'4 group by thread#;

    MAX(NEXT_CHANGE#)-----------------

    1375117

    SQL>

    123456789

    10111213141516171819202122232425262728293031323334353637383940414243

    RMAN> list backup of archivelog all;

    List of Backup Sets===================

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------54 2.09M DISK 00:00:01 27-APR-10

    BP Key: 54 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1

    List of Archived Logs in backup set 54Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 12 1359005 26-APR-10 1359528 26-APR-101 13 1359528 26-APR-10 1359609 26-APR-101 14 1359609 26-APR-10 1362018 26-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------55 13.82M DISK 00:00:02 27-APR-10

    BP Key: 55 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094350Piece Name: /u03/app/oracle/oradata/orcl/backup/20lc5nqr_1_1

    List of Archived Logs in backup set 55Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 1 1362019 26-APR-10 1374991 27-APR-10

    BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------60 136.00K DISK 00:00:00 27-APR-10

    BP Key: 60 Status: AVAILABLE Compressed: NO Tag: TAG20100427T094652Piece Name: /u03/app/oracle/oradata/orcl/backup/24lc5o0c_1_1

    List of Archived Logs in backup set 60Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- --------- ---------- ---------1 2 1374991 27-APR-10 1375117 27-APR-10

    RMAN>

    123456789

    1011121314151617181920212223

    [oracle@ora1 backup]$ sftp oracle@ora2Connecting to ora2...oracle@ora2's password: sftp> cd /u01/app/oracle/oradata/orcl/backupsftp> mput *Uploading 1vlc5nqn_1_1 to /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_11vlc5nqn_1_1 100% 2142KB 2.1MB/s Uploading 20lc5nqr_1_1 to /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_120lc5nqr_1_1 100% 14MB 13.8MB/s Uploading 21lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_121lc5nqv_1_1 100% 1009MB 13.3MB/s Uploading 22lc5nqv_1_1 to /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_122lc5nqv_1_1 100% 80MB 13.4MB/s Uploading 23lc5ns4_1_1 to /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_123lc5ns4_1_1 100% 33MB 16.6MB/s Uploading 24lc5o0c_1_1 to /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_124lc5o0c_1_1 100% 137KB 136.5KB/s Uploading c-1239150297-20100426-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100426-00 100% 9600KB 9.4MB/s Uploading c-1239150297-20100427-00 to /u01/app/oracle/oradata/orcl/backup/c-1239150297-20c-1239150297-20100427-00 100% 9632KB 9.4MB/s sftp> exit[oracle@ora1 backup]$

    123456789

    101112

    [oracle@ora2 backup]$ export ORACLE_SID=orcl[oracle@ora2 backup]$ rman

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 27 11:27:23 2010

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

    RMAN> connect target /

    connected to target database (not started)

    RMAN>

    123456789

    1011121314151617181920

    RMAN> set dbid 1239150297

    executing command: SET DBID

    RMAN> startup nomount

    startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/ini

    starting Oracle instance without parameter file for retrieval of spfileOracle instance started

    Total System Global Area 159019008 bytes

    Fixed Size 1335192 bytesVariable Size 75497576 bytesDatabase Buffers 79691776 bytesRedo Buffers 2494464 bytes

    RMAN>

    123456

    RMAN> show controlfile autobackup format;

    RMAN configuration parameters for database with db_unique_name DUMMY are:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

    RMAN>

    123456789

    1011121314151617181920212223

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore spfile2> to pfile '/u01/app/oracle/oradata/orcl/initorcl.ora'3> from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    channel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/oradata/orcl/backup/channel ORA_DISK_1: SPFILE restore from AUTOBACKUP completeFinished restore at 27-APR-10

    RMAN> shutdown abort;

    Oracle instance shut down

    RMAN>

    1234567

    *.audit_file_dest='/u01/app/oracle/admin/orcl/adump'*.control_files='/u02/app/oracle/oradata/orcl/ctl/control01.ctl','/u01/app/oracle/flash_re*.db_recovery_file_dest_size=4039114752*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'*.diagnostic_dest='/u01/app/oracle'*.log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl/arch'*.local_listener='LISTENER_ORCL'

    12345

    [oracle@ora2 orcl]$ oerr ora 0084500845, 00000, "MEMORY_TARGET not supported on this system"// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/// *Action: Refer to documentation for a list of supported operating systems. Or, size /de[oracle@ora2 orcl]$

    123456789

    10111213

    RMAN> startup nomount pfile='/u01/app/oracle/oradata/orcl/initorcl.ora';

    connected to target database (not started)Oracle instance started

    Total System Global Area 849530880 bytes

    Fixed Size 1339824 bytesVariable Size 528485968 bytesDatabase Buffers 314572800 bytesRedo Buffers 5132288 bytes

    RMAN>

    123456789

    10111213141516171819202122232425262728

    RMAN> set controlfile autobackup format for device type disk to '/u01/app/oracle/oradata/

    executing command: SET CONTROLFILE AUTOBACKUP FORMAT

    RMAN> restore controlfile from autobackup;

    Starting restore at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISK

    recovery area destination: /u01/app/oracle/flash_recovery_areadatabase name (or database unique name) used for search: ORCLchannel ORA_DISK_1: no AUTOBACKUPS found in the recovery areachannel ORA_DISK_1: looking for AUTOBACKUP on day: 20100427channel ORA_DISK_1: AUTOBACKUP found: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/oradata/orcl/bchannel ORA_DISK_1: control file restore from AUTOBACKUP completeoutput file name=/u02/oradata/orcl/ctl/control01.ctloutput file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctloutput file name=/u03/app/oracle/oradata/orcl/ctl/control03.ctlFinished restore at 27-APR-10

    RMAN> alter database mount;

    database mountedreleased channel: ORA_DISK_1

    RMAN>

    123456789

    1011121314151617181920

    RMAN> show all;

    RMAN configuration parameters for database with db_unique_name ORCL are:CONFIGURE RETENTION POLICY TO REDUNDANCY 1;CONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/app/oracle/oradata/CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/app/oracle/oradata/orcl/backup/%U' MAXPCONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapc

    RMAN>

    123456789

    101112131415161718192021222324252627282930313233343536373839404142434445464748

    RMAN> catalog start with '/u01/app/oracle/oradata/orcl/backup';

    Starting implicit crosscheck backup at 27-APR-10allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=20 device type=DISKCrosschecked 32 objectsFinished implicit crosscheck backup at 27-APR-10

    Starting implicit crosscheck copy at 27-APR-10using channel ORA_DISK_1using channel ORA_DISK_2Finished implicit crosscheck copy at 27-APR-10

    searching for all files in the recovery areacataloging files...no files cataloged

    searching for all files that match the pattern /u01/app/oracle/oradata/orcl/backup

    List of Files Unknown to the Database=====================================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

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

    List of Cataloged Files=======================File Name: /u01/app/oracle/oradata/orcl/backup/20lc5nqr_1_1File Name: /u01/app/oracle/oradata/orcl/backup/23lc5ns4_1_1File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100427-00File Name: /u01/app/oracle/oradata/orcl/backup/c-1239150297-20100426-00File Name: /u01/app/oracle/oradata/orcl/backup/21lc5nqv_1_1File Name: /u01/app/oracle/oradata/orcl/backup/1vlc5nqn_1_1File Name: /u01/app/oracle/oradata/orcl/backup/24lc5o0c_1_1File Name: /u01/app/oracle/oradata/orcl/backup/22lc5nqv_1_1

    RMAN>

    123456789

    101112131415161718192021222324

    SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo03_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo03_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo04.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo04.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo04_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo04_b.log'' ";

    123456789

    10111213141516171819202122232425262728293031323334

    RUN {SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/orcl/system01.dbf';SET NEWNAME FOR DATAFILE 2 TO '/u01/app/oracle/oradata/orcl/sysaux01.dbf';SET NEWNAME FOR DATAFILE 3 TO '/u01/app/oracle/oradata/orcl/undotbs01.dbf';SET NEWNAME FOR DATAFILE 4 TO '/u01/app/oracle/oradata/orcl/users01.dbf';SET NEWNAME FOR DATAFILE 5 TO '/u01/app/oracle/oradata/orcl/example01.dbf';SET NEWNAME FOR DATAFILE 6 TO '/u01/app/oracle/oradata/orcl/test.dbf';SET NEWNAME FOR DATAFILE 7 TO '/u01/app/oracle/oradata/orcl/dbfs01.dbf';

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo01.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo01.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/red01_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/red01_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo02.log''TO ''/u01/app/oracle/oradata/orcl/redo/redo02.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u03/app/oracle/oradata/orcl/redo/redo02_b.log''TO ''/u02/app/oracle/oradata/orcl/redo/redo02_b.log'' ";

    SQL "ALTER DATABASE RENAME FILE ''/u02/app/oracle/oradata/orcl/redo/redo03.log'' TO ''/u01/app/oracle/oradata/orcl/redo/redo03.log'' ";

    SQL "ALTER DATA