niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Server
Can I restore tablespaces(datafiles) to a new blank database?
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
Joel Garry
*nix forums Guru


Joined: 24 Mar 2005
Posts: 1044

PostPosted: Thu Jul 20, 2006 10:11 pm    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

Sybrand Bakker wrote:
Quote:
On Wed, 19 Jul 2006 20:00:33 GMT, TG <spam@spam.com> wrote:

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.

But see Note:227060.1 anyways for a couple of ideas on how to get the
dbid. Don't think NID will fix the problem (see Note:224266.1), but
good luck.

jg
--
@home.com is bogus.
http://www.signonsandiego.com/uniontrib/20060720/news_1b20prgn.html
Back to top
kvmb
*nix forums beginner


Joined: 20 Jul 2006
Posts: 2

PostPosted: Thu Jul 20, 2006 9:59 pm    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

You might want to look into DUL or a DUL-like tool ...

cheers,
Kurt

"TG" <spam@spam.com> wrote in message news:s67vg.114393$A8.54485@clgrps12...
Quote:
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.




Back to top
Sybrand Bakker
*nix forums Guru


Joined: 03 Apr 2005
Posts: 1766

PostPosted: Wed Jul 19, 2006 9:24 pm    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

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

Quote:
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
Back to top
kony
*nix forums beginner


Joined: 19 May 2005
Posts: 46

PostPosted: Wed Jul 19, 2006 8:04 pm    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

Chuck Whealton wrote:
Quote:
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.


TG:

I believe the DBID is written everywhere - controlfiles, datafiles,
possibly redos, etc. There's an NID (new ID) utility in 9i that you
can use to change the DBID. It also works with 8i. I don't
know/remember what, if any, additional functionalitty it might have
that could help you either set a specific DBID, or somehow change them
all to be identical.

I have to say, I'd be leary of doing what you're trying to do - though
I certainly understand why!

It sounds like you had something backed up. You were able to recover
most, though not all of the datafiles?

Although it is considered a "not to be done" thing, I have seen a
database backed up live via Legato NetWorker withOUT the Oracle
BusinessSuite Module restored, opened and recovered and it worked. I
was shocked. That was a couple years back.

Charles R. Whealton
Charles Whealton @ pleasedontspam.com


thanks

The dbid change *might* work, but I have to find out what the dbid of
the old datafiles is. Anyway,its worth a try.
Back to top
kony
*nix forums beginner


Joined: 19 May 2005
Posts: 46

PostPosted: Wed Jul 19, 2006 8:00 pm    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

steph wrote:
Quote:
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)
Back to top
steph
*nix forums beginner


Joined: 28 Mar 2006
Posts: 27

PostPosted: Wed Jul 19, 2006 7:43 am    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

TG wrote:
Quote:
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
Back to top
Chuck Whealton
*nix forums beginner


Joined: 16 Jul 2006
Posts: 10

PostPosted: Wed Jul 19, 2006 1:39 am    Post subject: Re: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

TG wrote:
Quote:
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.

TG:

I believe the DBID is written everywhere - controlfiles, datafiles,
possibly redos, etc. There's an NID (new ID) utility in 9i that you
can use to change the DBID. It also works with 8i. I don't
know/remember what, if any, additional functionalitty it might have
that could help you either set a specific DBID, or somehow change them
all to be identical.

I have to say, I'd be leary of doing what you're trying to do - though
I certainly understand why!

It sounds like you had something backed up. You were able to recover
most, though not all of the datafiles?

Although it is considered a "not to be done" thing, I have seen a
database backed up live via Legato NetWorker withOUT the Oracle
BusinessSuite Module restored, opened and recovered and it worked. I
was shocked. That was a couple years back.

Charles R. Whealton
Charles Whealton @ pleasedontspam.com
Back to top
kony
*nix forums beginner


Joined: 19 May 2005
Posts: 46

PostPosted: Tue Jul 18, 2006 3:28 pm    Post subject: Can I restore tablespaces(datafiles) to a new blank database? Reply with quote

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.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 6:16 pm | All times are GMT
navigation Forum index » Databases » Oracle » Server
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Move Oracle 10g database to another location Selt Server 0 Fri Jul 21, 2006 2:14 pm
No new posts FAQ 4.32 How do I strip blank space from the beginning/en... PerlFAQ Server Perl 0 Fri Jul 21, 2006 1:03 pm
No new posts database Share Memory Limit (2 GB ) in a Instance is tota... sadanjan@gmail.com IBM DB2 0 Fri Jul 21, 2006 12:57 pm
No new posts A webserver (PHP 5) with a few database server (MySQL) ¥|¥J PHP 2 Fri Jul 21, 2006 1:43 am
No new posts database back up Joko Siswanto MySQL 3 Thu Jul 20, 2006 4:19 pm

Cheap Magazine | Free Advertising | Property for sale in Spain | MPAA | Magic The Gathering Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.4074s ][ Queries: 20 (0.2610s) ][ GZIP on - Debug on ]