How reliable is autoupgrade.jar analyze mode?

3 min read
Nov 12, 2019 12:00:00 AM

It sounds like you hit one of those classic Oracle "gotchas" where the tool tells you everything is fine until the moment it actually has to do the heavy lifting. Moving an Oracle Home manually is a bit like performing surgery—everything might look okay on the outside, but the internal "organs" (like the inventory and configuration files) need to be perfectly aligned for the system to function.

Leveraging Oracle AutoUpgrade for 11g to 12c Transitions

According to the Oracle documentation About Oracle Database AutoUpgrade, AutoUpgrade utility identifies issues before upgrades, deploys upgrades, performs postupgrade actions, and starts the upgraded Oracle Database. I am currently working on a project to upgrade a database from 11.2.0.4 to 12.2.0.1 and decided to use AutoUpgrade.

Full disclosure: Oracle DB software was installed at an incorrect location and modified to the correct location. Here is how Oracle DB software was moved to new location:

Step 1: Detaching the Oracle Home from the Incorrect Location

$ export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 $ $ORACLE_HOME/oui/bin/runInstaller -detachHome -silent ORACLE_HOME=$ORACLE_HOME Starting Oracle Universal Installer...  Checking swap space: must be greater than 500 MB. Actual 33536 MB Passed The inventory pointer is located at /etc/oraInst.loc 'DetachHome' was successful. $  

Step 2: Relocating and Re-attaching the Oracle Home

Rename directory to /u01/app/oracle/product/12.2/dbhome_1

$ export ORACLE_HOME=/u01/app/oracle/product/12.2/dbhome_1 $ $ORACLE_HOME/oui/bin/runInstaller -attachHome -silent ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME="OraDB12Home1" Starting Oracle Universal Installer...  Checking swap space: must be greater than 500 MB. Actual 33536 MB Passed The inventory pointer is located at /etc/oraInst.loc 'AttachHome' was successful. $ 

Step 3: Patching and Inventory Verification

$ echo $ORACLE_HOME /orahome/oracle/app/product/12.2/dbhome_1  $ $ORACLE_HOME/OPatch/opatch lspatches 29757449;Database Jul 2019 Release Update : 12.2.0.1.190716 (29757449) OPatch succeeded.  $ $ORACLE_HOME/OPatch/opatch lsinventory OPatch succeeded. $ 

The AutoUpgrade Paradox: Successful Analysis vs. Failed Deployment

Phase 1: Successful Analyze Mode

$ echo $ORACLE_HOME /orahome/oracle/app/product/12.2/dbhome_1  $ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config $ORACLE_SID_upgrade.config -mode analyze  upg> Job 100 completed ------------------- Final Summary -------------------- Number of databases [ 1 ]  Jobs finished successfully [1] Jobs failed [0] Jobs pending [0] ------------- JOBS FINISHED SUCCESSFULLY ------------- Job 100 FOR $ORACLE_SID $ 

Phase 2: Deployment Failure and the "Disturbing" Error

$ echo $ORACLE_HOME /orahome/oracle/app/product/12.2/dbhome_1  $ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config $ORACLE_SID_upgrade.config -mode deploy AutoUpgrade tool launched with default options It is not possible to determine the target ORACLE_BASE value for ORACLE_SID because the target ORACLE_HOME directory does not exist [/u01/app/oracle/product/12.2/dbhome_1] for database ORACLE_SID. It was not possible to determine the target ORACLE_BASE for entry upg1 $  

The fact that the analyze succeed and the deploy failed is disturbing. Also, the error does not seem accurate since directory /u01/app/oracle/product/12.2/dbhome_1 does exist.

Root Cause Analysis: The orabasetab Misconfiguration

What's the problem and the solution? Basically, $ORACLE_HOME/install/orabasetab had incorrect entry where $ORACLE_HOME is /u01/app/oracle/product/12.2/dbhome_1.

The Solution: Correcting the orabasetab Entry

$ echo $ORACLE_HOME /orahome/oracle/app/product/12.2/dbhome_1  $ cat $ORACLE_HOME/install/orabasetab (this is old incorrect OH) #orabasetab file is used to track Oracle Home associated with Oracle Base /u01/app/oracle/product/12.2.0/dbhome_1:/orahome/oracle/app:OraDB12Home1:N:  $ vi $ORACLE_HOME/install/orabasetab $ cat $ORACLE_HOME/install/orabasetab (this is new correct OH) #orabasetab file is used to track Oracle Home associated with Oracle Base /u01/app/oracle/product/12.2/dbhome_1:/orahome/oracle/app:OraDB12Home1:N: 

Final Summary: Why Analyze Mode Isn't 100% Reliable

Not only did analyze fail to detect the error, but the deploy error message was uninformative. A better error message would be "Wrong entry in $ORACLE_HOME/install/orabasetab" which is the cause per Doc ID 2573304.1. In summary, autoupgrade.jar analyze mode may not be reliable depending on the circumstance and may not the only case.

Oracle Database Consulting Services

Ready to optimize your Oracle Database for the future?

 

On this page

Ready to unlock value from your data?

With Pythian, you can accomplish your data transformation goals and more.