Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can I restore tablespaces(datafiles) to a new blank database?

Re: Can I restore tablespaces(datafiles) to a new blank database?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 19 Jul 2006 23:24:01 +0200
Message-ID: <qm8tb2tivcssbo97rljkulo7o6flf48ihi@4ax.com>


On Wed, 19 Jul 2006 20:00:33 GMT, TG <spam_at_spam.com> wrote:

>steph wrote:
>> TG wrote:
>>
>>>9.2.0.6 on Windows server
>>>
>>>Here is the situation:
>>>
>>>Junior dba wanted to free up some space on a server, so he deleted
>>>datafiles from a shut down database that he *thought* was his test, not
>>>his active development database, of course it turns out he deleted the
>>>wrong set of files and this database was (inexplicably) not backed up.
>>>
>>>I go in with a file recovery tool, recover most of the datafiles, and
>>>more importantly, recover the ones that have the critical info that can
>>>save a long & costly rebuild of the dev db.
>>>
>>>I create a new blank database on another machine, then I thought I could
>>>rebuild the controlfile with the recovered datafiles from the deleted
>>>database added. When I created the new database I created it with a
>>>slightly different name, no problem I think, thinking I could use "set
>>>database" and alter the init.ora and call it the same as the deleted
>>>database, so I do the following:
>>>
>>>backup control file to trace in new database, shut it down, edit the
>>>init.ora with new (old) name, startup nomount and try to recreate the
>>>control file with "set database "newname" resetlogs" and the datafiles
>>>from the deleted database added at the end of the create controlfile
>>>script. The new database is being set to the same name as the deleted
>>>one, but I am getting "ORA-01159: file is not from same database as
>>>previous files - wrong database id" errors from the added file(s)
>>>
>>>I missed something here, do I need to recreate the new database from
>>>scratch with the same name as the deleted one? Is it possible to do what
>>>I am attempting? I thought it should be, and this is the only option I
>>>have in any case.
>>
>>
>> Hi,
>>
>> I think you have to use the same name. Recently I have done something
>> similar and created a 'test'-database using the datafiles I've copied
>> from production - nice lesson to learn. These 2 articels of metalink
>> might help:
>> 174226.1
>> 224274.1
>>
>> regards,
>> stephan
>>
>
>thanks
>
>If I was able to recover the system tablespace I could have done that,
>but unfortunatly that was not recoverable. I'll have to see if I can get
>the dbid from the old datafiles and change the dbid of the new one to
>match (with fingers crossed)

You can't, at least not using a supported method.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Jul 19 2006 - 16:24:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US