Patch with oracle opatch

Source: Internet
Author: User

This article describes how to install patches using the oracle opatch tool, and describes the general steps to confirm the BUG: analyze and troubleshoot relevant error information, compare the environment, and final confirmation.
Keywords: ORACLE, OPATCH, patch
1. Introduction
In recent years, as the application of our ORACLE database is getting deeper and deeper, the user's environment is getting more and more complex, and some common ORACLE bugs are occasionally triggered. Therefore, we must not only require the database to be installed as before, but also require the technical personnel to know how to install patches. The following is a case study, this section describes how to install patches using oracle opatch.
2. Case Description
Not long ago, a Database Listener occasionally experienced inexplicable downtime during system peak hours, resulting in a client connection failure. However, restarting the listener did not report any errors, and the listener was rebuilt in time. When we heard the Problem description, we first checked the log during the listener stop period and found the following error message:

 
 
 
 
 
After querying metalink, we found a similar case "TNS Listener Crash with Core dump [ID 549932.1]", which is applicable to ORACLE10.2.0.3.0 to 11.1.0.6.0 and the platform is untitled. The database version is 10.2.0.4, but the platform is LINUX. It is a little different and needs further analysis. However, in the System log (/var/log/messages, the following prompt is displayed:

It is also mentioned in the document that during the time when this error occurs, the system's virtual memory will be abnormal, so we will use the configuration tracking file to wait for the problem to occur again, observe the system's virtual memory as follows:



These phenomena are the same as the errors in the Document. Therefore, although some conditions are different, they can be basically identified as the same problem. Next, let's take a look at the solution to the problem. There are two solutions officially provided by ORACLE: one is to add physical memory, and the other is to patch 6139856 on the current platform. Since the hardware investment is involved in the addition of physical memory, we will try to solve this problem by patching.
3. Preparations
The solution for patching is decided. The next step is preparation. First, download the patch file (P6139856), upload the file to the relevant directory on the server, and decompress the file, of course, database backup is essential before patching. We will not describe these steps one by one, but will focus on the patching process.
4. Operation Process
4.1. read instructions
Before the formal operation, we should carefully read the patch instructions to see what special precautions are required. These prompts will be displayed in the patch instructions. If you have not made any special prompts, we can apply the patch in the official environment. The installation of small patches is actually relatively simple, mainly using the oracle opatch tool. The OPATCH tool is a patch installation program that comes with ORACLE, this tool is provided after ORACLE is installed by default, so we do not need to install it separately.
4.2. Check the environment
Each patch application has a certain environment, including the database version and OPATCH version. First, check these environments and run the opatch lsinventory command to perform the following operations:
Last login: Fri Jul 30 10:08:59 2010
[Oracle @ wzy01 ~] $ Cd 6139856/# Go To The patch file directory
[Oracle @ wzy01 6139856] $ ls
Etc files README.txt
[Oracle @ wzy01 6139856] $ opatch lsinventory # Use opatch lsinventory to check the environment
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home:/u01/oracle/product/db10gr2
Central Inventory:/u01/oracle/oraInventory
From:/etc/oraInst. loc
OPatch version: 10.2.0.4.2 # opatch version
OUI version: 10.2.0.4.0
OUI location:/u01/oracle/product/db10gr2/oui
Log file location:/u01/oracle/product/db10gr2/export toollogs/opatch/opatch2010-07-30_11-16-12AM.log
Lsinventory Output file location:/u01/oracle/product/db10gr2/export toollogs/opatch/lsinv/lsinventory2010-07-30_11-16-12AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2 ):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0 # major oracle version
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
4.3. Stop the database
During patching, there will be File Overwrite replacement. Therefore, most of the time, the database is required to be closed during patching. Therefore, we need to disable the database instance.
SQL> conn/as sysdba
Connected.
SQL> shutdown immediate
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.
SQL>
4.4. Application Patches
Patch installation is not simple. If there is no problem in the previous environment, run opatch apply directly. The OPATCH tool automatically applies the patch to complete the patch installation, as shown below:
[Oracle @ wzy01 6139856] $ opatch apply # Use opatch apply patch in the patch file directory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home:/u01/oracle/product/db10gr2
Central Inventory:/u01/oracle/oraInventory
From:/etc/oraInst. loc
OPatch version: 10.2.0.4.2
OUI version: 10.2.0.4.0
OUI location:/u01/oracle/product/db10gr2/oui
Log file location:/u01/oracle/product/db10gr2/export toollogs/opatch/opatch2010-07-30_11-16-16AM.log
ApplySession applying interim patch 6139856 to OH/u01/oracle/product/db10gr2
Running prerequisite checks...
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home =/u01/oracle/product/db10gr2)
Is the local system ready for patching? [Y | n] # Check whether the file is updated. Enter Y to update the file.
Y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch 6139856 for restore. This might take a while...
Backing up files affected by the patch 6139856 for rollback. This might take a while...
Patching component oracle. rdbms, 10.2.0.4.0...
Updating archive file "/u01/oracle/product/db10gr2/lib/libn10.a" with "lib/libn10.a/nsev. o"
Updating archive file "/u01/oracle/product/db10gr2/lib32/libn10.a" with "lib32/libn10.a/nsev. o"
Patching component oracle. rdbms. rsf, 10.2.0.4.0...
Updating archive file "/u01/oracle/product/db10gr2/lib/libn10.a" with "lib/libn10.a/nsev. o"
Updating archive file "/u01/oracle/product/db10gr2/lib32/libn10.a" with "lib32/libn10.a/nsev. o"
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch 6139856 to inventory
Verifying the update...
Inventory check OK: Patch ID 6139856 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 6139856 are present in Oracle Home.
The local system has been patched and can be restarted.
OPatch succeeded. # patch update successful
4.5. check and verify
Finally, let's take a look at the patch installation. We can also use the opatch lsinventory command to view the patch installation status, as shown below:
[Oracle @ wzy01 6139856] $ opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home:/u01/oracle/product/db10gr2
Central Inventory:/u01/oracle/oraInventory
From:/etc/oraInst. loc
OPatch version: 10.2.0.4.2
OUI version: 10.2.0.4.0
OUI location:/u01/oracle/product/db10gr2/oui
Log file location:/u01/oracle/product/db10gr2/export toollogs/opatch/opatch2010-07-30_11-23-32AM.log
Lsinventory Output file location:/u01/oracle/product/db10gr2/export toollogs/opatch/lsinv/lsinventory2010-07-30_11-23-32AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2 ):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
Interim patches (1 ):
Patch 6139856: applied on Fri Jul 30 11:21:01 CST 2010
Created on 28 Jul 2008, 01:14:03 hrs PST8PDT
Bugs fixed:
6139856 # Here we can see that the patch has been installed successfully.
--------------------------------------------------------------------------------
OPatch succeeded.
After the patch is installed, restart the database instance and observe for two days. The failure to stop listening seems to prove that the patch is indeed effective.
5. Conclusion
Through the above introduction, we can see that as long as the preparation is complete, the application of ORACLE patches is actually very simple, so we should not be afraid of it, his operations are the same as WINDOWS patch installation. I hope this article will help you in your future work.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.