?
Solved

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

Posted on 2011-10-28
18
Medium Priority
?
468 Views
Last Modified: 2012-05-12
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"
0
Comment
Question by:tindavid
  • 7
  • 5
  • 5
17 Comments
 

Author Comment

by:tindavid
ID: 37048599
Using logminer is not an option too
0
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 37048604
I believe you can only get this information from a mounted database.  Possible only an 'open' database.

The format of data/control files are proprietary.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37048651
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.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 74

Expert Comment

by:sdstuber
ID: 37048668
oops, typo  and I was off by one anyway actually it was at 0x04021  and null 0x00  terminated
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37048685
I just check AIX  -  offset much closer to begining of file  0x0016
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37048688
name only?  What about the rest?  log sequence, id, ???
0
 

Author Comment

by:tindavid
ID: 37048706
Is this hex editor a Unix utility ?  Can it be run in command-line mode too ?
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37048709
I used vi, then put it in hex mode

:%!xxd
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37048719
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.
0
 

Author Comment

by:tindavid
ID: 37054788
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.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37056376
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.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37056427
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...
0
 

Assisted Solution

by:tindavid
tindavid earned 0 total points
ID: 37092267
OK, I guess there is no simple answer to my dump question,  I will use the my convention method:

1) mount the DB image using the backup controlfile (binary) after changing the DB_NAME in the INIT to the same DB_NAME from the backup controlfile

2) Access all the v$ views such as V4log to find out what is the first logseq for the recovery
    Access the v$datafile to find out DB filename in the original controlfile
3) use alter database dump logfile '{last logfile available on the disk}' to trace and then check the trace file to see if the last archive log does have the correct timestamp to rollforward the DB to.

Initial I was thinking that with a simple dump of controlfile I can obtain everything I need without doing those fake starup using original controlfile.

I will close this thread, thank you all for your comment.
0
 

Author Comment

by:tindavid
ID: 37092292
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
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37092293
to close the question, select one or more of the answers that helped

not your own
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 37093438
>>>Since no one gave me a simple answer to the question


That's because there is no "simple" answer.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37093586
>>Since no one gave me a simple answer to the question

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

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question