Business Insights: Data Analytics for Business Insights

How reliable is autoupgrade.jar analyze mode?

Written by Michael Dinh | Nov 12, 2019 5:00:00 AM
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 AutoUgrade. 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: ### Detach ORACLE_HOME from 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.
 $ 
 
### Rename directory to /u01/app/oracle/product/12.2/dbhome_1 ### Attach ORACLE_HOME to correct location.
$ 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.
 $
 
### Apply RU patch to new ORACLE_HOME, verify patches and inventory.
$ 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.
 $
 
### Run autoupgrade.jar -mode analyze completed successfully.
$ 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
 $
 
### Run autoupgrade.jar -mode deploy failed.
$ 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. 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. ### Correct orabasetab
$ 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:
 
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.