Oracle® Database 2 Day + Real Application Clusters Guide 11g Release 2 (11.2) Part Number E10743-02 |
|
|
View PDF |
Oracle issues product fixes for its software called patches. When you apply the patch to your Oracle software installation, it updates the executable files, libraries, and object files in the software home directory. The patch application can also update configuration files and Oracle-supplied SQL schemas. Patches are applied by using OPatch, a utility supplied by Oracle, or Enterprise Manager.
A group of patches form a patch set. When you apply a patch set, many different files and utilities are modified. This results in a version change for your Oracle software, for example, from Oracle Database 11.2.0.1.0 to Oracle Database 11.2.0.2.0. To apply a patch set, use Oracle Universal Installer (OUI).
This chapter describes how to manage Oracle software and apply patches in Oracle Real Application Clusters (Oracle RAC) environments using Oracle Enterprise Manager and the OPatch utility.
This chapter includes the following sections:
See Also:
Oracle Universal Installer and OPatch User's Guide for Windows and UNIX for more information about using OPatch and applying patches to Oracle RAC
Enterprise Manager Database Control enables you to find the latest patch release on the My Oracle Support (formerly OracleMetaLink) Web site, and to download it to your Oracle home. There are two topics related to configuring the Enterprise Manager Patch interface:
The first step is configuring the software library. When configuring the Software Library you specify the directory paths that the software library will use to store binary data, such as patches.
To configure the Software Library prior to using the Patch Interface of Database Control:
On the Database Home page in DB Control, click Software and Support.
In the Deployment Procedure Manager section, click the Deployment and Provisioning Software Library link.
The Provisioning page appears.
Click the link for the Administration page.
Scroll down to the Software Library Configuration section at the bottom of the page. Click Add.
The Add Software Library Location page appears.
In the Software Library directory location field, enter the name of the directory where the patches will be uploaded to the node, for example, /home/oracle
. Click OK.
When the utility completes, you have completed the Software Library configuration.
To download patches from My Oracle Support (formerly OracleMetaLink) using Enterprise Manager, you can give Enterprise Manager Database Control (Database Control) your login credentials so that it can log in to My Oracle Support automatically and search for patch releases. You must set these credentials before you can run the Patch Advisor in Database Control.
After you have configured the My Oracle Support credentials, Enterprise Manager automatically creates and schedules two jobs for your system:
Refresh From Metalink
OPatch Update (which requires the Software Library to be configured)
Refer to Oracle Database 2 Day DBA for instructions on setting your My Oracle Support credentials.
The Procedure Manager allows you to view, edit, run, and monitor deployment procedures. Deployment procedures are best practices provided by Oracle for various provisioning tasks.
In order for the Deployment Procedure Manager to function properly, the Provisioning Daemon job should be running. This job is used to monitor the status of running deployment procedures. You can start or stop a job and also view the status of the job using the pafctl
utility. You can find this utility in the $ORACLE_HOME/bin
directory. The syntax for this utility is as follows:
pafctl { start | stop | status } [sysman_password] [interval]
The keywords for this command indicate the following:
start
— Starts the Provisioning Daemon job. This takes the interval value from the command line. If no interval is specified in the command line, you will have to enter a value, which is the interval (in minutes) with which to run the Provisioning Daemon job.
stop
— Stop the Provisioning Daemon job.
status
—Checks if the Provisioning Daemon job is running.
sysman_password
—You must specify the SYSMAN password to connect to the repository. If not specified at the command line, you will be prompted to enter the value.
interval
—This is an integer that specifies the interval (in minutes) for which to run the Provisioning Daemon job. The default interval is 3 minutes. To specify a value that is not the default value, you must use the start
action. You will then be prompted for both the SYSMAN user password and the interval.
To start the Provisioning Daemon job, enter the following command at the operating system prompt"
$ pafctl start Enter the repository user password: Enter interval [default 3]:
If you are directed by Oracle Support Services to apply a patch to your system, you can get the patch from My Oracle Support. Search for the patch using the Patches & Updates interface using either the patch number, or search criteria.
Once you have located the patch, you can view the Readme file for the patch, and choose to download the patch to your local system. If you download the patch file to a computer that is not a node in the cluster, then you will need to transfer the file using a binary protocol to one of the cluster nodes.
After you have downloaded a patch, you then need to upload the patch into the Software Library, or the patch cache.
To upload patches to the Software Library:
On the Database Home page, click Software and Support.
On the Software and Support page, select View Patch Cache under the heading Database Software Patching.
On the Patch Cache page, click Upload Patch.
The Create Oracle Software Update Component page appears.
Click the Browse button, and then navigate to the directory where you saved the patch file to disk. If you are accessing DB Control from a browser running on a client computer, then the patch must be available on that client computer.
When you have located the patch file, click the file name to select the file, then click Open. This places the file name in the Patch File field.
In the Patch Attributes section of the Create Oracle Software Update Component page enter the following information about the patch you are uploading:
Patch number
The type of patch (individual or patch set)
The date the patch was created
The patch description
The product family for the patch, (for example, Oracle Database)
The product the patch applies to (for example, RDBMS Server)
The release version of the product
The platform your database runs on
The language to use (for example, American English)
(Optional) A description of the patch
You can find most of this information in the patch set README file.
When you have finished entering the information, check the option Add Patch File to Patch Cache, then click Upload.
The Patch Cache page appears again, with a confirmation message.
The patch now appears in the Patch Cache.
Patching in an Oracle RAC environment is slightly different compared to patching a standalone database instance. Before you install a patch, DB Control must stop all the applications running from the software directory that is being patched. In an Oracle RAC cluster, additional applications may need to be shutdown, depending upon which software is being patched.The following table Table 10-1 lists the applications to stop when patching Oracle software.
Table 10-1 Patching Oracle Home Directories
Oracle Home Directory | Applications to Stop |
---|---|
Oracle RAC Database |
Oracle RAC database, Enterprise Manager Database Control, listener, and any other applications that are running from the Oracle RAC home directory |
Oracle grid infrastructure |
Oracle RAC database, any standalone database instances that use the same ASM instance as the cluster database, ASM, all node applications, Oracle Clusterware, and any other applications that are running from the Grid home directory |
Because DB Control must be stopped when applying patches to the Oracle Database home, it creates background scripts to apply the patch during the time DB Control is down. These scripts also restart the Oracle software, including DB Control after the patch has been applied. After it has been restarted, DB Control continues the patching operation.
You can use DB Control to patch Oracle RAC in the following ways:
Patch Oracle RAC Database (All Nodes Upgrade)
Patch Oracle RAC Database (Rolling Upgrade)
This section discusses only the Rolling Upgrade Method.
See Also:
In rolling patching, one node is shut down, the patch is applied to the node, and the node is brought back up. This is performed node by node, separately, until all the nodes in the cluster are patched. This is the most efficient means of applying an interim patch to an Oracle RAC, ASM, or Oracle Clusterware installation. By patching nodes individually, there is zero downtime for the cluster database because at least one instance is available at all times on a different node.
While most patches can be applied in a rolling fashion, some patches cannot be applied in this fashion. The README
file for the patch indicates whether or not you can apply the patch using the rolling patch method. If the patch cannot be applied using the rolling patch method, then you must use either "Minimum Downtime Patching" or the Patch Oracle RAC Database (All Nodes Upgrade) method to apply the patch.
To patch a non-shared Oracle home using the rolling patch method:
On the Database Home page, click Software and Support.
On the Software and Support page, select Deployment Procedures.
The Deployment Procedure Manager page appears.
Select the option Patch Oracle RAC Database (Rolling Upgrade) then click the Schedule Deployment button.
The Select Patches page appears.
Under the heading RAC Updates, click the Add Patches button.
The Search and Select Patches page appears.
Select either the Search My Oracle Support option to check for patches online or the Search Software Library option to search for patches manually added to the Software Library, as described in "Uploading Patches to the Software Library".
Enter parameters to limit the Search performed, if desired, then click Go.
Check the box next to the patches you want to install, then click Select.
The Select Patches page appears again, with the selected patches displayed in the RAC Updates section.
After you have selected all the patches you want to install, click Next.
The Credentials and Schedule page appears.
Choose to either use the Preferred Credentials or to override the Preferred Credentials. If you choose to override the Preferred Credentials, then enter the username and password of the operating system user that owns the Oracle Home being patched, for example, oracle
. Check the option to save the username and password as Preferred Credentials.
In the Schedule section of the page, choose the option One Time (Later) and then specify the time when you want the patch to be applied to your system, or choose the option One Time (Immediately) to have the patch applied right away.
After you have specified the schedule for the patch, click Next. The Review page appears.
Review the information on this page regarding the updates that will be made to your system. At the bottom of the page, under the heading Warning, read the warning statement about not being able to access DB Control during the patching operation, then check the Select the check box to accept this warning and continue box.
After you have checked this box you can click Finish to submit the patching operation.
To view the progress of the patching operation, select Procedure Completion Status on the Deployment Procedure Manager page.
To patch the Oracle Grid home, all applications that depend on Oracle Clusterware will need to be stopped for the node being patched. In the case of a non-shared Oracle Grid home, the patch is applied in a rolling method, so only a small part of the cluster is down at any given time. If you have a shared Oracle Grid home, then you can use the out-of-place patching method to minimize the downtime required for patching.
If you want to patch the software for ASM, because it is installed in the same directory as Oracle Clusterware, you must shut down Oracle Clusterware as well as Oracle ASM prior to patching.
This section describes the procedure for patching a non-shared Oracle Grid home. The patches are applied in-place, that is, to the existing software directories.
To patch Oracle Grid home using DB Control, perform the following steps:
On the Database Home page, click Software and Support.
On the Software and Support page, select Deployment Procedures.
The Deployment Procedure Manager page appears.
Select Patch Oracle Clusterware - Rolling.
A list of patches currently available in the Software library is displayed, or you can click Add Patches to locate and download the patch from My Oracle Support (formerly OracleMetaLink) at https://metalink.oracle.com
.
On the Target Selector page, select all the nodes that need to be patched.
Enter the operating system credentials for the Oracle Grid home being patched.
(Optional) Specify a schedule for when you want the patching operation to occur. If you want the patch to be applied immediately, skip this step.
Review the information about the selections you have made. If you need to make changes to the information, use the Back button.
DB Control starts the patching operation. It performs the following tasks:
Downloads patches or patchsets from My Oracle Support and stages them on the local file system
For one of the nodes in the cluster, all databases and cluster database instances are stopped, the ASM instance is stopped, and any other Oracle Clusterware dependent resources are stopped. The rootcrs.pl
script is run on that node for every patch. The patches are then applied to the Oracle Grid home. If necessary, the root.sh
script is run for the Oracle Grid home, and then Oracle Clusterware is restarted, followed by all the dependent resources that were shut down at the start of the patching operation.
The previous step is repeated for each node in the cluster
Patch sets are a mechanism for delivering fully tested and integrated product fixes. All the fixes in a patch set have been tested and are certified to work with each other. Because a patch set includes only low impact patches, it does not require you to certify applications or tools against the server.
For instructions on applying the latest patch set to your Oracle RAC database and Oracle Clusterware installations on Oracle Enterprise Linux, search for "Oracle 11g release 2(11.2) Support Status and Alerts" documentation on the My Oracle Support (formerly OracleMetaLink) Web site.
This document provides a summary of the patch sets available for Oracle 11g Release 2. Using this document, you can easily locate and view the Patch Set Notes for your platform. The Oracle Database Patch Set Notes document contains the following information:
System requirements and information about how to install or reinstall the patch set
A list of all bugs fixed to date that are specific to Oracle Database for specified platform
A list of known issues relating to Oracle Database for the specified platform
To locate the Patchset notes on My Oracle Support:
Log in to My Oracle Support.
Select the Patches & Updates tab.
Select Quick Links to the Latest Patchsets, Mini Packs, and Maintenance Packs.
Under the heading Latest Oracle Server/Tools Patchsets, select Oracle Database.
A list of operating systems appears.
Place your cursor over the entry that matches your operating system, or use the triangular arrows to search for your operating system.
When you place the cursor over the entry for your operating system, for example, Linux x86, a list of database versions appears.
Select 11.2.0
The Advanced Search page appears.
Scroll to the bottom of this page to see the list of available patchsets.
Select the number in the Patch column for the patchset you want to view or download.
The Patchset description and download page appears.
Click View Readme to see the patchset notes.
On this page you can also click Download to download the patch to your computer.
If you choose to download the patch, then follow the directions in "Uploading Patches to the Software Library" and "Using DB Control to Apply Patches to a Cluster Database" to apply the patch to your system.
If you want to use the Minimum Downtime patching method to apply a patch that cannot be applied in a rolling fashion, then you must use OPatch.
Before you apply the patch to your Oracle RAC database, your ASM installation, or to your Oracle Clusterware installation, there are a few steps to perform:
OPatch verifies if the Oracle home is present. You must ensure that the ORACLE_HOME
environment variable is set to the Oracle home of the product you are trying to patch.
Check the respective vendor documentation for the details to set the environment variable.
To check the current setting of the ORACLE_HOME
variable on Linux:
In a command window, log in to the operating system as the oracle
user.
Use the echo
command to display the current setting of the ORACLE_HOME
environment variable.
echo $ORACLE_HOME
See Also:
Oracle Database 2 Day DBA for information about locating the value for the database Oracle home directory.
It is highly recommended to back up the software directory you are patching before performing any patch operation. This applies to Oracle RAC, ASM, or Oracle Clusterware software installation directories.
To back up the software installation:
Back up the software installed in the specified Oracle home using:
An operating system utility, such as zip
, cp -r
, tar
, or cpio
, to back up the software in the Oracle home directory that is being patched to disk.
The Oracle Secure Backup utility to back up the software in the Oracle home directory that is being patched to tape.
If you use Enterprise Manager to download the patch, and you selected all the nodes in your cluster as targets for the patch, then the patch is automatically staged on those nodes.
If you manually downloaded the patch from My Oracle Support, then you must copy the patch to each node.
The opatch
binary file is located in the Oracle_home/OPatch
directory. You can either specify this path when executing OPatch, or you can update the PATH
environment variable to include the OPatch
directory.
To update the PATH environment variable on Oracle Enterprise Linux systems:
In a command window, log in to the operating system.
Use a shell command similar to the following to update the value of the PATH environment variable, where /u01/app/oracle/11gR2/db_1
is the location of your Oracle home directory:
$ export PATH=$PATH:/u01/app/oracle/11gR2/db_1/OPatch
You could also modify the shell profile script for the current user to have this variable configured every time you log in.
Before you patch a system, make sure the user equivalency is working. User equivalency exists when the operating system user on each node is considered to be identical. For information on configuring user equivalency, see "Configuring Operating System Users and Groups".
To test SSH user equivalency:
On the system where you want to run OPatch, log in as the oracle
user.
Use the following command to test user equivalency:
[oracle@racnode1] $ ssh racnode2 date
If the date is returned, then user equivalency between the source and destination node has been configured.
If you see output similar to the following, then SSH user equivalency is not enabled:
Enter passphrase for key '/home/oracle/.ssh/id_rsa':
Enable SSH user equivalency before continuing with the patching operation.
To enable SSH user equivalency:
On the system where you want to run OPatch, open a command window and log in as the oracle
user.
Start the SSH agent and load the SSH keys into memory using the following commands:
$ /usr/bin/ssh-agent $SHELL $ /usr/bin/ssh-add
These commands start the ssh-agent
on the local node, and load the RSA and DSA keys into the current session's memory so that you are not prompted to use pass phrases when issuing SSH commands.
At the prompt, enter the pass phrase for each key that you generated when configuring Secure Shell, for example:
[oracle@racnode1 .ssh]$ exec /usr/bin/ssh-agent $SHELL [oracle@racnode1 .ssh]$ /usr/bin/ssh-add Enter passphrase for /home/oracle/.ssh/id_rsa Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa) Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa)
To test if you have configured SSH correctly, run the following command. If you have configured SSH correctly, then you will not be prompted for a password or a pass phrase.
[oracle@racnode1] $ ssh racnode2 date
Note:
Do not close this command window until you have completed the patch installation. If you must close the command window in which you enabled SSH user equivalency before the patch installation is complete, repeat Step 1 to Step 4 before starting the patch installation.See Also:
In minimum downtime patching, one set of nodes is shut down and the patch is applied to those nodes. After the first set of nodes has been patched, the second set of nodes is shut down. The first set of nodes is then restarted and the patch is applied to the second set of nodes. After the patch has been applied to the second set of nodes, those nodes are restarted. This method leads to less downtime for Oracle RAC, compared to having all the nodes shut down at the same time.
When you use the minimum downtime patching method, the following actions occur:
The local node is always patched first.
The local node is used as a base to patch the other nodes.
The user is prompted for the set of nodes to patch first from the remaining nodes.
For each node in this first set, the user is asked to stop the instance and then the patch is propagated to that node before continuing to the next node. When the initial set of nodes has been patched, the user is asked to shut down the remaining nodes.
After the local node is patched, the patch is propagated to the last set of nodes and the inventory is updated. The last instances are stopped on the remote nodes. You can then start up the patched nodes (the first set of nodes) before patching the remaining nodes.
To apply a patch to your cluster database using the minimum downtime method:
Change to the directory where the unzipped patch is staged on disk, for example:
$ cd Oracle_home/EMStagedPatches/4519934/4519934
Stop all user applications that use the Oracle RAC home directory for the group of nodes being patched. For example, to stop Enterprise Manager Database Control on the local node, use the following command, where Oracle_home
is the home directory for your Oracle RAC installation:
$ Oracle_home/bin/emctl stop dbconsole
Shut down all Oracle RAC instances on the local node. To shut down an instance for an Oracle RAC database, enter a command similar to the following example, where Grid_home
is the home directory for your Oracle grid infrastructure installation, orcl
is the name of the database, and orcl1
is the name of the instance:
$ CRS_home/bin/srvctl stop instance -d orcl -i "orcl1"
Make sure the ORACLE_HOME
environment variable points to the software directory you want to patch, for example:
$ echo $ORACLE_HOME /u01/app/oracle/11gR2/db_1
Use the following command from within the patch directory:
$ opatch apply -minimize_downtime
If you run the OPatch command from the directory where the patch is staged on disk, you do not need to specify the patch ID.
OPatch asks if you are ready to patch the local node. After you confirm that the Oracle RAC instances on the local node have been shut down, OPatch applies the patch to the Oracle home directory on the local node. You are then asked to select the next nodes to be patched.
After you shut down the Oracle RAC instances on the other nodes in the cluster, you can restart the Oracle RAC instance on the local node. Then, instruct OPatch that you are ready to patch the remaining nodes.
After all the nodes have been patched, restart the Oracle RAC instances on the other nodes in the cluster. The following command shows how to start the orcl2
instance for the Oracle RAC database named orcl
:
$ CRS_home/bin/srvctl start instance -d orcl -i "orcl1"
Verify that all the nodeapps
were restarted on the nodes in the cluster.
$ crsctl check crs
If any of the node applications did not restart, use the SRVCTL utility to restart them. For example, you can use commands similar the following to restart the listener on the racnode1
node, where Grid_home is the home directory of your Oracle grid infrastructure installation:
$ CRS_home/bin/srvctl start listener -n racnode1
Run any post-patch scripts that are mentioned in the patch instructions, for example:
$ sqlplus /nolog SQL> connect sys/password@orcl1 AS SYSDBA SQL> @Oracle_home/cpu/CPUOct2007/catcpu.sql SQL> @Oracle_home/rdbms/admin/utlrp.sql SQL> exit
Applying patches to your Oracle RAC cluster can be complicated at times. This section covers some of the most common topics regarding troubleshooting patch deployment:
If you have problems applying a patch to your Oracle RAC database, review these solutions to common problems. If the problem you encountered is not listed, review the log and trace files.
See Also:
If OPatch does not automatically detect Oracle RAC or its nodes, investigate the contents of the inventory and ensure they are complete.
To update the node list for OPatch:
If the list of nodes for your cluster is not complete, you can update it by using Oracle Universal Installer and the -updateNodeList
flag, as demonstrated in the following example:
Oracle_home/oui/bin/runInstaller -updateNodeList
ORACLE_ HOME=/u01/app/oracle/11gR2/db_1
CLUSTER_NODES=racnode1,racnode2,racnode3 -noClusterEnabled
See Also:
Oracle Universal Installer and OPatch User's Guide for Windows and UNIX for more information about Oracle product patching using OPatch
Logging and tracing is a common aid for debugging. OPatch maintains logs for all apply
, rollback
, and lsinventory
operations. The log files are located in the Oracle_home/cfgtoollogs/opatch
directory. Each log file will be tagged with the time stamp of the operation. Log files are named as opatch_mm-dd-yyyy_hh-mm-ss.log
, where mm-dd-yyyy
is the current date and hh-mm-ss
is the current time. Each time you run OPatch, a new log file is created.
For example, if a log file is created on May 17, 2007 at 11:55 PM, then it will be named as follows:
opatch_05-17-2007_23-55-00.log
OPatch also maintains an index of the commands processed by OPatch and the log files associated with it in the opatch_history.txt
file located in the Oracle_home/cfgtoollogs/opatch
directory. A sample of the opatch_history.txt
file is as follows:
Date & Time : Tue Apr 26 23:00:55 PDT 2007 Oracle Home : /u01/app/oracle/11gR2/db_1/ OPatch Ver. : 11.2.0.0.0 Current Dir : /scratch/oui/OPatch Command : lsinventory Log File : /u01/app/oracle/11gR2/db_1/cfgtoollogs/opatch/opatch-2007_Apr_26_23-00-55-PDT_Tue.log
You might get this error if the directory that the OPatch utility is using to do the patch does not match the template for what it is checking, or if the OPatch utility is run from an invalid directory.
The Patch_Shiphome
directory should have the following structure:
An etc
directory that has the metadata files
A files
directory that has the patch files
The etc/config/inventory.xml
file and the actions.xml
file under the same directory
To resolve the "Not a valid patch area" error:
Perform one of the following actions:
Remove the patch shiphome directory and re-create it with the proper structure (by extracting the files again).
Start the OPatch utility from the directory where the patch to be installed has been unzipped and staged on disk.
Use the following command when starting OPatch:
opatch apply /Patch_Shiphome
where Patch_Shiphome
is the location where the patch has been staged on disk.
If the patching process is interrupted, you might get the error "Unable to remove a partially installed interim patch" when you try to install the patch a second time.
To resolve the partially installed patch error:
Ensure that the environment variable ORACLE_HOME
is set to the Oracle home directory you are attempting to patch.
Go to the Oracle_home/.patch_storage/
patch-id
_
timestamp
directory and run the restore.sh
script (or restore.bat
on Windows platforms) as follows:
Oracle_home/.patch_storage/patch-id_timestamp/restore.sh
On Linux and UNIX systems, use the Oracle_home/.patch_storage/
patch-id
_
timestamp
/make.txt
file (if available) to modify your operating system environment, as follows:
/bin/sh make.txt
Attempt to apply the patch again.
Upgrading Oracle Clusterware and Oracle RAC is performed in a manner very similar to patching. You can perform rolling upgrades, or you can shut down the Oracle Database and Oracle Clusterware software to perform the upgrade.
With Oracle Clusterware 11g release 2, you perform out-of-place upgrades. To perform an out-of-place upgrade, you install the Oracle grid infrastructure into a new Grid home. When performing the upgrade, you specify the location of the new Grid home instead of selecting the existing software location. When performing an out-of-place upgrade, the old and new version of the software are present on the nodes at the same time, each in a different home location, but only one version of the software is active at any given time.
See Also:
Oracle Clusterware Installation Guide for more information on performing software upgrades