Thursday, July 17, 2008

Database recovery using BCV

Database Recovery using BCV

Step 1. –Mounting BCV and User credentials

a) Mount BCV on to BCV mounting server (10.27.1.152)
b) Create appropriate oracle user (refer oracle user from Host server) with proper group spec
c) Copy oracle user profile
d) FTP the backup control file from /var/opt/oracle on host server to the BCV server say at $ORACLE_HOME/dbs
e) Cross check all the Filesystem mounted on to BCV mounting server with host server

All above steps to be done by Server support Team.

Step2. Database Recovery

a) Make changes in the Init ora file to read control file copied in step 1.d

Edit control file entry in the init{SID}.ora
#*.control_files='/u01/app/oracle/product/10g/oradata/ODSPROD/control01.ctl','/u04/oradata/ods1/control02.ctl','/
u05/oradata/ods2/control03.ctl'
*.control_files='/u01/app/oracle/product/10g/dbs/cntrl_bcv.dbf'
*.core_dump_dest='/u01/app/oracle/product/10g/admin/ODSPROD/cdump'
*.cursor_sharing='SIMILAR'
*.db_block_size=8192

b) Log in as Sysdba and startup database with pfile option as below

startup database in mount with pfile=init{SID}.ora

oracle@sun152>sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 26 13:33:50 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup mount pfile=initODSPROD.ora
ORACLE instance started.

Total System Global Area 4.0802E+10 bytes
Fixed Size 2250696 bytes
Variable Size 3294210104 bytes
Database Buffers 3.7497E+10 bytes
Redo Buffers 8650752 bytes
Database mounted.
SQL>

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

c) Check V$recover_file
Check above V$view for CHANGE# same for all datafiles and also check for any File# missing, to Ensure backup done on proper backup mode




d) View V$log to analyze Sequence# of redo logs and note down current redolog group and its filename from v$logfile.

SQL> Select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------
5 1 64087 536870912 2 NO CURRENT 1149658822 25-DEC-07
8 1 64086 536870912 2 YES INACTIVE 1149657091 25-DEC-07
7 1 64085 536870912 2 YES INACTIVE 1149466256 25-DEC-07
6 1 64084 536870912 2 YES INACTIVE 1149380057 25-DEC-07



d) Look for achivelog exist for above inactive Sequence#

ls –ltr archivelog destination

-rw-r----- 1 oracle oinstall 521260544 Dec 25 20:21 1_64084_605464450.arc
-rw-r----- 1 oracle oinstall 475254784 Dec 25 22:05 1_64085_605464450.arc
-rw-r----- 1 oracle oinstall 46111744 Dec 25 22:06 1_64086_605464450.arc

In our case Current is 64087 and we have archive of 64086.

e)Start Recovering database

SQL> recover database using BACKUP CONTROLFILE until cancel;
ORA-00279: change 1149657417 generated at 12/25/2007 22:05:09 needed for thread 1
ORA-00289: suggestion : /u03/oradata/archivelogs/1_64086_605464450.arc
ORA-00280: change 1149657417 for thread 1 is in sequence #64086


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 1149658822 generated at 12/25/2007 22:06:37 needed for thread 1
ORA-00289: suggestion : /u03/oradata/archivelogs/1_64087_605464450.arc
ORA-00280: change 1149658822 for thread 1 is in sequence #64087
ORA-00278: log file '/u03/oradata/archivelogs/1_64086_605464450.arc' no longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/u14/oradata/origlogA-NEW/redo5.log =========== Supply the path of current redolog group
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;

Database altered.

SQL> archive log list.


F) Shutdown immediate and copy the controlfile from dbs to all 3 original locations, and then then startup.

G) Check for the temporary tablespace;

No comments: