Oracle Patching

From Vendita MAS
Jump to: navigation, search


MAS Patching allows quarterly patches for Oracle RDBMS to be installed on database servers running Red Hat Enterprise Linux or Oracle Enterprise Linux. MAS patching can be used with patches for Oracle database version 12.1 and later. Other operating systems are NOT currently supported for Oracle patching.

Users of this process must meet the following requirements:

  • Strong familiarity with MAS
  • A valid oracle support
  • Strong familiarity with Oracle quarterly patches and Oracle Opatch.
  • Strong capability with Oracle command line operations using SQLPlus and the Linux command line.

Oracle recommends taking backups before starting any patching activities. These backups may be needed to recover from novel or unusual events during the patching process.

Every quarterly patch provided by Oracle is unique. MAS Oracle Patching users are responsible for testing MAS Oracle patching for a particular patch on a “seed” database that can easily be recreated or restored, in case issues are encountered with the patching process. Only after this has been done, should MAS Oracle patching be used on other database instances. Under no circumstance should a production instance be patched with MAS Oracle patching, unless the patch has been tested with MAS Oracle patching on an instance that is 100% identical from a operating system and database perspective.

The patching process acquires files needed for patching directly from Oracle support and downloads them directly to the database server to be patched. For quarterly patches this typically consists of three downloads: Java Virtual Machine (JVM), Patch Set Update (PSU), and OPatch files. All downloaded files are provided as a compressed archive with the .zip extension. Once downloads are completed, files are unzipped, to ready them for use.

The patching process examines the downloaded OPatch file to determine compatibility. The patching process will upgrade OPatch as needed.

The MAS Oracle patching process determines the databases associated with the Oracle Home to be patched. This is carried out before any patching is performed. Following this, the Oracle Home is patched starting with the Java Virtual Machine (JVM), followed by the Patch Set Update (PSU) files. Note this order is prescribed by Oracle.

Once the Oracle home is patched the patching process connects to each database to be patched to determine if transactions are in process. If transactions are occurring the patching process will stop to allow these transactions to be resolved. Once all transactions have terminated or completed, the patching process can be resumed.

In order to be patched all databases must be open. Databases that are not open, will not be patched. Database patching proceeds with the Java Virtual Machine (JVM), followed by the Patch Set Update (PSU) for the patching. Note that the MAS patching process will shutdown the database prior to the JVM and PSU patches. When all databases have been patched the patching process is completed.

Technical Information

State Machine

The patching machine is based on a state machine that follows a series of sequential steps in performing the patching process. The patching process is designed to be fault tolerant, and any of these steps can be resumed. Resuming a step would typically occur after a manual intervention occurs to correct the cause of the stoppage at a state. The states are listed in the table below.

State Name Description State Index
INITIALIZE Initialize tracking data 5
JVM_PATCH_RETRIEVE Retrieve JVM patch file from Oracle 10
JVM_PATCH_UNZIP Unzip JVM patch file 15
PSU_PATCH_RETRIEVE Retrieve PSU patch file from Oracle 20
PSU_PATCH_UNZIP Unzip PSU patch file 25
OPATCH_RETRIEVE Retrieve opatch file from Oracle 30
OPATCH_COMPAT Determine opatch release compatibility among patches 35
DB_COUNT Count databases using Oracle Home 40
JVM_PREREQ Run opatch prerequisite check on JVM patch 45
PSU_PREREQ Run opatch prerequisite check on PSU patch 50
LONG_TRANS Detect long running transactions 55
JVM_SHUTDOWN_DBS Shutdown databases using Oracle Home prior to JVM patching 60
JVM_APPLY Run opatch apply on JVM patch 65
JVM_DATAPATCH Run datapatch against databases after JVM patch is applied 70
PSU_SHUTDOWN_DBS Shutdown databases using Oracle Home prior to PSU patching 75
PSU_APPLY Run opatch apply on PSU patch 80
PSU_DATAPATCH 'Run datapatch against databases after PSU patch is applied 85
COMPLETED Patch processing completed 90

Patching Namespace

MAS patching is in the namespace. The patching namespace includes two forms and one process used to execute patching.


This must be completed in order for patching to occur. The form includes the patch files and associated Automated Release Update (ARU) numbers. MAS patching users must include all fields on this form to use MAS patching.

The table below lists the fields on this form.

Field Descriptiuon Required
form name Use a form name that indicates purpose of the form, including release and date information yes
form description Provide a meaningful description of the form yes
oracle home Oracle Home to be Patched yes
patch directory Full directory name on Oracle server for patches.
Directory MUST be owned by the Oracle user and
must have sufficient space for all patch files.
jvm patch file Name of the JVM patch file yes
jvm patch aru ARU of the JVM patch file yes
psu patch file Name of the PSU patch file yes
psu patch aru ARU of the PSU patch file yes
opatch patch file Name of the opatch file yes
opatch patch aru ARU of the opatch file yes

Field Descriptiuon Required
form name Use a form name that indicates purpose of the form, including release and date information yes
form description Provide a meaningful description of the form yes
current state Current value for the state variable used for control of the state machine yes
remote host Account for database server, SSH yes

This form can be viewed during process execution, or when a process has stopped due to an error, to view the state where the error occurred.

Patching Process

In order to use the MAS Oracle patching process, users must create an account for their Oracle support account.
This account can be of type “SSH” and needs to be created with the users account name and password.

The patching process is
The New Job form for this process is shown below:

The table below provides an explanation of the parameters for running new job.

Field Descriptiuon Required
shell A SSH account for the Oracle server to be patched. This account
must be created before attempting to run this patching process.
job name A name to uniquely identify this patching process execution. This name will be used to create the form to hold the state logic variable. This is the form. yes
oracle_support_account The Oracle support account that holds the users Oracle support user name and password yes
form This an instance of the form This form must be created before attempting to run this process. yes

When all parameters of this form have been entered, run the process and monitor. If the process stops, examine the job output to determine a root cause, correct the issue, then select the job from the “jobs” menu, and select “run again”. Using the state logic, the patching process will resume.

At the end of the patching process execution, a report is provided indicating what occurred during the patching process execution, including database skipped due to issues.