| How to discover DBID having RMAN backup files [message #261514] |
Wed, 22 August 2007 21:44  |
mson77 Messages: 208 Registered: August 2007 Location: Brazil |
Senior Member |
|
|
Hello ALL,
I have the backup files from rman (oracle 10.2.0.1).
Unfortunately... these file names are not based on "dbid".
The target database and server are crashed (it is just an experience... just a test case).
Having only these backup files I want to recover the original database on a new server.
I was reading:
http://www.orafaq.com/forum/t/87129/0/#msg_num_4
and following the DreamzZ suggestion on link:
http://www.orafusion.com/art_rman3.htm
but in my case... I don't know the DBID of the original database and the backup files do not tell DBID on their file names.
How to discover DBID having backup files from rman?
Thanks,
mson77
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261586 is a reply to message #261514 ] |
Thu, 23 August 2007 01:41   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
Not an official way, more a hack.
Find your database name in the file.
The 4 bytes just before it is the dbid.
Take care of endian format.
Regards
Michel
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261670 is a reply to message #261514 ] |
Thu, 23 August 2007 05:28   |
cbruhn2 Messages: 41 Registered: January 2007 |
Member |
|
|
Hi there,
I found an interesting note on Metalink DOCID 372996.1 about restoring from rman.
As I read this note there should be a possibility to recover from "all loss" using an Internal note
| Quote: | b. Raise a Service Request with Oracle Support Services
Request assistance to extract the controlfile (and spfile if necessary) as per Internal Note 60545.1 How to Extract Controlfiles, Datafiles, and Archived Logs from RMAN Backupsets.
|
this is probably using some PL/SQL procedure.
Why Oracle hasn't made this note public beats me as I think, it would be very nice to be able to extract directly from rman backupsets.
best regards
Carl Bruhn
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261699 is a reply to message #261678 ] |
Thu, 23 August 2007 06:42   |
mson77 Messages: 208 Registered: August 2007 Location: Brazil |
Senior Member |
|
|
Hello ALL,
Thanks for YOUR attention.
Well... I don't have an old controlfile as "ebrian" pointed out.
I tried to run pl/sql script as "cbruhn2" but inside the pl/sql block this comment:
-- CFNAME must be the exact path and filename of a controlfile that was backed-up
DBMS_BACKUP_RESTORE.restoreControlFileTo(cfname=>'/app/oracle/oradata/orcl/control01.ctl');
and I don't have the EXACT PATH as that backed up.
My OS is Win2003 and the target database was on drive "E:" and now I have only "C:" drive.
Unfortunately I don't have access to oracle metalink.
Now regarding Michel Cadot note:
| Michel Cadot | Find your database name in the file.
The 4 bytes just before it is the dbid.
Take care of endian format.
|
I have opened one of this backup set file with an editor and have no idea of how to hack DBID... I didn't find any 10 decimal digit block that may describe an DBID. I opened via wordpad. The second and the last backup set file is too large and no editor open it. Any suggestion of editor to open this quite 2GB in size file?
Thank you.
mson77
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261710 is a reply to message #261699 ] |
Thu, 23 August 2007 07:07   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
As you are on Windows, you only need the 5 first KB.
The database name is at address (about) 0x1020.
DBID is not 10 decimal digits but 4 bytes (a word).
So address is 0x101C-0x101F.
With bytes swapping (little endianess) if you dump these bytes in hexadecimal and see: AABBCCDD then dbid is 0xDDCCBBAA.
Regards
Michel
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261740 is a reply to message #261710 ] |
Thu, 23 August 2007 08:30   |
mson77 Messages: 208 Registered: August 2007 Location: Brazil |
Senior Member |
|
|
Hello Michel,
LOL...
YOU are the hacker!!!!
Simply the best!
I took the 4bytes at the address you said (hexa value)... and converted to decimal value... and used this decimal value as below:
RMAN> set dbid 1234567890
RMAN> startup nomount
RMAN> here I have to recover the spfile/controlfile from backupset
... and voila!
Now I will try to recover the database (this is my next step).
Thank you very much!
Regards,
mson77
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #261800 is a reply to message #261775 ] |
Thu, 23 August 2007 11:23   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
Take care, the addresses depend on your OS and file system type but the method is the same:
- find database name
- dbid is just before.
Take also care of endianness of your platform.
Regards
Michel
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #283701 is a reply to message #283674 ] |
Wed, 28 November 2007 00:29   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
I never dumped a backupset, I even don't know if dbid is in the file (I think so).
You have to dump your file (in hexa) and decrypt it.
In your post I see "ARJU" in the head. Search in the bytes around it. It is likely the 4 squares (bytes) after it but only you can know it.
Regards
Michel
|
|
|
| Re: How to discover DBID having RMAN backup files [message #290827 is a reply to message #283701 ] |
Tue, 01 January 2008 03:18   |
hrishy Messages: 16 Registered: August 2005 |
Junior Member |
|
|
Hi Michel
How do you go about
dump your file (in hex) and decrypt it
By file above you mean backupset ?
regards
Hrishy
|
|
|
| Re: How to discover DBID having RMAN backup files [message #290828 is a reply to message #290827 ] |
Tue, 01 January 2008 03:29   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
I meant backup piece, physical backup file.
Regards
Michel
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #318509 is a reply to message #318452 ] |
Wed, 07 May 2008 01:16   |
Michel Cadot Messages: 16994 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
If I understand if we do:
strings <backupset file> | grep 'MAXVALUE,'
and the value just before MAXVALUE is the DBID.
Is this that?
Regards
Michel
[Updated on: Wed, 07 May 2008 01:17]
|
|
|
|
| Re: How to discover DBID having RMAN backup files [message #318616 is a reply to message #318452 ] |
Wed, 07 May 2008 05:49  |
 |
ebrian Messages: 2002 Registered: April 2006 |
Senior Member |
|
|
|
Major limitation is this doesn't hold true for compressed backupsets.
|
|
|