12.2.0.1 Upgrade

Assumptions

No TDE (Transparant Data Encryption)No ASM (Advanced Storage Management)No GI (Grid Infrastructure)No RAC (Real Application Cluster)No Database VaultNo OLS (Oracle Label Security)No Oracle Spatial (SDO)No Oracle Warehouse Builder (OWB)No JSON-enabled Context search indexesOracle Text is not usedNo Statisics Tables are used (dbms_stats.create_stat_table)The current ORACLE_HOME is correct in /etc/oratabAPEX (if used) is already at 5.0.4 or aboveYou will be upgrading from 12.1.0.2 (with latest Bundle Patch) to 12.2.0.1 (with latest Release Update)

Preparation Tasks

Gather Dictionary Stats...

NOTE: Gathering Dictionary Stats should be peformed 24 hours before the upgrade.

sqlplus / as sysdba

EXECUTE dbms_stats.gather_dictionary_stats;

exit

You should address all issues reported by preupgrade.jar before continuing.

Set the ${NEWVER} variable equal to the directory name appearing after /u01/app/oracle/product/ in the new ORACLE_HOME.

NOTE: If you have just installed the new ORACLE_HOME, then this variable is likely already set.

export NEWVER=122010

Or...

export NEWVER=122010ORCL

Set the ${CURVER} variable equal to the directory name appearing after /u01/app/oracle/product/ in the old ORACLE_HOME...

export CURVER=$(echo $ORACLE_HOME | cut -f6 -d/)

Copy the password file..

cp $ORACLE_HOME/dbs/orapw* /u01/app/oracle/product/${NEWVER}/dbs

Copy the network config files and update them to reflect new ORACLE_HOME...

export ONA=$ORACLE_HOME/network/admin

export NNA=/u01/app/oracle/product/${NEWVER}/network/admin

cat ${ONA}/listener.ora | sed -e"s/${CURVER}/${NEWVER}/g" >${NNA}/listener.ora

cat ${ONA}/sqlnet.ora | sed -e"s/${CURVER}/${NEWVER}/g" >${NNA}/sqlnet.ora

Check tnsnames.ora manually

Copy externaljob.ora...

Run this as 'oracle'...

echo cp $ORACLE_HOME/rdbms/admin/externaljob.ora /u01/app/oracle/product/${NEWVER}/rdbms/admin/externaljob.ora

...then cut & paste the output to run as 'root'.

Immediately Before Outage

Purge the Recyclebin and create a Guaranteed Restore Point...

PURGE DBA_RECYCLEBIN;

CREATE RESTORE POINT beforeUpgrade GUARANTEE FLASHBACK DATABASE;

Pre-Requisite Patching

Ensure environment variables are changed to point to the NEW (12.2) oracle home

export OLD_HOME=$(cat /etc/oratab | grep ${ORACLE_SID} | cut -f2 -d: )

echo ${OLD_HOME}

echo ${ORACLE_HOME}

if [ ${OLD_HOME} = ${ORACLE_HOME} ]

then

echo ERROR

else

echo Ready

fi

dbua -silent -sid ${ORACLE_SID} -oracleHome ${OLD_HOME} \

-recompile_invalid_objects true \

-upgradeTimezone true -emConfiguration NONE -upgrade_parallelism 1

Bibliography

Pre-Requisite Patching

https://support.oracle.com/rs?type=doc&id=730365.1 Oracle Database Upgrade Path Reference Listhttps://support.oracle.com/rs?type=doc&id=2180188.1 Patches to apply before upgrading Oracle GI and DB to 12.2.0.1https://support.oracle.com/rs?type=doc&id=2035898.1 Things to Consider for 12.1.0.2 to Avoid Problems with SQL Plan Management (SPM)https://support.oracle.com/rs?type=doc&id=2034610.1 Things to Consider to Avoid Poor Performance or Wrong Results on 12.1.0.2Ensure you are on the latest PSU (11g) or Bundle Patch (12cR1)