Restore Database Through Rman

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Restore Database Through Rman as PDF for free.

More details

  • Words: 586
  • Pages: 3
Simple RMAN - CONTROL FILE Restore in different server Copy RMAN backup files including archive log backup files to the target server Copy the SNAPSHOT CONTROL FILE or backed up control file from source server to target server. If you do not remember the snapshot control file location, connect to source rman and query “snapshot controlfile name” and it will give as below: Source Server: Rman>connect target / connected to target database: HRDMO (DBID=209403493034) RMAN> show SNAPSHOT CONTROLFILE NAME; using target database control file instead of recovery catalog RMAN configuration parameters are: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/10g/dbs/snapcf_HRDMO.f'; # default Copy the snapshot controlfile to your target server or the backup of control file. NOTE: You need to have same directories created for the restoration of files and the RMAN backup files, including archive log backup and they should be in the same structure as it is in source server. If you don’t have exactly same file system just create soft links to cheat. Target Server: Export ORACLE_SID=HRDMO RMAN RMAN>startupnomount; RMAN>setDBID=209403493034; executingcommand:SETDBID RMAN> restore controlfile from '/opt/oracle/standby/dbs/snapcf_crmprod.f'; # The location where you have it in target srvr. Starting restore at 06-FEB-08 using channel ORA_DISK_1 channel ORA_DISK_1: copied controlfile copy replicating controlfile input filename=/db1/oradata/HRDMO/control01.ctl output filename=/db2/oradata/HRDMO/control02.ctl output filename=/db3/oradata/HRDMO/control03.ctl Finished restore at 06-FEB-08 RMAN>alterdatabasemount; RMAN>run 2>{ 3>sql'altersessionset NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"'; 4>setuntil time'2008-01-31 01:00:00'; 5>restoredatabase; 6>recoverdatabase; 7> } RMAN>alter database open resetlogs; You have the copy of instance in the target server. Try it out and if you have any issues, comment here we can fix it. $ rman target / Recovery Manager: Release 10.2.0.4.0 - Production on Wed Mar 4 12:15:45 2009 Copyright (c) 1982, 2007, Oracle.

All rights reserved.

connected to target database: PORTDB (not mounted) RMAN> set DBID=3512683395

executing command: SET DBID RMAN> restore controlfile from '/clone/oracle/rmanbackup/snapcf_PORTDB1.f'; (restore from controlfile snapshot) OR RMAN> restore controlfile from '/clone/oracle/rmanbackup/cntrl_45_1_680521894.ctl'; (restore from backupset) Starting restore at 04-MAR-09 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=1641 devtype=DISK channel ORA_DISK_1: copied control file copy output filename=/u01/testdb/oradata/control.ctl1 Finished restore at 04-MAR-09 RMAN> run 2> { 3> set until time'04-MAR-09 12:44:29'; SET NEWNAME FOR DATAFILE 4 to '/u01/testdb/oradata/users.259.677937095' ; SET NEWNAME FOR DATAFILE 3 to '/u01/testdb/oradata/sysaux.257.677937093' ; SET NEWNAME FOR DATAFILE 2 to '/u01/testdb/oradata/undotbs1.258.677937093' ; SET NEWNAME FOR DATAFILE 1 to '/u01/testdb/oradata/system.256.677937093' ; SET NEWNAME FOR DATAFILE 5 to '/u01/testdb/oradata/undotbs2.264.677937203' ; SET NEWNAME FOR DATAFILE 6 to '/u01/testdb/oradata/icmlfq32.275.679070181' ; SET NEWNAME FOR DATAFILE 7 to '/u01/testdb/oradata/icmlnf32.276.679070457' ; SET NEWNAME FOR DATAFILE 8 to '/u01/testdb/oradata/icmvfq04.277.679070475' ; SET NEWNAME FOR DATAFILE 9 to '/u01/testdb/oradata/icmsfq04.278.679070493' ; SET NEWNAME FOR DATAFILE 10 to '/u01/testdb/oradata/icmlsndx.279.679070511' ; SET NEWNAME FOR DATAFILE 11 to '/u01/testdb/oradata/users.291.679829543' ; SET NEWNAME FOR DATAFILE 12 to '/u01/testdb/oradata/users.281.679829563' ; SET NEWNAME FOR DATAFILE 13 to '/u01/testdb/oradata/system.285.679829591' ; SET NEWNAME FOR DATAFILE 14 to '/u01/testdb/oradata/system.282.679829609' ; SET NEWNAME FOR DATAFILE 15 to '/u01/testdb/oradata/system.283.679829629' ; SET NEWNAME FOR DATAFILE 16 to '/u01/testdb/oradata/users.274.679829661' ; 4> 5> SET NEWNAME FOR DATAFILE 17 to '/u01/testdb/oradata/sysaux.272.679829699' ; SET NEWNAME FOR DATAFILE 18 to '/u01/testdb/oradata/sysaux.270.679829731' ; restore database; switch datafile all; } rman>recover database; sql>alter database open resetlogs; now your database will be open; [5]Now ADD this TO init file

_allow_resetlogs_corruption = true _allow_read_only_corruption = true What will happen, if you don’t have Valid Backup? There is a Workaround via which you can at least recover your Database to some extent: SQL> select * from v$log; SQL> alter system set “_allow_resetlogs_corruption”=true scope=spfile; SQL> shutdown immediate; SQL> startup mount; SQL> recover database using backup controlfile until cancel; SQL> alter database open resetlogs; SQL> shutdown immediate; SQL> startup

Related Documents