My experience shows that you don’t have to know the DBID now for restoring contorlfile from backup. If I know the name of backup piece, that contains controlfile I can do the following scenario:
1 | [oracle@rico ~]$ ls /backup1/26042014/control_26042014.10.15.07p6mjbr_1_1 |
2 | /backup1/26042014/control_26042014.10.15.07p6mjbr_1_1 |
3 | [oracle@rico ~]$ rman target / |
4 | Recovery Manager: Release 11.2.0.3.0 - Production on Sat Apr 26 10:20:43 2014 |
5 | Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. |
6 | connected to target database: ORCL (not mounted) |
7 | RMAN>restore controlfile from '/backup1/26042014/control_26042014.10.15.07p6mjbr_1_1'; |
8 |
9 | Starting restore at 26-APR-14 |
10 | using target database control file instead of recovery catalog |
11 | allocated channel: ORA_DISK_1 |
12 | channel ORA_DISK_1: SID=63 device type=DISK |
13 | channel ORA_DISK_1: restoring control file |
14 | channel ORA_DISK_1: restore complete, elapsed time: 00:00:07 |
15 | output file name=+DATA/orcl/controlfile/current.260.845893267 |
16 | output file name=+DATA/orcl/controlfile/current.261.845893267 |
17 | Finished restore at 26-APR-14 |
18 | RMAN> alter database mount; |
19 |
20 | database mounted |
21 |
22 | released channel: ORA_DISK_1 |
If I don’t know the name of the backup piece and there is a lot of strangely named files in a directory I can use the following duplicate trick:
1 | [oracle@rico 26042014]$ rman auxiliary / |
2 | Recovery Manager: Release 11.2.0.3.0 - Production on Sat Apr 26 10:42:40 2014 |
3 | Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. |
4 | connected to auxiliary database: ORCL (not mounted) |
5 | RMAN>duplicate database to orcl backup location='/backup1/26042014'; |
6 |
7 | Starting Duplicate Db at 26-APR-14 |
8 |
9 | contents of Memory Script: |
10 | { |
11 | sql clone "alter system set control_files = |
12 | ''+DATA/orcl/controlfile/current.260.845894567'', ''+DATA/orcl/controlfile/current.261.845894567'' comment= |
13 | ''Set by RMAN'' scope=spfile"; |
14 | sql clone "alter system set db_name = |
15 | ''ORCL'' comment= |
16 | ''Modified by RMAN duplicate'' scope=spfile"; |
17 | sql clone "alter system set db_unique_name = |
18 | ''ORCL'' comment= |
19 | ''Modified by RMAN duplicate'' scope=spfile"; |
20 | shutdown clone immediate; |
21 | startup clone force nomount |
22 | restore clone primary controlfile from '/backup1/26042014/0ip6mk8d_1_1'; |
23 | alter clone database mount; |
24 | } |
25 | executing Memory Script |
So basically – you don’t have to know the DBID, to restore a database when the controlfile is lost when backup sets are located on disk.
Of course you will need the DBID to restore controlfile from autobackup – in such case you would like to get familiar with post written by Arup Nanda: http://arup.blogspot.com/2014/04/how-to-get-dbid-when-instance-in-in.html
Update:
Recently I was honored by Arup Nanda, who mentioned about my simple trick in his blog (thank you Arup!)
http://arup.blogspot.com/2014/04/restoring-controlfile-when-autobackup.html