100% found this document useful (1 vote)
93 views

Oracle Recover Database Without Control Files and Redo Log

The database crashed and the only files remaining were the data files and initialization file. All control files and redo log files were lost. To recover the database, control files were recreated using the details of the existing data files. The database was then started in nomount mode, the control files were created, the database was mounted and opened with the resetlogs option. This allowed the database to be recovered with minimal data loss, but any redo log data before the crash was lost. Lessons learned were to always multiplex control files and redo logs, and maintain consistent database backups.

Uploaded by

Mq Sfs
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
93 views

Oracle Recover Database Without Control Files and Redo Log

The database crashed and the only files remaining were the data files and initialization file. All control files and redo log files were lost. To recover the database, control files were recreated using the details of the existing data files. The database was then started in nomount mode, the control files were created, the database was mounted and opened with the resetlogs option. This allowed the database to be recovered with minimal data loss, but any redo log data before the crash was lost. Lessons learned were to always multiplex control files and redo logs, and maintain consistent database backups.

Uploaded by

Mq Sfs
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Recover database without control files and redo log files

January 11, 2008akpraveenLeave a commentGo to comments

Again there has been some gap in my writing of articles. Today I will share one of my experience faced recently. We came
to know that one of the databases crashed. After some investigation we found that we only had data files and initialization
file intact. All other files i.e. control files and redo log files were lost. This was a development database and the control files
and log files were not multiplexed (First mistake). With only data files, how would you recover a database with minimal
loss? We even did not have consistent backup for the database (Second mistake). After doing some research, we finally
decided to give a go to recover the database with available data files and initialization file.
The steps followed to recover the database:
Startup the database with the initialization file. As we do not have the control files, start the database in no mount state.

SQL> startup nomount


ORACLE instance started.
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
SQL>

209715200
1248140
75498612
130023424
2945024

bytes
bytes
bytes
bytes
bytes

Check the path of control files.

SQL> show parameter control


NAME
----------------------------------------------------------------control_file_record_keep_time
control_files
K:\ORCL10G\CONTROL\CONTROL01.C

TYPE
VALUE
----------integer
string

TL,
K:\ORCL10G\CONTROL\CONTROL
K:\ORCL10G\CONTROL\CON

02.CTL,
TROL03.CTL

Having the details of all the data files at hand recreate the control files.

SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL10G" RESETLOGS NOARCHIVELOG


MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'K:\ORCL10G\LOG\REDO01.LOG' SIZE 50M,
GROUP 2 'K:\ORCL10G\LOG\REDO02.LOG' SIZE 50M,

GROUP 3 'K:\ORCL10G\LOG\REDO03.LOG'
DATAFILE
'K:\ORCL10G\DATA\SYSTEM01.DBF',
'K:\ORCL10G\DATA\UNDOTBS01.DBF',
'K:\ORCL10G\DATA\SYSAUX01.DBF',
'K:\ORCL10G\DATA\USERS01.DBF',
'K:\ORCL10G\DATA\EXAMPLE01.DBF',
'K:\ORCL10G\DATA\UNDOTBS02.DBF'
CHARACTER SET WE8MSWIN1252;

SIZE 50M

Control file created.


Note the RESETLOGS option in the create control file script. This will reset the logs and synchronizes the SCN between the
database files, control files and redo log file. Oracle will re-create the redo log files when the database is opened with
resetlogs options.
Once the control file is created, try mounting the database. If the database mounts well then everything seems to be fine.

SQL> alter database mount;


Database altered.
The database mounted successfully. Open the database with resetlogs option.

SQL> alter database open resetlogs;


Database altered.
Here we go. The database opened successfully. The only point to consider is that of the data loss. The data in the redo log
files, as it existed before the loss, will be lost. Hence the data loss here could be minimum.
Conclusion :
1. Always multiplex the Control files and Redo log files.
2. Have a consistent backup of the database.

You might also like