Home » RDBMS Server » Backup & Recovery » How to discover DBID having RMAN backup files
How to discover DBID having RMAN backup files [message #261514] Wed, 22 August 2007 21:44 Go to next message
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 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 #261640 is a reply to message #261514] Thu, 23 August 2007 03:29 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If you have an old controlfile still available, you can actual MOUNT the database and query V$DATABASE for the DBID and then shutdown the database to start your recovery process.
Re: How to discover DBID having RMAN backup files [message #261670 is a reply to message #261514] Thu, 23 August 2007 05:28 Go to previous messageGo to next message
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 #261678 is a reply to message #261514] Thu, 23 August 2007 05:38 Go to previous messageGo to next message
cbruhn2
Messages: 41
Registered: January 2007
Member
Hi There,

just found this on Orafaq Laughing
http://orafaq.com/faq/can_one_restore_rman_backups_without_a_controlfile_and_recovery_catalog

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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 Go to previous messageGo to next message
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 #261775 is a reply to message #261710] Thu, 23 August 2007 10:06 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Michel Cadot wrote on Thu, 23 August 2007 08:07
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.

This is good to know. That may come in handy some day!!

Thanks.
Re: How to discover DBID having RMAN backup files [message #261800 is a reply to message #261775] Thu, 23 August 2007 11:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 #283674 is a reply to message #261514] Tue, 27 November 2007 23:02 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

I am on UNIX. I have the backupset, I opened it with head and the contents is as below.How can I find DBID.db_name is arju.

head /oradata2/arju/02j241o2_1_1
ARJU����  ���$▒L@tNi�*"
�  �om�ys�B�    bj�aud�t_o�ts
�   �her� AL�!=�-/"��▒��2A����(��2H� ��',����N����|�h      ����������2H�7�3��}
                                                                                           8,`T�|

�       L       "�1      p       x|������ -u��7���S��3    �        �        �       &
�
�
�
E
 R
  �


   W
    �
     �
�,�����:  �2
            X�RE
�)�*����
Re: How to discover DBID having RMAN backup files [message #283701 is a reply to message #283674] Wed, 28 November 2007 00:29 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 Go to previous messageGo to next message
hrishy
Messages: 25
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 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
I meant backup piece, physical backup file.

Regards
Michel
Re: How to discover DBID having RMAN backup files [message #318452 is a reply to message #261514] Tue, 06 May 2008 21:38 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

I don't know whether you know it or not. But in unix after some experiment I got an way to discover DBID if I have any system/sysaux/undo datafile. I demonstrate it with an example in

http://arjudba.blogspot.com/2008/05/how-to-discover-find-dbid.html

Section D).
Re: How to discover DBID having RMAN backup files [message #318509 is a reply to message #318452] Wed, 07 May 2008 01:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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]

Report message to a moderator

Re: How to discover DBID having RMAN backup files [message #318516 is a reply to message #261514] Wed, 07 May 2008 01:34 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Yes Michel.
Re: How to discover DBID having RMAN backup files [message #318616 is a reply to message #318452] Wed, 07 May 2008 05:49 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Major limitation is this doesn't hold true for compressed backupsets.
Previous Topic: point-in-time-recovery question
Next Topic: error in tns connection
Goto Forum:
  


Current Time: Tue Nov 26 06:55:04 CST 2024