OCP-1Z0-053-V12.02-683

Source: Internet
Author: User

683. Your production database it f unctional on the SHOST1 host. Y ou are backing up the production

Database by using Recovery Manager (RMAN) with the recovery catalog. You want to replicate

Production database to anther host, SHOST2, for testing new applications.

After you ensured that the backups of the target database are accessible on the new host, what must you

Do to restore and recover the backup for the test environment?

A. Restoring the control file from the backup by using the nocatal og option to restore, and recovering the data files

B. Restoring the data files by us ing the NOCATALOG option and us ing the SET NEWNAME command to change the location

C. Restoring the server parameter file from the backup by using the rediscovery catalog to restore, and recovering the data files

D. Restoring the data files from the backup by using the recovery catalog to recover the files, and using the SWITCH command to change the location.

Answer: D

Answer:

Reference: http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmadvre.htm#BRADV370

Select A for the correct answer

Your production database is in SHOST1, and you use the recovery directory of rman to back up the production database. You want to copy the production database to SHOST2 on another host for testing.

After that, you are sure that the backup of your target database can be accessed on the new host. What do you have to restore and restore in the test environment?

Start RMAN on hostb and connect to the target database without connecting to the recovery catalog. C error D Error

If the file systems on the destination system are set up to have the same paths as the source host, then do not use set newname for those files restored to the same path as on the source host. B Error

Testing the Restore of a Database on a New Host

This scenario assumes that you want to test whether you can restore your database to a new host. in this scenario, you have two networked Linux hosts, hosta and hostb. A target database named trgta is on hosta and is registered in recovery catalog catdb. you want to test the restore and recovery of trgta onhostb, while keeping database trgta up and running on hosta.

Now, assume that the directory structure of hostb is different from hosta. the target database is located in/net/hosta/dev3/oracle/dbs, but you want to restore the database to/net/hostb/oracle/oradata/test. you have tape backups of data files, control files, archived redo logs, and the server parameter file on a media manager accessible by both hosts. the ORACLE_SID for the trgta database is trgta and does not change for the restored database.

Caution:

If you are restoring the database for test purposes, then never connect RMAN to the test database and the recovery catalog.

To restore the database on a new host:

Ensure that the backups of the target database are accessible on the new host.

To test disaster recovery, you must have a recoverable backup of the target database. when preparing your disaster recovery strategy, ensure that the backups of the data files, control files, and server parameter file are restorable on hostb. thus, you must configure the media management software so that hostb is a media manager client and can read the backup sets created on hosta. consult the media management vendor for support on this issue.

  1. Configure the ORACLE_SID on hostb.

    This scenario assumes that you want to start the RMAN client on hostb and authenticate yourself through the operating system. However, you must be connected to hostb either locally or through a net service name.

    After logging in to hostb with administrator privileges, edit the/etc/group file so that you are logged in the DBA group:

    Dba: *: 614: <your_user_name>

    Set the ORACLE_SID environment variable on hostb to the same value used on hosta:

    % Setenv ORACLE_SID trgta

    Start RMAN on hostb and connect to the target database without connecting to the recovery catalog. C Error

    For example, enter the following command:

    % Rman nocatrman RMAN> connect target/
  2. Set the DBID and start the database instance without mounting the database.

    For example, run set dbid to set the DBID, then run startup nomount:

    Set dbid 1340752057; STARTUP NOMOUNT

    RMAN fails to find the server parameter file, which has not yet been restored, but starts the instance with a "dummy" file. Sample output follows:

    Startup failed: ORA-01078: failure in processing system parameters LRM-00109: cocould not open parameter file '/net/hostb/oracle/dbs/inittrgta. ora 'trying to start the Oracle instance without parameter files... oracle instance started
  3. Restore and edit the server parameter file.

    Because you enabled the control file autobackup feature when making your backups, the server parameter file is supported in the backup. if you are restoring an autobackup that has a nondefault format, then use the set controlfile autobackup format command to indicate the format.

    Allocate a channel to the media manager, then restore the server parameter file as a client-side parameter file and use the SET command to indicate the location of the autobackup (in this example, the autobackup is in/tmp ):

    RUN {allocate channel c1 device type sbt PARMS '...'; set controlfile autobackup format for device type disk to '/tmp/% F'; restore spfile to pfile '? /Oradata/test/inittrgta. ora 'from autobackup; shutdown abort ;}
  4. Edit the restored initialization parameter file.

    Change any location-specific parameters, for example, those ending in _ DEST, to reflect the new directory structure. For example, edit the following parameters:

    -IFILE-LOG_ARCHIVE_DEST_1-CONTROL_FILES
  5. Restart the instance with the edited initialization parameter file.

    For example, enter the following command:

    Startup force nomount pfile = '? /Oradata/test/inittrgta. ora ';
  6. Restore the control file from an autobackup and then mount the database.

    For example, enter the following command:

    RUN {allocate channel c1 device type sbt PARMS '...'; restore controlfile from autobackup; alter database mount ;}

    RMAN restores the control file to whatever locations you specified in the CONTROL_FILES initialization parameter.

  7. Catalog the data file copies that you copied in "Restoring Disk Backups to a New Host ", using their new file names or catalog start with (if you know all the files are in directories with a common prefix easily addressed with a catalog start with command ). for example, run:

    Catalog start with '/oracle/oradata/trgt /';

    If you want to specify files individually, then you can execute a CATALOG command as follows:

    Catalog datafilecopy '/oracle/oradata/trgt/system01.dbf', '/oracle/oradata/trgt/undotbs01.dbf','/oracle/oradata/trgt/cwmlite01.dbf ', '/oracle/oradata/trgt/drsys01.dbf','/oracle/oradata/trgt/example01.dbf', '/oracle/oradata/trgt/indx01.dbf ', '/oracle/oradata/trgt/tools01.dbf','/oracle/oradata/trgt/users01.dbf ';
  8. Start a SQL * Plus session on the new database and query the database file names recorded in the control file.

    Because the control file is from the trgta database, the recorded file names use the original hosta file names. you can query V $ views to obtain this information. run the following query in SQL * Plus:

    Column name format a60 spool log '/tmp/db_filenames.out' select file # AS "File/Grp #", name from v $ datafile union select group #, member from v $ LOGFILE; SPOOL OFF EXIT

    Write the RMAN restore and recovery script. The script must include the following steps:

    For each data file on the destination host that is restored to a different path than it had on the source host, use a set newname command to specify the new path on the destination host.If the file systems on the destination system are set up to have the same paths as the source host, then do not use set newname for those files restored to the same path as on the source host. B Error

  9. For each online redo log that is to be created at a different location than it had on the source host, use SQL ALTER DATABASE RENAME FILEcommands to specify the path name on the destination host. if the file systems on the destination system are set up to have the same paths as the source host, then do not use alter database rename file for those files restored to the same path as on the source host.

  10. Perform a set until operation to limit reied to the end of the archived redo logs. The recovery stops with an error if no set until command is specified.

  11. Restore and recover the database.

  12. Run the switch datafile all command so that the control file recognizes the new path names as the official new names of the data files.

    Example 20-3 shows the RMAN script reco_test.rman that can perform the restore and recovery operation.

    Example 20-3 Restoring a Database on a New Host

    RUN {# allocate a channel to the tape device allocate channel c1 device type sbt PARMS '...'; # rename the data files and online redo logs set newname for datafile 1 '? /Oradata/test/system01.dbf '; set newname for datafile 2 '? /Oradata/test/undotbs01.dbf '; set newname for datafile 3 '? /Oradata/test/cwmlite01.dbf '; set newname for datafile 4 '? /Oradata/test/drsys01.dbf '; set newname for datafile 5 '? /Oradata/test/example01.dbf '; set newname for datafile 6 '? /Oradata/test/indx01.dbf '; set newname for datafile 7 '? /Oradata/test/tools01.dbf '; set newname for datafile 8 '? /Oradata/test/users01.dbf '; SQL "ALTER DATABASE RENAME FILE''/dev3/oracle/dbs/redo01.log ''to ''? /Oradata/test/redo01.log ''"; SQL "ALTER DATABASE RENAME FILE''/dev3/oracle/dbs/redo02.log ''to ''? /Oradata/test/redo02.log ''"; # Do a set until to prevent recovery of the online logs set until scn 123456; # restore the database and switch the data file names restore database; switch datafile all; # recover the database recover database;} EXIT
  13. Execute the script created in the previous step.

    For example, start RMAN to connect to the target database and run the @ command:

    % Rman TARGET/nocatrman RMAN> @ reco_test.rman
  14. Open the restored database with the RESETLOGS option.

    From the RMAN prompt, open the database with the RESETLOGS option:

    Alter database open resetlogs;

    Caution:

    When you re-open your database in the next step, do not connect to the recovery catalog. otherwise, the new database incarnation created is registered automatically in the recovery catalog, and the file names of the production database are replaced by the new file names specified in the script.
  15. Optionally, delete the test database with all of its files.

    Note:

    If you used an ASM disk group, then the drop database command is the only way to safely remove the files of the test database. if you restored to non-ASM storage then you can also use operating system commands to remove the database.

    Use the drop database command to delete all files associated with the database automatically. The following example deletes the database files:

    Startup force nomount pfile = '? /Oradata/test/inittrgta. ora '; drop database;

    Because you did not perform the restore and recovery operation when connected to the recovery catalog, the recovery catalog INS no records for any of the restored files or the procedures stored med during the test. likewise, the control file of the trgta database is completely unaffected by the test.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.