Wednesday, March 5, 2008

Rebuild Lost Database With RMAN Backup


In this document we will rebuild lost database from backup taken,We have rman online backup on the server in this path /u01/rman_backup and have the DBID which is 2412534328

1) Set ORACLE_SID to the old database name and open rman

[oracle@rac1 ~]$ export ORACLE_SID=RAC
[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Sep 9 10:26:14 2013

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

connected to target database (not started)

RMAN>

2) Set the DBID to the old database

RMAN> set dbid 2412534328;

executing command: SET DBID

RMAN>

3) Start the database in nomount mode

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.3/db_1/dbs/initRAC.ora'

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

Total System Global Area 158662656 bytes

Fixed Size 2211448 bytes
Variable Size 88080776 bytes
Database Buffers 62914560 bytes
Redo Buffers 5455872 bytes

RMAN>

4) Restore spfile from the backup

RMAN> restore spfile from AUTOBACKUP;

Starting restore at 09-SEP-13
using channel ORA_DISK_1

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20130909
channel ORA_DISK_1: AUTOBACKUP found: c-2412534328-20130909-00
channel ORA_DISK_1: restoring spfile from AUTOBACKUP c-2412534328-20130909-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 09-SEP-13

RMAN>

Check that the spfile was successfully restored

[oracle@rac1 ~]$ cd /u01/app/oracle/product/11.2.0.3/db_1/dbs
[oracle@rac1 dbs]$
[oracle@rac1 dbs]$ ls -ltrh spfile*
-rw-r-----. 1 oracle oinstall 2.5K Sep 9 10:34 spfileRAC.ora
[oracle@rac1 dbs]$

5) Startup the database in nomount

[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Sep 9 10:45:03 2013

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

connected to target database: RAC (not mounted)

RMAN> startup force nomount;

Oracle instance started

Total System Global Area 400846848 bytes

Fixed Size 2213776 bytes
Variable Size 176162928 bytes
Database Buffers 218103808 bytes
Redo Buffers 4366336 bytes

RMAN>

6) Restore the controlfile from the backup

RMAN> restore controlfile from '/u01/rman_backup/cntrl_10_1_825675307';

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

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:09
output file name=+DATA/rac/controlfile/current.260.825677283
Finished restore at 09-SEP-13

RMAN>

7) Shutdown the database and startup in mount mode

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 400846848 bytes

Fixed Size 2213776 bytes
Variable Size 176162928 bytes
Database Buffers 218103808 bytes
Redo Buffers 4366336 bytes

RMAN>

8) Restore the database

RMAN> restore database;

Starting restore at 09-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to +FRA/rac/datafile/sysaux.258.824725695
channel ORA_DISK_1: restoring datafile 00003 to +DATA/rac/datafile/undotbs1.258.824552199
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/FULL_RAC_04ojdj4f_1_1
channel ORA_DISK_1: piece handle=/u01/rman_backup/FULL_RAC_04ojdj4f_1_1 tag=TAG20130909T100811
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/rac/datafile/system.256.824552197
channel ORA_DISK_1: restoring datafile 00004 to +FRA/rac/datafile/users.257.824724469
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/FULL_RAC_03ojdj4d_1_1
channel ORA_DISK_1: piece handle=/u01/rman_backup/FULL_RAC_03ojdj4d_1_1 tag=TAG20130909T100811
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 09-SEP-13

RMAN>

9) Recover the database

RMAN> recover database;

Starting recover at 09-SEP-13
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/RAC_arch_9_1
channel ORA_DISK_1: piece handle=/u01/rman_backup/RAC_arch_9_1 tag=TAG20130909T101102
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=+FRA/rac/archivelog/2013_09_09/thread_1_seq_8.257.825677727 thread=1 sequence=8
archived log file name=+FRA/rac/archivelog/2013_09_09/thread_1_seq_9.258.825677727 thread=1 sequence=9
unable to find archived log
archived log thread=1 sequence=10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/09/2013 10:55:31
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 10 and starting SCN of 1055756

RMAN>

10) Open the database with resetlog option to solve the RMAN-06054 error in the recover command


RMAN> alter database open resetlogs;

database opened

RMAN>

No comments: