Link to home
Start Free TrialLog in
Avatar of tindavid
tindavid

asked on

Any Unix command or Tools to read the content/file header of Oracle Archivelog or Controlfile

I need to check the information from above files to determinate the information of DB_ID, DB_NAME, log sequences etc

Using "alter system dump ..." is not an option. Rason is if I have collected a backup copies of DB image image I want to know the DB info asap (without going back to customer's online DB to find out"
Avatar of tindavid
tindavid

ASKER

Using logminer is not an option too
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
open the control file in a hex editor  go to offset 0x0420  you should find the name there

I just checked with a windows and linux control file,  both had name in same place.
oops, typo  and I was off by one anyway actually it was at 0x04021  and null 0x00  terminated
I just check AIX  -  offset much closer to begining of file  0x0016
name only?  What about the rest?  log sequence, id, ???
Is this hex editor a Unix utility ?  Can it be run in command-line mode too ?
I used vi, then put it in hex mode

:%!xxd
This info should not be relied on.  Oracle's data files are proprietary and binary.  Anything that works 'today' will likely not work tomorrow.

Again, this will only get you the name.

Why are you needing this information where you cannot go back to the 'owners' of the original database?

If you want/need to change the db name/id, then you can do that w/o hacking binary files.
I have a script to do DB recover, I want it be a bit more generic, so that before the recovery starts, I want to know what DB name, and what is the very first
archivelog required before the recovery begins.
since location can vary by database and platform, I suggest you try looking at V$CONTROLFILE_RECORD_SECTION
on the live system to try to determine where in the files you need to look.
Several jobs ago my team and I created configuration capture scripts.  The main purpose was to see if developers/anyone 'changed' anything on the machine w/o a change control record.

The side benefit was we had the machine configuration every night (and archived for many days).

Maybe you can capture this information nightly in a 'secure' backup location and have your recovery scripts access them.

That would probably be safer than looking through proprietary/binary files to make what amounts to a 'guess'.

Imagine what happens if a patch moves the dbname by two bytes and you 'automate' a recovery...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've requested that this question be closed as follows:

Accepted answer: 0 points for tindavid's comment http:/Q_27421483.html#37092267

for the following reason:

One of the sample answers
to close the question, select one or more of the answers that helped

not your own
>>>Since no one gave me a simple answer to the question


That's because there is no "simple" answer.
>>Since no one gave me a simple answer to the question

To add to what is above:
https://www.experts-exchange.com/help.jsp#hs=29&hi=405

The correct answer to some questions is "You can't do that."