Thanks for the post, Bob.
Here are the givens in your situation:
1) You have a corrupted "...example.dbf" file.
2) Oracle thinks that it needs that file to startup the database.
3) Since Oracle (and you) don't need that file, we want to just get rid of it.
4) One way to get rid of the file is by following my SQL code scenario, above.
5) The above code scenario depends upon being in ARCHIVELOG mode.
6) We cannot get into ARCHIVELOG mode because Oracle says that the database first needs recovery.
7) If we attempt a recovery of the database under the current situation, we need:
a) a pristine backup copy of the "...example.dbf" datafile.
b) a complete set of on-line and archived redo log files that pre-date your backup copy of "example.dbf".
8) Since your database is not in ARCHIVELOG mode, that means that your backup copy of "example.dbf" must be more recent than your oldest on-line redo log file. (If this is the case, then please advise me with a reply to this post. If this is not the case, then proceed to item 9.)
9) If the stars are not aligned for you to do a RECOVER DATABASE as outlined in item 8, above, then you must re-create your database control files. Proceed to the explanation of "How to Re-created Database Control Files," also known as "The
Other Method for Getting Rid of '...example.dbf'."
How to Re-created Database Control Files:
-----------------------------------------
1) From the SQL*Plus prompt, determine the User-Dump Destination for your database:
Code:
select value from v$parameter where name = 'user_dump_dest';
2) Generate a text file that contains the SQL commands to reconstruct your control files. From the SQL*Plus prompt (with the database at least at MOUNT state):
Code:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
3) Edit the resulting SQL text file.
a) Using your favourite text editor, open the most recently generated trace file (".trc") in the directory you identified in Step 1.
b) Locate the line that begins, "STARTUP NOMOUNT", followed by the command, "CREATE CONTROLFILE REUSE...".
c) Remove all lines prior to "STARTUP NOMOUNT".
d) Most importantly,
remove the line of code under the "DATAFILE" section that specifies the "...example.dbf" file.
e) Save the file As "RecreateControlFiles.sql", in your favourite SQL scripts path.
4) From the SQL*Prompt:
Code:
SQL> SHUTDOWN ABORT
SQL> @<scripts-path>\RecreateControlFiles
5) Once this script runs successfully, your database should be intact. You can confirm this by doing the follwoing:
Code:
SQL> shutdown immediate
SQL> startup
If any of this results in problems (or questions), repost here.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
Do you use
Oracle and live or work in
Utah, USA?
Then click here to join
Utah Oracle Users Group on Tek-Tips.