If the Oracle database is open, you can restore and recover a tablespace by first placing the tablespace offline.
To recover a tablespace or data file
ALTER TABLESPACE "tablespace_name" OFFLINE;
Note: The Oracle server may take the damaged tablespace offline automatically. If that is the case, go to Step 2.
RECOVER TABLESPACE "tablespace_name";
RECOVER DATAFILE 'path';
For example,
RECOVER DATAFILE 'T\Oracle\Oradata\Orcl\Backup.Ora';
Oracle checks for the archive redo log files it needs to apply and prompts for the names of these archive redo log files in chronological order.
For example, when Oracle needs the name of the archive redo log file with a sequence number of 49, it displays the following message:
ORA-00279: Change 10727 generated at 09/15/95 16:33:17 needed for thread 1 ORA-00289: Suggestion : D:\ORANT|saparch\ARC00049.001 ORA-00200: Change 10727 for thread 1 is in sequence #49 Specify log<<RET>=suggested : filename : AUTO : FROM logsource : CANCEL
Applying suggested logfile... Log applied.
After each log is applied, Oracle continues to apply the next redo log file until the recovery is complete.
Note: If Oracle returns an error indicating that the log file cannot be opened, the log file may not be available. At the prompt, enter CANCEL. This command stops the complete media recovery. In this case, perform the incomplete media recovery to restore the tablespace again. After all the log files are applied, database recovery is complete. For more information about incomplete media recovery, see the Oracle Server Administrator's Guide.
ALTER TABLESPACE “tablespace_name” ONLINE;
The tablespace is now recovered to the last available log file.
Note: For the most reliable database objects recovery, you should back up archived log files using the ~ARCHIVELOG object. For more information on database recovery, see the Oracle documentation.
Copyright © 2016 |
|