Cloning Diary: adcfgclone.pl dbTier fails with "Control file creation failed"


Thursday morning and we have a cloning request, well Apps DBAs perform cloning periodically, and at times get adhoc requests from functional or development teams. This was an adhoc request and with below environment

1. Single node ebs 12.2.7
2. Oracle database 12.1.0.2
3. Non-RAC and Non-ASM

Issue we faced actually compelled me to understand cloning internals. It was a cold backup cloning.
We have a cold backup to test server and had to clone it onto another development server.


Just to summarize on where we actually faced this error, below is an account of what about steps we followed to achieve this -






We decided to go with dbTier because -
- Its a cold backup restore.
- dbTier will take care of database registration in inventory, relink and configuration of binaries, recreate controlfile, restore and configure database, start database and listener.


Lets head on towards the error -


Error
-----
 /     50% completed       RC-50004: Fatal: Error occurred in ApplyDatabase:
Control file creation failed
WARNING: RC-40201: Unable to connect to Database TEST1227.
StackTrace:
java.lang.Exception: Cannot connect to database using DBUtil
        at oracle.apps.ad.clone.ApplyDatabase.checkDBConnection(ApplyDatabase.java:3356)
        at oracle.apps.ad.clone.ApplyDatabase.doConf(ApplyDatabase.java:562)
        at oracle.apps.ad.clone.ApplyDatabase.doApply(ApplyDatabase.java:502)
        at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:393)

        at oracle.apps.ad.clone.ApplyDBTier.<init>(ApplyDBTier.java:116)

ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01210: data file header is media corrupt
ORA-01110: data file : '/u01/oracle/db/apps_tech/data/system01.dbf'
ORA-01130: database file version 12.1.0.2.0 incompatible with ORACLE version
12.1.0.0.0
ORA-01110: data file 1: '/u01/oracle/db/apps_tech/data/system01.dbf'


Error clearly states we are struggling with compatible parameter. We checked parameter and spfile generation date.

adcfgclone.pl uses templates under ORACLE_HOME/appsutil/template to generate an spfile and this spfile is being used at startup.

compatible parameter being set here is 12.1.0.0.0 while parameter set in source database is 12.1.0.2.0.


Resolution -

RC-00118: Error occurred during creation of database; Control file creation failed (Doc ID 2446627.1)


1.Go in DB ORACLE_HOME/appsutil/template
2.Edit the afinit_db.ora by setting the compatible parameter to match your exact version as updated in the init parameters.
3.Rerun adcfgclone dbTier after removing files under oraInventory and stopping all the running processes on db user



Conclusion-

Though it will be interesting to know when Oracle will update afinit_db.ora file, traversing and exploring OH/appsutil/template is important and can be helpful in troubleshooting cloning issues.


Enjoy your weekend!!!