Sunday 22 September 2013

you have shutdown database .Someone came and deleted controlfile.

you have shutdown database .Someone came and deleted controlfile. When you start the database you got the error saying controlfile missing. Now what you will do?

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
[dbvision@apps data]$ rm /db/vision/db/apps_st/data/cntrl01.dbf
[dbvision@apps data]$

SQL> startup
ORACLE instance started.
Total System Global Area 1071333376 bytes
Fixed Size                  1318172 bytes
Variable Size             440402660 bytes
Database Buffers          616562688 bytes
Redo Buffers               13049856 bytes
ORA-00205: error in identifying control file, check alert log for more info.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[dbvision@apps data]$ pwd
/db/vision/db/apps_st/data


Go to alert logfile and find which controlfile is missing.
=========================================================
[dbvision@apps data]$ adrci

ADRCI: Release 11.1.0.7.0 - Production on Sun Sep 22 01:13:42 2013

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

ADR base = "/db/vision/db/tech_st/11.1.0/admin/vision_apps"
adrci> show home
ADR Homes:
diag/rdbms/vision/vision
adrci> exit
[dbvision@apps data]$ cd "/db/vision/db/tech_st/11.1.0/admin/vision_apps"
[dbvision@apps vision_apps]$ cd diag/rdbms/vision/vision
[dbvision@apps vision]$ cd trace
[dbvision@apps trace]$ pwd
/db/vision/db/tech_st/11.1.0/admin/vision_apps/diag/rdbms/vision/vision/trace
[dbvision@apps trace]$ ls -tlrh alert*.log
-rw-r--r-- 1 dbvision dba 623K Sep 22 01:13 alert_vision.log
[dbvision@apps trace]$


alert logfile
============

ALTER DATABASE   MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/db/vision/db/apps_st/data/cntrl01.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-205 signalled during: ALTER DATABASE   MOUNT...
Sun Sep 22 01:13:28 2013
Checker run found 1 new persistent data failures


if you have backup of the controlfile just copy it.Incase if you lost all you have may have multiplex of the controlfile in some other disk
just restore it.

[dbvision@apps data]$ cp -r cntrl02.dbf cntrl01.dbf
[dbvision@apps data]$


SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size                  1318172 bytes
Variable Size             440402660 bytes
Database Buffers          616562688 bytes
Redo Buffers               13049856 bytes
Database mounted.
SQL> alter database open;

Database altered.

SQL>


No comments:

Post a Comment