Subscribe to Posts by Email

Subscriber Count

    701

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

RMAN-07518: Reason: Foreign database file DBID: 18023747 Database Name: TEST

Very recently I have encountered this issue while cataloging the backup pieces in order to sync the standby server.

Well this is all about that database DBID is different from the source (primary) database where you cannot/rman cannot see those backups relevant to this destination database. very obvious thing.

This db in the issue has been built long back and in sync, whilst I was doing a roll forward standby recovery and trying to catalog found this issue.

Now, how to change the DBID to the desired or the original one,

we all know NID (new id) utility can only do database name change and NID change, but we cannot retrospect or keep the DBID we want to.

But wait, there is a packages  ( I believe this package is there since 9i) called dbms_backup_restore

Note : If you do not have this package you can run this{ORACLE_HOME}/rdbms/admin/dbmsbkrs.sql

which has following procedures (there’s lot of interesting stuff with this package) of interest for this issue. 

 

  • dbms_backup_restore.nidbegin
  • dbms_backup_restore.nidprocesscf
  • dbms_backup_restore.nidprocessdf
  • dbms_backup_restore.nidend;

Steps:-

1) Open database in readonly

2) Use the script below or use your own to change your ID

a) You should start with nidbegin

b) Change the controlfile first using dbms_backup_restore.nidprocesscf

c) change the datafiles using dbms_backup_restore.nidprocessdf , one by one or using a for loop to v$datafile

d) change the tempfiles using dbms_backup_restore.nidprocesscf, one by one or using a for loop to v$tempfile

e) End with dbms_backup_restore.nidbegin

 

May be undocumented usage of this package , please have proper backup before perform this activity

 

References:- http://psoug.org/reference/dbms_backup_restore.html

Simple Script:- http://www.pythian.com/news/1491/how-to-choose-your-oracle-database-id-dbid/

-Thanks

Geek DBA

Comments are closed.