Friday, September 13, 2013

RMAN Backup Restoration to Another Server on Windows 2008 R2

First, install the binaries using the option software only in the database installation wizard.

Then create a instance with the SID using oradim.

D:\KALIPTO\product\11.2.0\dbhome_1\BIN>oradim -new -sid KALIPTO

Then connect to rman and set the DBID as follows

D:\KALIPTO\product\11.2.0\dbhome_1\BIN>rman
Recovery Manager: Release 11.2.0.2.0 - Production on Thu Sep 12 16:36:52 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target /

connected to target database (not started)

RMAN> set DBID=221460339

executing command: SET DBID

RMAN>

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'D:\KALIPTO\PRODUCT\11.2.0\DBHOME_1\DATABASE\INITKALIPTO.ORA'

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

Total System Global Area     158662656 bytes

Fixed Size                     2251280 bytes
Variable Size                 96470512 bytes
Database Buffers              54525952 bytes
Redo Buffers                   5414912 bytes

RMAN>

RMAN> restore spfile to pfile 'D:\KALIPTO\product\11.2.0\dbhome_1\database\initKALIPTO.ora' from 'D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130820-00';

Starting restore at 12-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=67 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130820-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 12-SEP-13

RMAN>

RMAN> shutdown immediate

Oracle instance shut down

Then open pfile and create the directory structure as required to nomount database.

RMAN> startup force nomount

Oracle instance started

Total System Global Area   21378957312 bytes

Fixed Size                     2262600 bytes
Variable Size               8992590264 bytes
Database Buffers           12348030976 bytes
Redo Buffers                  36073472 bytes

Then restore the controlfile and mount database.

RMAN> restore controlfile from autobackup;

Starting restore at 12-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=303 device type=DISK

recovery area destination: D:\KALIPTO\fast_recovery_area
database name (or database unique name) used for search: KALIPTO
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130912
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130911
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130910
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130909
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130908
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130907
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130906
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/12/2013 16:41:31
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece


RMAN> restore controlfile from 'D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130820-00';

Starting restore at 12-SEP-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\KALIPTO\ORADATA\KALIPTO\CONTROL01.CTL
output file name=D:\KALIPTO\FAST_RECOVERY_AREA\KALIPTO\CONTROL02.CTL
Finished restore at 12-SEP-13

RMAN>

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

If the RMAN backup residing directory is different than primary database server, then following catalog command is required to specify the RMAN backup directory.

RMAN> catalog start with 'D:\AML_BACKUP\';

searching for all files that match the pattern D:\AML_BACKUP\

List of Files Unknown to the Database
=====================================
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130820-00
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130912-00
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130912-01
File Name: D:\AML_BACKUP\DATAFILES_823945946_2797_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823947858_2798_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823949157_2799_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823950816_2800_1.BAK
File Name: D:\AML_BACKUP\O1_MF_NCNNF_TAG20130912T154025_9334ROHD_.BKP
File Name: D:\AML_BACKUP\O1_MF_NNSNF_TAG20130912T155610_9335P2VW_.BKP

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

List of Cataloged Files
=======================
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130820-00
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130912-00
File Name: D:\AML_BACKUP\AUTOBAK_CTRLFILEC-221460339-20130912-01
File Name: D:\AML_BACKUP\DATAFILES_823945946_2797_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823947858_2798_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823949157_2799_1.BAK
File Name: D:\AML_BACKUP\DATAFILES_823950816_2800_1.BAK
File Name: D:\AML_BACKUP\O1_MF_NCNNF_TAG20130912T154025_9334ROHD_.BKP
File Name: D:\AML_BACKUP\O1_MF_NNSNF_TAG20130912T155610_9335P2VW_.BKP

Then restore and recover database and open the database with resetting logs.

RMAN> restore database;

RMAN> recover database;

RMAN> alter database open resetlogs;

3 comments:

  1. Hi, Thank you for the restore procedure. Now how to keep the standby (new) server uptodate. How to transfer the archivelog files to new server and update the database. Please give me the procedure. Thank you - Roche

    ReplyDelete
  2. The steps provided works great.

    ReplyDelete
  3. Great and that i have a keen offer: Where Do You Get The Money To Renovate A House split level house renovation

    ReplyDelete