Upgrade Oracle Database from 11 to 12c
Below are resumed steps to take when upgrading Oracle to 12c, using Linux OS. Based on SAP Upgrade documentation. My intention is to show the effort that this process takes, so other members can have an idea of planning.
Check before start
-> SAP must be 7.00 and above. (System Status)
-> Check OS kernel required. Check the necessary Kernel for you on the link:
-> Check Original Version (must be 10.2.0.5 or higher):
-> Checking Hardware and Software
Check in chapter Installation Checklist in the Oracle Database Installation Guide:
Install Packages (Oracle Linux case): yum install -y oracle-database-server-12cR2-preinstall.x86_64
-> Update BR*Tools (7.40 recommended)
-> Update Kernel (must be 7.21 EXT or above)
check PAM for what Kernel is possible for your system.
-> Configuring Secure Storage in File System
Follow notes 1639578 and 1622837
After configured SSFS according to the notes. Testing with command “R3trans –d”:
download all the 3 files.
-> Extracting Software
as root mkdir -p /oracle/stage/12102 chmod 755 /oracle/stage/12102 ./SAPCAR_LINUX.exe -xvf 51047708/OR112164.SAR /oracle/stage/12102/ ./SAPCAR_LINUX.exe -xvf 51047708/OR212164.SAR /oracle/stage/12102/
Those are the two files needed for a single Database.
-> Backup Oracle Inventory
Check local for OraInventory:
Backup: zip –r /oracle/oraInventory.zip /oracle/oraInventory
-> Update RUNINSTALLER
Download the latest RUNINSTALLER from note 1915301.
-> Installing the product
xhost + su – ora<SID> cd /oracle/stage/12102/database/SAP ./RUNINSTALLER
Default options, only check for ORACLE_BASE = /oracle/<SID>
go until finish.
-> Installing the Current SAP Bundle Patch Use
Check note 1915316, download Bundle Patch and install following the README file.
su - oraSID set IHRDBMS=/oracle/database-name/12102 set OHRDBMS=/oracle/database-name/121 set SBPFUSER=/sbin/fuser
Move where is the ZIP Bundle file and execute:
$IHRDBMS/bin/unzip -qd $IHRDBMS/sapbundle SAP12102P_1702-20012300.ZIP 'SBP_12102170117_201702/OPatch/*' mv $IHRDBMS/OPatch $IHRDBMS/OPatch-pre-SBP_12102170117_201702 mv $IHRDBMS/sapbundle/SBP_12102170117_201702/OPatch $IHRDBMS/OPatch $IHRDBMS/bin/unzip -qd $IHRDBMS/sapbundle SAP12102P_1702-20012300.ZIP 'SBP_12102170117_201702/MOPatch/*' test -d $IHRDBMS/MOPatch && mv $IHRDBMS/MOPatch $IHRDBMS/MOPatch-pre-SBP_12102170117_201702 mv $IHRDBMS/sapbundle/SBP_12102170117_201702/MOPatch $IHRDBMS/MOPatch
Stop SAP, Instance DB and Listener
go todirectory where is the ZIP file and execute:
env ORACLE_HOME=$IHRDBMS $IHRDBMS/MOPatch/mopatch.sh -v -s SAP12102P_1702-20012300.ZIP
The README of the SAP BUNDLE INSTALLATION ends here, for a while. (to be continued)
-> Running the Pre-Upgrade Scripts
As user <ora_dba>
startup the Database. then:
Execute the following commands to perform pre-upgrade tasks, which can improve the performance of the upgrade process:
sqlplus / as sysdba
Oracle Database Upgrade
- Backup DATABASE
- Shutdown SAP System
-> Upgrading the Database Structure with the Database Upgrade Assistant
Added on /etc/oratab:
Start DB and Listener.
Make a backup of directory <Oracle_home>/network/admin as follows:
cp –r <old_Oracle_home>/network/admin <old_Oracle_home>/network/admin.BKP
Set ORACLE_HOME_SRC and ORACLE_HOME_TGT:
(bash executed before)
export ORACLE_HOME_SRC=/oracle/<DBSID>/112_64 export ORACLE_HOME_TGT=/oracle/<DBSID>/12102 export ORACLE_BASE=/oracle/<DBSID>
Set the DISPLAY variable and run this script in query mode initially to verify that the environment for the upgrade is correct:
If everything is ok, run:
Make sure the database stopped after finish.
-> Updating oratab
-> Updating the SQL*Net Config Files
Check if the entries are ok in tnsnames:
/sapmnt/<SID>/profile/oracle ($TNS_ADMIN of SIDadm user)
Check that the following parameters are configured in listener.ora:
If they are missing, copy them from the listener.ora from the source Oracle home <OLD_ORACLE_HOME> and check that Oracle home in listener.ora is set to <NEW_ORACLE_HOME>.
-> Adapting the Environment of the <sapsid>adm user and ora<sid> user.
Log on as user <sapsid>adm and adapt the variables listed below in the .dbenv* files, setting the ORACLE_HOME environment variable to new Oracle home, for example:
Set ORACLE_BASE to the new Oracle base /oracle/<DBSID>.
Adapt the PATH variable so that it no longer contains references to the old Oracle home.
Check the environment with:
$ env | grep ORACLE_HOME
$ env | grep ORACLE_BASE
$ env | grep PATH (this should no longer contain a reference to 112_64)
Do the same for user ora<SID>.
-> Start Listener and DB
su - oraSID lsnrctl start sqlplus / as sysdba SQL> startup
-> Run the SBP post-installation instructions as described in the corresponding SBP README
env ORACLE_HOME=$OHRDBMS $OHRDBMS/sapbundle/catsbp
-> Performing Post-Upgrade Checks
Log on as oraSID cd <new_Oracle_home>/sap/ora_upgrade/post_ugprade. Sqlplus / as sysdba
SQL> @post_upgrade_tasks.sql (if you have not already executed this with DBUA)
-> Updating the Oracle Instant Client
su - SIDadm mkdir -p /oracle/client/12x cd /oracle/client/12x SAPCAR -xvf <Oracle client DVD>/OCL<your OS>/OCL12164.SAR
Check and create the symbolic links: cd /oracle/client/12x ln -s instantclient_12102 instantclient
Create the symbolic link for BR*Tools 7.40:
If the link or directory 11x_64 already exists, rename it, as in this example:
mv 11x_64 11x_64_save
Create the symbolic link:
ln -s /oracle/client/12x /oracle/client/11x_64
OK, now you can stop and start your system and check that you are working on 12c.
Hope this tutorial could help others to accomplish this task.
Richard W. L. Brehmer