Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Wednesday, June 30, 2010

Restore database with SPFILE and Controlfile

when SPFILE and controlfile backup location are not available or not sure then do the following to do the restore of controlfile and spfile:
but YOU SHOULD KNOW the DBID

when no init.ora or spfile available
use RMAN
>export ORACLE_SID=ABC
>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jun 30 14:16:48 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database (not started)

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/UNIX/u0001/oracle/product/10.2.0.1/db_1/dbs/initABC.ora'

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

Total System Global Area 159383552 bytes

Fixed Size 1977112 bytes
Variable Size 71308520 bytes
Database Buffers 79691776 bytes
Redo Buffers 6406144 bytes

now restoring the controlfile:

'set controlfile autobackup format' is only necessary if the controlfile autobackup is in a NON default location – set accordingly

RMAN> set dbid=123456789012;
run {
set controlfile autobackup format for device type disk to '\%F'; -----if disk else change type to SBT if TAPE
restore spfile from autobackup;
restore controlfile from autobackup;
startup force mount; --startup FORCE mount' is needed because the instance was originally started without an spfile
}

once DB is mounted .. list the backup files and you all set with restore and recover commands
RMAN> list backup summary;

No comments: