While cloning from Production to Non Production Databases, we come across same DBID being generated for the Non Prod Database.
This would result in RMAN backup related errors, if you are using the same catalog database for both Production and Non Production Databases. To overcome this, the DBID needs to be changed for the Non Production database. Below are the steps you can follow to change the DBID :
Select dbid from v$database;
DBID
———-
650080748
Ensure that the target database is mounted but not open, and that it was shut down consistently prior to mounting.
For example:
SHUTDOWN IMMEDIATE
STARTUP MOUNT
In the Terminal Window, execute the nid command
bash-4.1$ which nid
/d01/oracle/product/v.12.1.0.2/bin/nid
> Invoke the DBNEWID utility on the command line, specifying a valid user with theSYSDBA
privilege
. For example:
bash-4.1$ nid TARGET=SYS/oracle@test_db
The DBNEWID utility performs validations in the headers of the datafiles and control files before attempting I/O to the files. If validation is successful, then DBNEWID prompts you to confirm the operation (unless you specify a log file, in which case it does not prompt), changes the DBID for each datafile (including offline normal and read-only datafiles), and then exits. The database is left mounted but is not yet usable.
After DBNEWID successfully changes the DBID, shut down the database
Startup Mount
Alter database open resetlogs;
There you go. The DBID will be different now from that of Production