Lesson 2 | Recovering a lost Datafile with no Backup |
Objective | Demonstrate how to recover a Lost Datafile with no backup |
ALTER DATABASE CREATE DATAFILE <name stored in controlfile>
AS <name of replacement file>
Note that the size is not specified--this information is taken from the control file. The CREATE
command produces an empty datafile of the appropriate size, which can then be recovered from the archive logs. C:\ORANT> SET ORACLE_SID=ORCL C:\ORANT> SVRMGR30 Oracle Server Manager Release 3.0.5.0.0 - Production (c) Copyright 2007, Oracle Corporation. All Rights Reserved. Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production With the Partitioning and Objects options PL/SQL Release 8.0.5.1.0 - Production SVRMGR> CONNECT INTERNAL Password: Connected. SVRMGR> STARTUP MOUNT ORACLE instance started. Total System Global Area 11710464 bytes Fixed Size 49152 bytes Variable Size 11177984 bytes Database Buffers 409600 bytes Redo Buffers 73728 bytes Database mounted. SVRMGR> ALTER DATABASE DATAFILE 'C:\ORANT\DATABASE\STUDENT.ORA' OFFLINE; Statement processed. SVRMGR> ALTER DATABASE OPEN; Statement processed. SVRMGR> SELECT * FROM V$RECOVER_FILE; FILE# ONLINE ERROR CHANGE# TIME ----- ------- ------------------ ------- --------- 5 OFFLINE FILE NOT FOUND 0 1 row selected. SVRMGR> ALTER DATABASE CREATE DATAFILE 'C:\ORANT\DATABASE\STUDENT.ORA' AS 'D:\NEW_LOCATION\DATABASE\STUDENT.ORA'; Statement processed. SVRMGR> SELECT * FROM V$RECOVER_FILE; FILE# ONLINE ERROR CHANGE# TIME ----- ------- ------------------ -------- ------------ 5 OFFLINE 5621029 11-JAN-2000 1 row selected. SVRMGR> RECOVER DATAFILE 'D:\NEW_LOCATION\DATABASE\STUDENT.ORA' UNTIL TIME '2000-01-18:12:00:00'; ORA-00279: change 5621029 generated at 01/11/00 16:03:17 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC442.1 ORA-00280: change 5621029 for thread 1 is in sequence #442 Specify log: { <RET>=suggested | filename | AUTO | CANCEL} auto Log applied. ORA-00279: change 5641036 generated at 01/12/00 11:45:17 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC443.1 ORA-00280: change 5641036 for thread 1 is in sequence #443 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC442.1' no longer needed for this recovery Log applied. ORA-00279: change 5661054 generated at 01/12/00 19:31:49 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC444.1 ORA-00280: change 5661054 for thread 1 is in sequence #444 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC443.1' no longer needed for this recovery Log applied. ORA-00279: change 5681062 generated at 01/13/00 19:24:40 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC445.1 ORA-00280: change 5681062 for thread 1 is in sequence #445 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC444.1' no longer needed for this recovery Log applied. ORA-00279: change 5701070 generated at 01/17/00 10:46:41 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC446.1 ORA-00280: change 5701070 for thread 1 is in sequence #446 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC445.1' no longer needed for this recovery Log applied. ORA-00279: change 5721078 generated at 01/17/00 12:26:16 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC447.1 ORA-00280: change 5721078 for thread 1 is in sequence #447 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC446.1' no longer needed for this recovery Log applied. ORA-00279: change 5741086 generated at 01/18/00 11:04:32 needed for thread 1 ORA-00289: suggestion : C:\ORANT\RDBMS80\ARC448.1 ORA-00280: change 5741086 for thread 1 is in sequence #448 ORA-00278: log file 'C:\ORANT\RDBMS80\ARC447.1' no longer needed for this recovery Log applied. Media recovery complete. SVRMGR> ALTER DATABASE DATAFILE 'D:\NEW_LOCATION\DATABASE\STUDENT.ORA' ONLINE; Statement processed. SVRMGR>