Skip to Content
Author's profile photo Former Member

Upgrade Oracle Database from 11 to 12c

Hello,

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:
http://docs.oracle.com/database/121/nav/portal_11.htm

-> 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:
https://help.sap.com/viewer/disclaimer-for-links?q=http://docs.oracle.com/database/121/nav/portal_11.htm

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.

disp+work:

-> Configuring Secure Storage in File System

Follow notes 1639578 and 1622837

After configured SSFS according to the notes. Testing with command “R3trans –d”:

Preparation

-> Download

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:

cat /etc/oraInst.loc

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.

Download:

Set variables:

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:

cd /oracle/<DBSID>/12102/sap/ora_upgrade/pre_upgrade

Execute the following commands to perform pre-upgrade tasks, which can improve the performance of the upgrade process:

sqlplus / as sysdba

SQL> @pre_upgrade_tasks.sql

SQL> @pre_upgrade_checks.sql

Oracle Database Upgrade

  • Backup DATABASE
  • Shutdown SAP System

-> Upgrading the Database Structure with the Database Upgrade Assistant

Added on /etc/oratab:
<SID>:/oracle/<SID>/112_64:N

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)
bash

export ORACLE_HOME_SRC=/oracle/<DBSID>/112_64
export ORACLE_HOME_TGT=/oracle/<DBSID>/12102
export ORACLE_BASE=/oracle/<DBSID>

cd $ORACLE_HOME_TGT/sap/ora_upgrade/post_upgrade

Set the DISPLAY variable and run this script in query mode initially to verify that the environment for the upgrade is correct:

./dbua.sap.sh –q

If everything is ok, run:

./dbua.sap.sh

Make sure the database stopped after finish.

 

Post-Upgrade Steps

-> Updating oratab


Ex: <DBSID>:/oracle/<DBSID>/121:N

-> Updating the SQL*Net Config Files

Check if the entries are ok in tnsnames:

/oracle/<SID>/12102/network/admin
/sapmnt/<SID>/profile/oracle  ($TNS_ADMIN of SIDadm user)

Check that the following parameters are configured in listener.ora:

-> SID_LIST_<LISTENER_NAME>
-> ADR_BASE_<LISTENER_NAME>

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:

/oracle/<DBSID>/121

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

set IHRDBMS=/oracle/SID/12102
set OHRDBMS=/oracle/SID/121
set SBPFUSER=/sbin/fuser

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> @?/rdbms/admin/utlu121s.sql
SQL> @post_upgrade_tasks.sql (if you have not already executed this with DBUA)
SQL> @post_upgrade_checks.sql

-> 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:

cd /oracle/client

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.

 

 

Regards,

Richard W. L. Brehmer
rbrehmer.com

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vikas Kaul
      Vikas Kaul

      Hi Richard,

      Well written document, covers all minute details. But i have question. you have not mentioned the steps to migrate the software owner from ora<dbsid> to oracle as instructed in SAP Note 1915317 and 1915323. As that is the mandatory step

      Thanks

      Vikas

      Author's profile photo . M Farooq Ali
      . M Farooq Ali

      The migration of Oracle software owner from ora<dbsid> to oracle is not mendatory