SOLVED

RMAN-20002: Target Database Already Registered In Recovery Catalog

Asked by OracleDba10 viewsoracle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
RMAN-20002: Target Database Already Registered In Recovery Catalog

PROBLEM:

While registering database to rman catalog, getting below error.

RMAN> register database;

RMAN-00571: ================================================

RMAN-00569: ========== ERROR MESSAGE STACK FOLLOWS ==========

RMAN-00571: ================================================

RMAN-03009: failure of register command on default channel at 12/08/2023 13:03:21

RMAN-20002: target database already registered in recovery catalog
#oracle#error

Solutions(1)

Accepted Solution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
Check dbid of the database.

SQL> select dbid from v$database;

DBID

----------

2017723764

2. Connect to catalog and check whether same db is present or not

sqlplus catalog_user/rman@catdb

SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 12 13:50:57 2023

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select DB_KEY,DBID,NAME from rc_database where dbid=2023723764;

DB_KEY DBID NAME

---------- ---------- --------

29531 2023723764 CONTEST

We can see another database CONTEST is already present in the catalog with the same dbid.  so adding new database to catalog with same DBid is failing.

So fix it, we have two options now.

OPTION – 1: ( UNREGISTER EXISTING DBID ENTRY).

If the database, for which same dbid exists in the catalog repository, it not in use , then we can remove the entry and try to register.

sqlplus catalog_user/rman@catdb

SQL> select DB_KEY,DBID,NAME from rc_database where dbid=2023723764;

DB_KEY DBID NAME

---------- ---------- --------

29531 2023723764 CONTEST

SQL> EXECUTE dbms_rcvcat.unregisterdatabase(29531, 2023723764);

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

OPTION 2 (CHANGE THE DBID of the database) :

Use nid utility to change the dbid and try to register.

START DATABASE IN MOUNT STAGE :

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area 1.1107E+10 bytes

Fixed Size 7644464 bytes

Variable Size 9294584528 bytes

Database Buffers 1711276032 bytes

Redo Buffers 93011968 bytes

Database mounted.

NID TOOL TO CHANGE DBID:

nid target=sys/oracle@DBATEST

DBNEWID: Release 12.1.0.2.0 - Production on Sun Feb 12 14:03:42 2023

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to database DBATEST (DBID=2023723764)

Connected to server version 12.1.0

Control Files in database:

/archive/NONPLUG/NONCDB/control01.ctl

/archive/NONPLUG/NONCDB/control02.ctl

Change database ID of database NONCDB? (Y/[N]) => Y

Proceeding with operation

Changing database ID from 1742085976 to 1753637695

Control File /archive/NONPLUG/NONCDB/control01.ctl - modified

Control File /archive/NONPLUG/NONCDB/control02.ctl - modified

Datafile /archive/NONPLUG/NONCDB/system01.db - dbid changed

Datafile /archive/NONPLUG/NONCDB/sysaux01.db - dbid changed

Datafile /archive/NONPLUG/NONCDB/NONCDB/datafile/o1_mf_prim_d9v1bqq3_.db - dbid changed

Datafile /archive/NONPLUG/NONCDB/PLUG/prim01.db - dbid changed

Datafile /archive/NONPLUG/NONCDB/NONCDB/datafile/o1_mf_prim_d9v1fq7k_.db - dbid changed

Datafile /archive/NONPLUG/NONCDB/PLUG/undo_new01.db - dbid changed

Control File /archive/NONPLUG/NONCDB/control01.ctl - dbid changed

Control File /archive/NONPLUG/NONCDB/control02.ctl - dbid changed

Instance shut down

Database ID for database DBATEST changed to 1753637695.

All previous backups and archived redo logs for this database are unusable.

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database ID.

DBNEWID - Completed succesfully.

OPEN DATABASE IN RESETLOGS:

SQL> startup mount

ORACLE instance started.

Total System Global Area 1.1107E+10 bytes

Fixed Size 7644464 bytes

Variable Size 9294584528 bytes

Database Buffers 1711276032 bytes

Redo Buffers 93011968 bytes

Database mounted.

SQL> alter database open resetlogs;

Database altered.

Now try to register:

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

Hope It Helps!
OracleDba

Post Your Solution