Wednesday, October 19, 2011

RESTORE SPFILE FROM AUTOBACKUP MODE (WITH OUT RECOVERY CATALOG)

I have lost my spfile and controlfile which are stored in the ASM disk and now I am trying to restore the spfile & controlfile from the autobackup and it is not enabled with the recovery catalog. This article cover only the spfile restore and i will update a another article with controlfile restore.

Note: This is for the RAC database and I am started with one instance till I complete the entire process, i am not going to do anything on the second instance. I am doing the autobackup to the TAPE.


Note: when you are allocating the channel & no of channels, you have specified
      Accordingly to system perform. It can be either from disk & tape. In the  below example  i have used TAPE. so i have used the below option.
RESTORING SPFILE (WITH OUT RECOVERY CATALOG & AUTOBACKUP ON MODE)


STEP#1 START THE DB WITH TEMP PFILE(you can get it from alert log, you will get the main parameters)

bhuora01[BHU_1]>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 6 17:08:55 2011

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

Connected to an idle instance.

SQL> startup nomount pfile='file.ora';
ORACLE instance started.

Total System Global Area 1219334144 bytes
Fixed Size                  2225952 bytes
Variable Size             620759264 bytes
Database Buffers          587202560 bytes
Redo Buffers                9146368 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

Note: when you don’t have the recovery catalog, you have to pickup the DBID from your alert log.

STEP#2 START THE RESTORE FROM AUTOBACKUP MODE TO THE ASM

bhuora01[BHU_1]>rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Thu Oct 6 17:12:36 2011

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

connected to target database: BHU (not mounted)

RMAN> set DBID 1726821198;

executing command: SET DBID

RMAN> run
{
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=BHU_A,OB2BARLIST=bhuora01_ORA_BHU_ON_Weekly)';
restore spfile to '+BHU_DATA1' from autobackup;
}2> 3> 4> 5> 6>

using target database control file instead of recovery catalog
allocated channel: dev_0
channel dev_0: SID=80 instance=BHU_1 device type=SBT_TAPE
channel dev_0: Data Protector A.06.11/PHSS_41802/PHSS_41803/DPSOL_00435/DPLNX_

Starting restore at 06-OCT-11

channel dev_0: looking for AUTOBACKUP on day: 20111006
channel dev_0: AUTOBACKUP found: c-1726821198-20111006-00
channel dev_0: restoring spfile from AUTOBACKUP c-1726821198-20111006-00
channel dev_0: SPFILE restore from AUTOBACKUP complete
Finished restore at 06-OCT-11
released channel: dev_0

RMAN>

Note: you can restore directly to the ASM instance by specifying the “to” option. If you are not specifying “to” option then it will restore the spfile in the $ORACLE_HOME/dbs folder of the restoring instance.

restore spfile to '+BHU_DATA1' from autobackup;


STEP#3 STOP & START THE DB WITH NEW SPFILE

bhuora01[BHU_1]>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 6 17:20:24 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,                                                                              OLAP,
Data Mining and Real Application Testing options

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit

Note: since I am running on the RAC environment, I am changing the SPFILE CONFIGURATION DETAILS USING SRVCTL. To change to the new spfile configuration details


bhuora01[BHU_1]> srvctl modify database –d BHU_A –p '+BHU_DATA1/BHU_A/PARAMETERFILE/spfile.263.762593853

you can start the database
 `
bhuora01[BHU_1]> srvctl start database –d BHU_A

you can check the status of the cluster database

bhuora01[BHU_1]> srvctl status  database -d BHU_A
Instance BHU_1 is running on node bhuora01
Instance BHU_2 is running on node bhuora02

No comments:

Post a Comment