Option 1: When you don’t have a backup.
If you have lost one datafile and if you don't have any backup and if the datafile does not contain important objects then, you can drop the damaged datafile and open the database. You will loose all information contained in the damaged datafile.
The following are the steps to drop a damaged datafile and open the database.
(UNIX)
STEP 1: First take full backup of database for safety.
STEP 2: Start the sqlplus and give the following commands.
$sqlplus
Enter User:/ as sysdba
SQL> STARTUP MOUNT
SQL> ALTER DATABASE DATAFILE '/u01/ica /usr1.dbf ' offline drop;
SQL>alter database open;
Option 2: When you have the Backup.
If the database is running in Noarchivelog mode and if you have a full backup. Then there are two options for you.
1. Either you can drop the damaged datafile, if it does not contain important information which you can afford to loose.
2 . Or you can restore from full cold backup. You will loose all the changes made to the database since last full backup.
STEP 1: Take a full backup of current database.
STEP 2: Restore from full database backup i.e. copy all the files from backup to their original locations.
(UNIX)
Suppose the backup is in "/u2/oracle/backup" directory. Then do the following.
sqlplus>Shutdown Abort
$cp /u02/backup/* /u01/ica
Note: This will copy all the files from backup directory to original destination. Also remember to copy the control files and redologfiles to all the mirrored locations.
sqlplus> startup
No comments:
Post a Comment