Backuprec
Backuprec
If your script file containing the control file creation statement is "CR.SQL"
Then just do the following.
STEP 1: Start sqlplus
STEP 2: connect / as sysdba
STEP 3: Start and do not mount a database like this.
SQL> STARTUP NOMOUNT
STEP 4: Run the "CR.SQL" script file.
STEP 5: Mount and Open the database.
SQL> alter database mount;
SQL> alter database open;
If you do not have a backup of Control file creation statement. Then you have to
manually give the CREATE CONTROL FILE statement. You have to write the file
names and sizes of all the datafiles. You will lose any datafiles which you do not
include.
Refer to "Managing Control File" topic for the CREATE CONTROL FILE statement.
Recovering Database when the database is running in
ARCHIVELOG Mode
Recovering from the lost of Damaged Datafile
If you have lost one datafile. Then follow the steps shown below.
STEP 1. Shutdown the Database if it is running.
STEP 2. Restore the datafile from most recent backup.
STEP 3. Then Start sqlplus and connect as SYSDBA.
$ sqlplus
Enter User:/ as sysdba
SQL> Startup mount;
SQL> Set autorecovery on;
SQL> alter database recover;
If all archive log files are available then recovery should go on smoothly. After you get
the "Media Recovery Completely" statement. Go on to next step.
STEP 4. Now open the database
SQL>alter database open;
Recovering from the Lost Archived Files:
If you have lost the archived files. Then Immediately shutdown the database and take a
full offline backup.
Time Based Recovery (INCOMPLETE RECOVERY)
Suppose a user has a dropped a crucial table accidentally and you have to recover the
dropped table.
You have taken a full backup of the database on Monday 13-Aug-2007 and the table
was created on Tuesday 14-Aug-2007 and thousands of rows were inserted into it.
Some user accidently drop the table on Thursday 16-Aug-2007 and nobody notice this
until Saturday.
Now to recover the table follow these steps.
STEP 1. Shutdown the database and take a full offline backup.
STEP 2. Restore all the datafiles, logfiles and control file from the full offline backup
which was taken on Monday.
STEP 3. Start SQLPLUS and start and mount the database.
STEP 4. Then give the following command to recover database until specified time.
SQL> recover database until time '2007:08:16:13:55:00' using
backup controlfile;
STEP 5. Open the database and reset the logs. Because you have performed a
Incomplete Recovery, like this
SQL> alter database open resetlogs;
STEP 6. After database is open. Export the table to a dump file using Export Utility.
STEP 7. Restore from the full database backup which you have taken on Saturday.
STEP 8. Open the database and Import the table.
Note: In Oracle 10g / 11g you can easily recover drop tables by using Flashback
feature. For further information please refer to Flashback Features Topic in this book.