Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member


Patching the Oracle 11.2 version

Download the patches

Stop the Oracle's related processes

Extract the zip file and generate documentation

Check the installed version of OPatch and MOPatch

Prerrequisites for installing the patches

Installing the SAP Bundle patch

Stop Oracle processes

Run  the installation script

Review MOPatch Execution Summary and Log Files

Running the catsbp.sql script

Downloading Oracle Software

Installing Oracle 12.1 database software

Backup Oracle Inventory

Update RUNINSTALLER

Check software installation prerequisites

Installing the new Oracle Database 12c Software

Installing the SAP Bundle Patch for Oracle 12.1

Stop Oracle processes

Setting variables

Update the Opatch version

Run the installation script for generating documentation

Run the installation script

Post installation steps

Database Upgrade pre-tasks

Pre upgrade scripts

Database backup

Shut down SAP System

Using the Database Upgrade Assistant

Prerequisites



Patching the Oracle 11.2 version

Download the patches

Download the last patch from https://support.sap.com/software/databases.html. According to the note 1631931 - Oracle 11.2.0: Patches / Patch collections for 11.2.0.3 Oracle Database release 11.2.0.3 is not fully supported anymore and is limited to basic analysis.

The last available file is SAP11203P_1508-20009981.ZIP.



It is mandatory to use Mopatch for installing the Oracle patch. Mopatch is included inside the referenced file, however, the last version can be downloaded from 1027012 - MOPatch - Install Multiple Oracle Patches in One Run



Stop the Oracle's related processes

We need to be sure that all database related processes are stopped:

As <sid>adm

stopsap

Checking MW1 Database

Database is running

-------------------------------------------

stopping the SAP instance DVEBMGS00

Shutdown-Log  is written to /home/mw1adm/stopsap_DVEBMGS00.log

-------------------------------------------

Instance DVEBMGS00 was not running!

stopping the SAP instance ASCS01

Shutdown-Log  is written to /home/mw1adm/stopsap_ASCS01.log

-------------------------------------------

Instance ASCS01 was not running!

Trying to stop MW1 database ...

Log file: /home/mw1adm/stopdb.log

MW1 database stopped

Checking MW1 Database

Database is not available via R3trans

-------------------------------------------



As user 'oracle':

$ lsnrctl stop LISTENER_MW1

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-NOV-2015 15:34:38

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connecting  to (ADDRESS=(PROTOCOL=IPC)(KEY=MW1.WORLD))

The command completed successfully



As 'root' for being completely sure:

# ps -ef |grep oracle

root 28122 23728 0 15:40 pts/0 00:00:00 grep oracle

# ps -ef |grep oramw1

root 28124 23728 0 15:41 pts/0 00:00:00 grep oramw1

Extract  the zip file and generate documentation

After unzipping the Mopatch file, we need to execute it in documentation mode: (Not all the output listed)

$ ./mopatch.sh -v -d -s /home/oracle/SAP11203P_1508-20009981.zip

MOPatch - Install Multiple Oracle Patches in One Run - 2.1.19.

Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.



Version: 2.1.19

Revision: 5.1.2.33

Command-line:   ./mopatch.sh -v -d -s /home/oracle/SAP11203P_1508-20009981.zip



Oracle Home: /oracle/MW1/112_64

RDBMS version: 11.2.0.3.0

OPatch version:11.2.0.3.1

Clean-up: supported

PSUs: supported

Log file: $ORACLE_HOME/cfgtoollogs/mopatch/mopatch-2015_11_10-16-10-20.log

Patch base: .

Patch source: /home/oracle/SAP11203P_1508-20009981.zip

Link script: ./link.ls_sap_tmpvm11.sh

Readmes: ./READMES-2015_11_10-16-10-20.txt

Strpd. Readmes:./READMES-STRIPPED-2015_11_10-16-10-20.txt

make utility: /usr/bin/make

unzip utility: /oracle/MW1/112_64/bin/unzip



User name: oracle

Working dir: /home/oracle/SBP_1120315_201508/MOPatch

System: Linux ls-sap-tmpvm11 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Disk free: 193804388 KBytes on /oracle

Disk required: 436336 KBytes on /oracle

Getting pre-run patch inventory...

Getting pre-run patch inventory...done.



Analyzing installed patches...

Analyzing installed patches...done.



Patches installed in Oracle Home /oracle/MW1/112_64:

+ 9458152 (sql)

+ 9584028 (sql)

+ 9656644 (sql)

11837095

+ 12325243 (sql)

12585543

12591252

12655301

12693573

12731940

12918738

12979199

#####################

#### TEXT ERASED

#####################

All specially marked patches in the list above contain non-

standard documentation and, hence, may require special

installation   instructions. Please refer to the READMEs

collected in

./READMES-STRIPPED-2015_11_10-16-10-20.txt

for more information.



Patch Inventory Status:

-----------------------

Patches installed in Oracle Home /oracle/MW1/112_64:

+ 9458152 (sql)

+ 9584028 (sql)

#####################

#### TEXT ERASED

#####################

14333475

14340076



Link Status:

------------

Link script "./link.ls_sap_tmpvm11.sh" not executed in documentation mode.



This way, it creates different folders and 'README.html' document:

drwxr-xr-x.  9 oracle root 4096 Aug 9 17:05 SBP_1120315_201508

# cd SBP_1120315_201508/

# ls -l

total 80

drwxr-xr-x.  4 oracle root 4096 Oct 20 2014 19852361

drwxr-xr-x.  17 oracle root 4096 Jun 26 13:10 21106081

drwxr-xr-x.  5 oracle root 4096 Aug 9 17:05 9458152

drwxr-xr-x.  4 oracle root 4096 May 3 2013 9584028

drwxr-xr-x.  4 oracle root 4096 Jun 6 2012 9656644

drwxr-xr-x.  2 oracle root 4096 Nov 10 16:10 MOPatch

drwxr-xr-x.  8 oracle root 4096 Apr 14 2014 OPatch

-rw-r--r--.  1 oracle root 52936 Aug 9 17:05 README.html

Check  the installed version of OPatch and MOPatch

In the 'README.html' generated document, this can be found:

You must use OPatch version 11.2.0.3.7 for installing this SBP. Later 11.2 OPatch versions are supported as well, but Oracle recommends to use version 11.2.0.3.7, since it has been fully tested to interoperate with this SBP.



We can check the 'opatch' version provided with the SBP as user 'oracle':

$ ./opatch version

========================================================

GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY

========================================================

OPatch Version: 11.2.0.3.7

OPatch succeeded.



OPatch succeeded.



This version is the recommended one, so we must use it.

On the other hand, version available in $ORACLE_HOME

$ ./opatch version

========================================================

GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY

========================================================

OPatch Version: 11.2.0.3.1

OPatch succeeded.



Is not recent enough, so we need to update this version with the one provided with the SBP. Also we update the MOPatch folder.

$ cp -R MOPatch/ $ORACLE_HOME

$ cp -R OPatch/ $ORACLE_HOME



Prerrequisites for installing the patches

Environment variables IHRDBMS, OHRDBMS and SBPFUSER must be set for user 'oracle':


IHRDBMS → path of the RDBMS software installation home. The standard location is /oracle/database-name/11203 or /oracle/RDBMS/11203.

OHRDBMS → path of the RDBMS runtime home. The standard location is /oracle/database-name/112 or /oracle/database-name/112_64.

SBPFUSER → /sbin/fuser


For doing this, we need to edit the file “.bash_profile” located at “/home/oracle”. Bear in mind that this file starts with “.” and it will not be listed using “ls”, but using “ls -a” instead.


So, editing the file with “nano”, it will look like this:

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

export ORACLE_HOME=/oracle/MW1/112_64

export PATH=$ORACLE_HOME/bin:$PATH

export IHRDBMS=/oracle/MW1/11203

export OHRDBMS=/oracle/MW1/11203

export SBPFUSER=/sbin/fuser



Run the bundle patch migration script if your Oracle Home has a SAP Bundle Patch earlier than 201406 installed.


Do not run the bundle patch migration script if you do not have any SAP Bundle Patch installed or if you have a SAP Bundle Patch 201406 or later installed.

If the bundle patch migration script reports that an Oracle Home is not ready for bundle patch migration, check its output and log file for details and resolve the issues. For up-to-date information on trouble shooting, see also SAP Note 2011199 SAP Bundle Patches (SBP) - structure changes starting with June 2014.


In order to check wich versions are installed, type:

$ ./opatch lsinventory

========================================================

GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY

========================================================

Oracle Interim Patch Installer version 11.2.0.3.7

Copyright (c) 2013, Oracle Corporation. All rights reserved.



Oracle Home : /oracle/MW1/112_64

Central Inventory : /oracle/oraInventory

from : /oracle/MW1/112_64/oraInst.loc

OPatch version : 11.2.0.3.7

OUI version : 11.2.0.3.0

Log file location : /oracle/MW1/112_64/cfgtoollogs/opatch/opatch2015-11-13_05-06-30AM_1.log



Lsinventory   Output file location : /oracle/MW1/112_64/cfgtoollogs/opatch/lsinv/lsinventory2015-11-13_05-06-30AM.txt



--------------------------------------------------------------------------------

Installed Top-level Products (1):



Oracle Database 11g 11.2.0.3.0

There are 1 product(s) installed in this Oracle Home.



Interim patches (46) :



Patch 11837095 : applied on Mon Jul 20 12:11:43 BST 2015

Unique Patch ID: 14956249

Created on 20 Jun 2012, 19:44:43 hrs PST8PDT

Bugs fixed:

11837095

#####################

#### TEXT ERASED BEYOND THIS POINT

#####################



If patches  are not enough recent, we can execute the migration tool:

$ env ORACLE_HOME=$IHRDBMS $IHRDBMS/MOPatch/bpmig.sh -v verify

bpmig - Prepare Migration from a PSU or Exa BP to a SAP DBBP - 2.1.19.

Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.



Version: 2.1.19

Revision: 1.1.2.36

Command-line:   /oracle/MW1/11203/MOPatch/bpmig.sh -v verify



Oracle Home: /oracle/MW1/11203

RDBMS version: 11.2.0.3.0

SBP version: SBP 11.2.0.3.3 201208

OPatch version:11.2.0.3.7

Log file: $ORACLE_HOME/cfgtoollogs/mopatch/bpmig-2015_11_13-05-01-36.log



User name: oracle

Working dir: /home/oracle

System: Linux ls-sap-tmpvm11 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux



Getting patch inventory...

Getting patch inventory...done.



Analyzing installed patches...

Analyzing installed patches...done.



Testing whether patches can be deinstalled...

step 1 of 2...

step 2 of 2...

Testing whether patches can be deinstalled...done.



Verification   Summary

====================

OPatch Version: succeeded

Online Patches: succeeded

Non-SBP Patches: succeeded

Deinstall Test: succeeded



Your Oracle Home is ready for BP migration. Continue migration

as described in the SBP readme.



Installing the SAP Bundle patch

Stop  Oracle processes

Stop all database applications, in particular all SAP applications.

  • Shut down the database instances, the listeners, and other processes running from the Oracle Home.

  • After  having shut down all database processes as described in the previous step, use the fuser OS command to check for stale SQL*Plus sessions:

    $SBPFUSER   $IHRDBMS/bin/oracle



If that command reports running processes, these are stale SQL*Plus sessions, which you can safely terminate with the 'kill' command.

Run  the installation script

Install the SAP Bundle Patch as follows: go to the folder where the downloaded .zip file was downloaded and, once there, type:

$ /bin/sh $ORACLE_HOME/MOPatch/mopatch.sh -v -s SAP11203P_1508-20009981.zip

MOPatch - Install Multiple Oracle Patches in One Run - 2.1.19.

Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.



Version: 2.1.19

Revision: 5.1.2.33

Command-line:   /oracle/MW1/112_64/MOPatch/mopatch.sh -v -s SAP11203P_1508-20009981.zip



Oracle Home: /oracle/MW1/112_64

RDBMS version: 11.2.0.3.0

OPatch version:11.2.0.3.7

Clean-up: supported

PSUs: supported

Log file: $ORACLE_HOME/cfgtoollogs/mopatch/mopatch-2015_11_13-05-32-49.log

Patch base: .

Patch source: SAP11203P_1508-20009981.zip

Link script: ./link.ls_sap_tmpvm11.sh

Readmes: <none>

Strpd. Readmes:<none>

make utility: /usr/bin/make

unzip utility: /oracle/MW1/112_64/bin/unzip



User name: oracle

Working dir: /home/oracle

System: Linux ls-sap-tmpvm11 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Disk free: 193802600 KBytes on /oracle

Disk required: 436336 KBytes on /oracle



Getting pre-run patch inventory...

Getting pre-run patch inventory...done.

Analyzing installed patches...

Analyzing installed patches...done.



Patches installed in Oracle Home /oracle/MW1/112_64:

+ 9458152 (sql)

+ 9584028 (sql)

+ 9656644 (sql)

11837095

#####################

#### TEXT ERASED BEYOND THIS POINT

#####################



Review  MOPatch Execution Summary and Log Files

Review the execution summary that MOPatch prints after it has processed all patches. In the event of patch conflicts or errors, see the MOPatch log files in directory $ORACLE_HOME/cfgtoollogs/mopatch for more details. Follow the instructions in section "Resolving Patch Conflicts and Errors" of this note to resolve the issues.

In this case:

Patch Installation Status:

--------------------------

Skipped 4 of 19 patches since they were already installed:

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!13343438

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!13696216

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!13923374

SAP11203P_1508-20009981.zip!SBP_1120315_201508!9656644



Installed 15 of 19 patches successfully:

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!21106081

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!14275605

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!14727310

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!16056266

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!16619892

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!16902043

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!17540582

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!18523757

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!18878603

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!19493736

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!20076194

SAP11203P_1508-20009981.zip!SBP_1120315_201508!21106081!20502318

SAP11203P_1508-20009981.zip!SBP_1120315_201508!9584028

SAP11203P_1508-20009981.zip!SBP_1120315_201508!9458152

SAP11203P_1508-20009981.zip!SBP_1120315_201508!19852361

Patch Inventory Status:

-----------------------

Patches installed in Oracle Home /oracle/MW1/112_64:

+ 9458152 (sql)

+ 9584028 (sql)

+ 9656644 (sql)

13343438 (psu sql)

13696216 (psu sql java)

13923374 (psu sql java)

14275605 (psu sql)

14727310 (psu sql java)

16056266 (psu sql)

16619892 (psu sql java)

16902043 (psu sql java)

17540582 (psu sql)

18523757 (sapdbbp sql java)

18878603 (sapdbbp sql)

19493736 (sapdbbp sql java)

+ 19852361 (java)

20076194 (sapdbbp sql)

20502318 (sapdbbp sql)

21106081 (sapdbbp sql java)



Link Status:

------------

Link script "./link.ls_sap_tmpvm11.sh" executed successfully.



which means everything ran smoothly.



Running  the catsbp.sql script

As user 'oracle' start up the database instances, the listeners, and other processes running from the Oracle Home.

Start the listener:

$ lsnrctl start LISTENER_MW1

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 13-NOV-2015 05:52:07

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Starting /oracle/MW1/112_64/bin/tnslsnr: please wait...



TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /oracle/MW1/112_64/network/admin/listener.ora

Log messages written to /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))



Connecting  to (ADDRESS=(PROTOCOL=IPC)(KEY=MW1.WORLD))

STATUS of the LISTENER

------------------------

Alias LISTENER_MW1

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 13-NOV-2015 05:52:07

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /oracle/MW1/112_64/network/admin/listener.ora

Listener Log File /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))

Services Summary...

Service "MW1" has 1 instance(s).

Instance "MW1", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully.







After this point, you can execute the script:

$ cd $OHRDBMS

$ env ORACLE_HOME=$OHRDBMS $OHRDBMS/bin/sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 13 06:00:59 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

Downloading Oracle Software

Software must be downloaded from SAP Service Markeplace.

This is the path to follow:




Once downloaded, we must uncompress the “rar” files and the containing “*.SAR” files.

SAPCAR -xvf OR112164.SAR

SAPCAR -xvf OR212164.SAR

SAPCAR -xvf OR312164.SAR

SAPCAR -xvf OR412164.SAR

SAPCAR -xvf OR512164.SAR

SAPCAR -xvf OR612164.SAR

SAPCAR -xvf OR712164.SAR

SAPCAR -xvf OR812164.SAR


In order to get the installation software.

Installing   Oracle 12.1 database software

Backup  Oracle Inventory

Before installing the new software, it's recommendable to back up the central Oracle inventory

# cd /etc

# tail oraInst.loc

inventory_loc=/oracle/oraInventory

inst_group=dba

cd /oracle

cp -rp oraInventory/ oraInventory.18112015.backup

Update   RUNINSTALLER

Check the version of the 'RUINSTALLER' script and compare it to the one available in 1915301 -      Database Software 12.1.0.2 Installation on Unix

./RUNINSTALLER   -version

. RUNINSTALLER 12.1.0.2.0 (058)

. Oracle Release 12.1.0.2.0

. Release date 2015-03-02

. Patch level 058

. Release status rel

. SAP note 1915301



In this case, the available version in the SAP Note is 59 so it must be updated by overwriting it.

# ./RUNINSTALLER -version

. RUNINSTALLER 12.1.0.2.0 (059)

. Oracle Release 12.1.0.2.0

. Release date 2015-06-02

. Patch level 059

. Release status rel

. SAP note 1915301

Now we can continue.

Check  software installation prerequisites

Log as user 'oracle'. Variable 'DISPLAY' must be set and DB_SID. File '.bash_profile' must be edited in order to make this change permanent. This file will look like this one:

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

export ORACLE_HOME=/oracle/MW1/112_64

export PATH=$ORACLE_HOME/bin:$PATH

export IHRDBMS=/oracle/MW1/11203

export OHRDBMS=/oracle/MW1/11203

export SBPFUSER=/sbin/fuser

export DB_SID=MW1



We must log out and login again in order to make the change efective.

$ echo $DB_SID

MW1

./RUNINSTALLER   -check



We get the following screenshots



We must execute the script.





# ./runfixup.sh

All Fix-up operations were completed successfully.



Now all the checks are correct:






Installing the new Oracle Database 12c Software

We must execute 'RUNINSTALLER' as user 'oracle'. We get different screenshots. Please, copy the answers we provide in this guide.























# ./root.sh

Performing  root user operation.



The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /oracle/MW1/12102



Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]: y

Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]: y

Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]: y

Copying coraenv to /usr/local/bin ...



Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.








Installing the SAP Bundle Patch for Oracle 12.1

We need to download the last available SBP from https://support.sap.com/software/databases.html

When writing this guide, the lastest available is SAP12102P_1509-20012300.ZIP.

Stop Oracle processes

Stop all database applications, in particular all SAP applications.

  • Shut down the database instances, the listeners, and other processes running from the Oracle Home.

  • After  having shut down all database processes as described in the previous step, use the fuser OS command to check for stale SQL*Plus sessions:

    $SBPFUSER   $IHRDBMS/bin/oracle


If that command reports running processes, these are stale SQL*Plus sessions, which you can safely terminate with the 'kill' command.



Setting variables

Before proceeding we need to set the parameters IHRDBMS & OHRDBMS for the environment variable of user ‘oracle’.

For doing this and make the changes permanent, we must edit the file '.bash_profile' located at /home/oracle and make look like this one. After that, log out and log in with user 'oracle' to make changes effective.


# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi



# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

export ORACLE_HOME=/oracle/MW1/112_64

export PATH=$ORACLE_HOME/bin:$PATH

# export IHRDBMS=/oracle/MW1/11203

export IHRDBMS=/oracle/MW1/121

# export OHRDBMS=/oracle/MW1/11203

export OHRDBMS=/oracle/MW1/12102

export SBPFUSER=/sbin/fuser

export DB_SID=MW1



Update  the Opatch version

We must update the OPatch and MOpatch version with the ones contained inside the .zip file. The ORACLE_HOME change is not permanent in this case.

$ export ORACLE_HOME=$IHRDBMS

$ echo $ORACLE_HOME

/oracle/MW1/121

$ cp -R MOPatch/ $ORACLE_HOME

$ cp -R OPatch/ $ORACLE_HOME



Run  the installation script for generating documentation

Execute:

$ ./mopatch.sh -v -d -s /home/oracle/SAP12102P_1509-20012300.ZIP

MOPatch - Install Multiple Oracle Patches in One Run - 2.1.19.

Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.



Version: 2.1.19

Revision: 5.1.2.33

Command-line:   ./mopatch.sh -v -d -s /home/oracle/SAP12102P_1509-20012300.ZIP



Oracle Home: /oracle/MW1/112_64

RDBMS version: 11.2.0.3.0

OPatch version:11.2.0.3.7

Clean-up: supported

PSUs: supported

Log file: $ORACLE_HOME/cfgtoollogs/mopatch/mopatch-2015_11_19-10-29-37.log

Patch base: .

Patch source: /home/oracle/SAP12102P_1509-20012300.ZIP

Link script: ./link.ls_sap_tmpvm11.sh

Readmes: ./READMES-2015_11_19-10-29-37.txt

Strpd. Readmes:./READMES-STRIPPED-2015_11_19-10-29-37.txt

make utility: /usr/bin/make

unzip utility: /oracle/MW1/112_64/bin/unzip



User name: oracle

Working dir: /home/oracle/MOPatch

System: Linux ls-sap-tmpvm11 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Disk free: 183233080 KBytes on /oracle

Disk required: 435680 KBytes on /oracle

Getting pre-run patch inventory...

Getting pre-run patch inventory...done.



Analyzing installed patches...

Analyzing installed patches...done.



Patches installed in Oracle Home /oracle/MW1/112_64:

+ 9458152 (sql)

+ 9584028 (sql)

+ 9656644 (sql)

13343438 (psu sql)

13696216 (psu sql java)

13923374 (psu sql java)

14275605 (psu sql)

14727310 (psu sql java)

16056266 (psu sql)

16619892 (psu sql java)

16902043 (psu sql java)

17540582 (psu sql)

18523757 (sapdbbp sql java)

18878603 (sapdbbp sql)

19493736 (sapdbbp sql java)

+ 19852361 (java)

20076194 (sapdbbp sql)

20502318 (sapdbbp sql)

21106081 (sapdbbp sql java)



Analyzing patches to process...

Analyzing patches to process...done.

#######################################

### TEXT ERASED BEYOND THIS POINT

#######################################

Run  the installation script

After reading the documentation, we must set the enviroment variable ORACLE_HOME as the same value of IHRDBMS for user 'oracle'. In this case:

# export ORACLE_HOME=$IHRDBMS

# echo $ORACLE_HOME

/oracle/MW1/121


This change is not permanent and it is only for this session and the patching execution. For executing the the installation script:

$ ./mopatch.sh -v -s /home/oracle/SAP12102P_1509-20012300.ZIP

MOPatch - Install Multiple Oracle Patches in One Run - 2.1.21.

Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.



Version: 2.1.21

Revision: 5.1.2.38

Command-line:   ./mopatch.sh -v -s /home/oracle/SAP12102P_1509-20012300.ZIP



Oracle Home: /oracle/MW1/121

RDBMS version: 12.1.0.2.0

OPatch version:12.1.0.1.8

Clean-up: supported

PSUs: supported

Log file: $IHRDBMS/cfgtoollogs/mopatch/mopatch-2015_11_20-02-10-31.log

Patch base: .

Patch source: /home/oracle/SAP12102P_1509-20012300.ZIP

Link script: ./link.ls_sap_tmpvm11.sh

Readmes: <none>

Strpd. Readmes:<none>

make utility: /usr/bin/make

unzip utility: /oracle/MW1/121/bin/unzip



User name: oracle

Working dir: /oracle/MW1/121/MOPatch

System: Linux ls-sap-tmpvm11 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Disk free: 183226456 KBytes on /oracle

Disk required: 637384 KBytes on /oracle

Post   installation steps

Copy configuration files from /oracle/MW1/11203/network/admin to the new network configuration:

$ cp listener.ora sqlnet.ora tnsnames.ora /oracle/MW1/12102/network/admin



and edit 'listener.ora' modifiying the ORACLE_HOME value

################

# Filename......: listener.ora

# Created.......: created by SAP AG, R/3 Rel. >= 6.10

# Name..........:

# Date..........:

# @(#) $Id: //inst/inst_scripts/lmts_006_REL/tpls/ora/LISTENER.ORA#1 $

################

ADMIN_RESTRICTIONS_LISTENER_MW1 =      on

LISTENER_MW1  =

(ADDRESS_LIST =

(ADDRESS =

(PROTOCOL = IPC)

(KEY = MW1.WORLD)

)

(ADDRESS=

(PROTOCOL = IPC)

(KEY = MW1)

)

(ADDRESS =

(COMMUNITY = SAP.WORLD)

(PROTOCOL = TCP)

(HOST = sapbiwm01)

(PORT = 1651)

)

)

STARTUP_WAIT_TIME_LISTENER_MW1 =      0

CONNECT_TIMEOUT_LISTENER_MW1      = 10

TRACE_LEVEL_LISTENER_MW1      = OFF

SID_LIST_LISTENER_MW1      =

(SID_LIST =

(SID_DESC =

(SID_NAME = MW1)

(ORACLE_HOME = /oracle/MW1/12102) ### THIS LINE MODIFIED

)

)

ADR_BASE_LISTENER_MW1      = /oracle/MW1/saptrace





Start the database instances, the listeners and other processes running from the Oracle Home

$ lsnrctl start LISTENER_MW1




Database Upgrade pre-tasks

Pre-upgrade scripts

Before executing the upgrade, it's necessary to execute some scripts.


SQL scripts that are located in '<NEW_ORACLE_HOME>/sap/ora_upgrade/pre_upgrade' are intended to be run from the old Oracle home environment before the upgrade.


SQL scripts that are located in '<NEW_ORACLE_HOME>/sap/ora_upgrade/post_upgrade' are intended to be run from in the new Oracle home environment after the upgrade.


All Pre- and Post-Upgrade SQL scripts must be run by an Oracle database administrator account in the environment of the current Oracle home. Pre-Upgrade scripts are run in the environment of the Oracle 11 home before the upgrade, post-upgrade SQL scripts are run in the environment of the Oracle 12 home after the upgrade.


Execute as 'oracle':

$ sqlplus /"as sysdba"

SQL> @ pre_upgrade_checks.sql



Follow the different recommendations that can be addressed on the script. When creating this guide, we were asked to execute this script: /oracle/cfgtoollogs/MW1/preupgrade/preupgrade_fixups.sql

As a result, we executed on sqlplus:

SQL> ALTER SYSTEM SET PROCESSES=300 SCOPE=SPFILE;



There were other recommendations but they may conflict with SAP ones.



After executing it, we execute:

$ sqlplus /"as sysdba"

SQL> @pre_upgrade_tasks.sql

===========================================================================

ORACLE DATABASE 12c RELEASE 1 PRE-UPGRADE TASK: START

===========================================================================

2015-11-20   06:09:23

===========================================================================

ORACLE DATABASE 12c RELEASE 1 PRE-UPGRADE TASK: GATHERING ORACLE DICTIONARY STATISTICS

===========================================================================

SQL> EXECUTE dbms_stats.gather_dictionary_stats;

SQL> SET ECHO OFF

===========================================================================

ORACLE DATABASE 12c RELEASE 1 PRE-UPGRADE TASK: RECOMPILING INVALID OBJECTS

===========================================================================

COMP_TIMESTAMP   UTLRP_BGN 2015-11-20 06:13:22

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid

DOC> objects in the database. Recompilation time is proportional to the

DOC> number of invalid objects in the database, so this command may take

DOC> a long time to execute on a database with a large number of invalid

DOC> objects.

#########################################

## TEXT ERASED BEYOND THIS POINT

#########################################      





Its execution takes some time. After its execution, we can execute once again 'pre_upgrade_checks.sql' and see the results. If there is a warning about the database parameter 'remote_os_authent=TRUE' it can be ignored safely:

SQL> @ pre_upgrade_checks.sql

Database  backup

It's a must to have a complete and usable database backup. Otherwise you might lose data if the upgrade fails.

Shut  down SAP System

SAP system must be completely turned off. If it was not already, it can be stopped by typing

stopsap r3

and SAP application server with 'sapcontrol' too:

sapcontrol  -nr <SAP_instance_number> -function Stop



Using the Database Upgrade Assistant

The DBUA is a graphical tool that leads you step-by-step throught the upgrade.



Prerequisites

Make sure that user 'oracle' has permissions 664 on the file 'oratab'. It is located in /etc:

$ ls -l oratab

-rw-rw-r--.  1 oracle oinstall 813 Nov 18 01:45 oratab



Make sure that this file contains the entry <DBSID>:<Oracle_home>:N

MW1:/oracle/MW1/11203:N      #ADDED FOR THE DATABASE UPGRADE



Make a backup of the /<old_oracle_home>/network/admin

$ pwd ## WE ARE IN THE RIGHT PATH

/oracle/MW1/11203/network

$ cp -R admin admin.backup



Set variables ORACLE_HOME_SRC, ORACLE_HOME_TGT.

$ export ORACLE_HOME_SRC=/oracle/MW1/11203

$ export ORACLE_HOME_TGT=/oracle/MW1/12102

$ echo $ORACLE_HOME_SRC

/oracle/MW1/11203

$ echo $ORACLE_HOME_TGT

/oracle/MW1/12102



DB_SID and ORACLE_BASE are already set in '.bash_profile'

$ echo $DB_SID

MW1

$ echo $ORACLE_BASE

/oracle/



Make sure that the instance which is running is the one with the old Oracle home. ORACLE_HOME must point to the old path instead of the new one.

Also, assure that no “zombie” Oracle processes are running in the server.



Change to the correct directory and execute and execute a script for verifying that environment for the upgrade is correct:

cd /oracle/MW1/12102/sap/ora_upgrade/post_upgrade

$ ./dbua.sap.sh -q

.

. Oracle Database Upgrade

. Version 12.1.0.2.0 Release Date 2015-08-24 Patch Level 013 (rel)

. Copyright (c) Oracle Corporation 2015. All Rights Reserved.

. SAP note 1915315

. Oracle Database Release: 12.1.0.2.0

.

. Host : ls-sap-tmpvm11

. Platform : linux_x86_64 (64-bit)

. Date : 2015_11_20 14:59:52

. User : oracle

. Log file : /home/oracle/12cupgrade-12102-MW1.log

. History log : /home/oracle/12cupgrade-12102-MW1_hist.log

.

. Checking environment ...

. Environment checked.

.

. Performing Pre-Upgrade checks ...

.

. STEP: >>> Checking Source Oracle Home and Target Oracle Home

. (OK) - Source Oracle home directory /oracle/MW1/11203 exists.

. (OK) - Target Oracle home directory /oracle/MW1/12102 exists.

. STEP: >>> Determine Source Release and Target Release

. (OK) - Source Release checked: 11.2.0.3.0

. (OK) - Target Release checked: 12.1.0.2.0

. STEP: >>> Determine Upgrade Type (Major Upgrade or Patch Set Upgrade)

. (OK) - Upgrade Type will be Major Release Upgrade

. STEP: >>> Checking Timezone File Version Upgrade

. (OK) - Timezone file version will be upgraded.

. STEP: >>> Calculating DBUA log directory

. (OK) - DBUA log directory: /oracle//cfgtoollogs/dbua/MW1/upgrade1

. STEP: >>> Checking write permissions for ORACLE_BASE /oracle/

. (OK) - You have write permissions for ORACLE_BASE /oracle/

. STEP: >>> Checking oratab

. (OK) - /etc/oratab exists.

. (OK) - You have write permissions for /etc/oratab.

. STEP: >>> Checking existence of TDE encryption wallets ewallet.p12, cwallet.sso

. (OK) - No ewallet.p12 in /oracle/MW1/11203/dbs.

. (OK) - No cwallet.sso in /oracle/MW1/11203/dbs.

. STEP: >>> Checking SAP Bundle Patch in Source Oracle Home

. (OK) - An SAP Bundle Patch is installed in in /oracle/MW1/11203.

. SBP Info SBP 11.2.0.3.15 201508

. SBP Date 201508

. SBP Version 11.2.0.3.15

. SBP directory /oracle/MW1/11203/sapbundle/SBP_1120315_201508

. STEP: >>> Checking SAP Bundle Patch in Target Oracle Home

. (OK) - An SAP Bundle Patch is installed in in /oracle/MW1/12102.

. SBP Info SBP 12.1.0.2.4 201509

. SBP Date 201509

. SBP Version 12.1.0.2.4

. SBP directory /oracle/MW1/12102/sapbundle/SBP_121024_201509

. STEP: >>> Checking custom post-upgrade scripts

. STEP: >>> Checking/Copying TDE encryption wallets

. STEP: >>> Checking Oracle Net Config Files: listener.ora

. (WARNING) - File /oracle/MW1/12102/network/admin/listener.ora already exists.

. (INFO) - /oracle/MW1/11203/network/admin/listener.ora will not be copied to /oracle/MW1/12102/network/admin.

. STEP: >>> Checking/Copying Oracle Net Config Files: tnsnames.ora, sqlnet.ora

. (OK) - File /oracle/MW1/12102/network/admin/tnsnames.ora already exists.

. (OK) - File /oracle/MW1/12102/network/admin/sqlnet.ora already exists.

. STEP: >>> Checking/Copying SAP BR*Tools Profiles init<SID>.sap, init<SID>.utl

. (OK) - File not found: /oracle/MW1/11203/dbs/initMW1.sap

. (OK) - File not found: /oracle/MW1/11203/dbs/initMW1.utl

. STEP: >>> Checking/Copying SAP BR*Tools RMAN Backup Tape Library

. (OK) - File not found: /oracle/MW1/11203/lib/libobk.so

. (OK) - File not found: /oracle/MW1/11203/lib/libobk.sl

. (OK) - File not found: /oracle/MW1/11203/lib/libobk.a

. STEP: >>> Checking CRS Registration (Only for RAC or ASM)

.

. Pre-Upgrade checks completed.

################################

## TEXT ERASED BEYOND THIS POINT

################################      







Once checked, we can start DBUA in interactive mode. It's really important to make sure that oratab has the related entry in the prerequisites due to Oracle bug 19897084.

$ ./dbua.sap.sh







An error can be faced due to invalid objects detected.




For solving it, we can execute the following script in sqlplus.


/oracle/MW1/11203/rdbms/admin/utlrp.sql


This is part of the output:

PL/SQL procedure successfully completed.

TIMESTAMP

--------------------------------------------------------------------------------

COMP_TIMESTAMP   UTLRP_END 2015-11-20 15:48:26

DOC> The following query reports the number of objects that have compiled

DOC> with errors.

DOC>

DOC> If the number is higher than expected, please examine the error

DOC> messages reported with each object (using SHOW ERRORS) to see if they

DOC> point to system misconfiguration or resource constraints that must be

DOC> fixed before attempting to recompile these objects.

DOC>#

OBJECTS WITH ERRORS

-------------------

0

DOC> The following query reports the number of errors caught during

DOC> recompilation. If this number is non-zero, please query the error

DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors

DOC> are due to misconfiguration or resource constraints that must be

DOC> fixed before objects can compile successfully.

DOC>#

ERRORS DURING RECOMPILATION

---------------------------

0

Function created.

PL/SQL procedure successfully completed.

Function dropped.

PL/SQL procedure successfully completed.



Use 'utluiobj.sql' after the upgrade to identify any new invalid objects due to the upgrade.





Configuring Enterprise Manager is not mandatory.








If you use your own backup software, select this option:












Once it finishes, a summary is showed.


1 Comment
Labels in this area