[Oracle] CPU/PSU Patch Installation Detailed tutorial _oracle

Source: Internet
Author: User
Tags sqlplus

What is CPU/PSU

The full name of the Oracle CPU is critical Patch Update, where Oracle releases a security patch package for each quarter of its products, usually to fix security risks in the product.

The full name of the Oracle PSU is patch Set update,oracle, a patch package that is released quarterly for its products, including bug fixes. Oracle picks up the number of downloads that are downloaded by the user, and the patches that have been validated for lower risk are placed in the PSU per quarter. Each PSU contains not only bug fixes but also the latest CPUs. PSU is usually released along with the CPU.

CPUs are cumulative (cumulative), that is, the latest CPU patches already contain previous CPU patches, so just install the latest CPU patches.
PSU is also usually incremental, most PSU can be installed directly, but some PSU must require the installation of a previous version of the PSU before you can continue to install, to carefully look at each PSU's Readme document.

How to download CPU/PSU

Note: To download CPU/PSU, you must have an Oracle support account!
To the Oracle CPU home page, you can see a list of CPU patches released each quarter (as shown in the following figure), choose the appropriate CPU patch according to your needs, and choose the patch for July2011 year.



Each patch is specific to the database version, you need to find the corresponding database version (shown below), the database version is 11.2.0.1, if not found, the patch does not support the version of the database.



Right click on the database link, which is a detailed description of the patch document, find 3.1.3 Oracle databases, and click on the appropriate version of the DB (as shown in the following figure)


In the corresponding database version, you can see the various platforms under the CPU and PSU version number, previously said, PSU contains CPU, so we recommend to install PSU, note: Here's UNIX platform also includes Linux


Clicking on the version number above will automatically jump to the Oracle support download page, as shown in the following figure. Select the appropriate platform, click on the Readme can see the Readme document, click Download Download

Read the Readme document
Each CPU/PSU has a readme document, all information about the CPU/PSU is in the Readme document and must be read carefully.
There are two parts to pay special attention to:
1 Opatch version, you can view the current Opatch version of Oracle home through the Opatch version command, if less than the minimum version of the Readme, be sure to upgrade opatch before patching.
2 Play Patch step: Basically all CPU/PSU are the same, the concrete steps will be shown in the following example.
Install CPU/PSU Patches
1) Prior inspection: View the database before patching information, keep the scene
It is best to keep some basic information of the database in case of a rainy patch before patching.

Copy Code code as follows:

Set Line 150
Set PageSize 99
Col Action_time for A30
Col Action for A30
Col comments for A90
Col object_name for A30
Col object_type for A30
Col Comp_name for A50
Col comp_id for A20
--View Instance Name
Sys@orcl>select instance_name,status from V$instance;
instance_name STATUS
---------------- ------------
ORCL OPEN
--View Database version
Sys@orcl>select * from V$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition release 11.2.0.1.0-64bit Production
Pl/sql Release 11.2.0.1.0-production
CORE 11.2.0.1.0 Production
TNS for Linux:version 11.2.0.1.0-production
Nlsrtl Version 11.2.0.1.0-production
--View database size
Sys@orcl>select sum (bytes)/1024/1024| | ' M ' from dba_segments;
SUM (BYTES)/1024/1024| | ' M
-----------------------------------------
68058.375M
--View component information
Sys@orcl>select comp_id,comp_name,version,status from Dba_registry;
comp_id comp_name VERSION STATUS
-------------------- -------------------------------------------------- ------------------------------ ----------- -----------
OWB OWB 11.2.0.1.0 VALID
APEX Oracle application Express 3.2.1.00.10 VALID
EM Oracle Enterprise Manager 11.2.0.1.0 VALID
AMD OLAP Catalog 11.2.0.1.0 VALID
SDO Spatial 11.2.0.1.0 VALID
Ordim Oracle Multimedia 11.2.0.1.0 VALID
XDB Oracle XML Database 11.2.0.1.0 VALID
Context Oracle Text 11.2.0.1.0 VALID
EXF Oracle Expression Filter 11.2.0.1.0 VALID
Rul Oracle Rules Manager 11.2.0.1.0 VALID
OWM Oracle Workspace Manager 11.2.0.1.0 VALID
CATALOG Oracle Database CATALOG views 11.2.0.1.0 VALID
Catproc Oracle Database Packages and Types 11.2.0.1.0 VALID
JAVAVM jserver JAVA Virtual Machine 11.2.0.1.0 VALID
XML Oracle XDK 11.2.0.1.0 VALID
Catjava Oracle Database Java Packages 11.2.0.1.0 VALID
APS OLAP analytic Workspace 11.2.0.1.0 VALID
Xoq Oracle OLAP API 11.2.0.1.0 VALID
Rows selected.
--View Patches
Sys@orcl>select Action_time, ACTION, COMMENTS from Sys. Dba_registry_history;
No rows selected
--View Invalid objects
Sys@orcl>select Count (*) from dba_objects where status<> ' VALID ';
COUNT (*)
----------
123
Sys@orcl> Select Object_name,object_type,owner,status from dba_objects where status<> ' VALID ';
Sys@orcl>spool off

2) Back up the database
This is where the entire library is backed up to prevent patches from being accidentally recovered from the backup set.
Turn off the listener, close the database instance, start the Mount state, and then use Rman for cold standby.
3) Backup Oracle Software
Package Oracle Software Backup
4) Installation Opatch
Copy Code code as follows:

--First, view the current Opatch version
[Oracle@data ~]$ Opatch version
Invoking Opatch 11.1.0.6.6
Opatch version:11.1.0.6.6
Opatch succeeded.
-If the current Opatch version is not enough, download the latest opatch, cover the original Opatch can
[Oracle@data psu_jul_2011]$ Unzip P6880880_112000_linux-x86-64.zip
After--unzip, the Opatch folder appears under the current folder
[Oracle@data psu_jul_2011]$ mv $ORACLE _home/opatch $ORACLE _home/opatch_20130705
[Oracle@data psu_jul_2011]$ cp-r/opatch $ORACLE _home
[Oracle@data psu_jul_2011]$ Opatch version
Opatch version:11.2.0.3.4
Opatch succeeded.

5 Installation Patch (Oracle software section)
First, look at the patch information that was previously played through Opatch Lsinventory.
Then unzip the patch file:
Copy Code code as follows:

[Oracle@data psu_jul_2011]$ Unzip P12419378_112010_linux-x86-64.zip
[Oracle@data psu_jul_2011]$ CD 12419378

Finally in the patch of the main directory to perform opatch apply, wait 5-10 minutes (note: Be sure to completely shut down the database and listeners first)
Copy Code code as follows:

[Oracle@data 12419378]$ pwd
/home/oracle/psu_jul_2011/12419378
[Oracle@data 12419378]$ Opatch Apply

If there is warnings in the end there is generally no problem, as long as it is not error.
6) Installation Patch (Database section)
This step is relatively simple, is run Catbundle script, but the time is longer, about 10 minutes (depending on the machine performance depends)
Copy Code code as follows:

CD $ORACLE _home/rdbms/admin
Sqlplus/nolog
Sql> Connect/as SYSDBA
Sql> STARTUP
sql> @catbundle. SQL PSU Apply
Sql> QUIT

7 Recompile CPU related view (if the PSU can be skipped step)
This step is always required to execute once on a database, in order to complete the first release of the CPU patch in January 2008, if you have performed this step in the previous PSU or CPU, then you do not need to perform it again, and the database is functioning even if you do not perform this step. It simply means that the January 2008 CPU patch did not end properly.
Copy Code code as follows:

Sql> SELECT * from registry$history where ID = ' 6452863 ';

The above statement is used to determine whether it has been executed, and if there is a row number returned, the description has already been performed, you can skip this step;
If there is no number of rows to return, you can recompile the CPU/PSU related view based on the following steps:
Copy Code code as follows:

CD $ORACLE _home/cpu/view_recompile
Sqlplus/as SYSDBA
sql> @recompile_precheck_jan2008cpu. sql
Sql> SHUTDOWN IMMEDIATE
Sql> STARTUP UPGRADE
sql> @view_recompile_jan2008cpu. sql
Sql> SHUTDOWN;
Sql> STARTUP;
Sql> QUIT

8) After the examination
This step can be compared with the 1th step in advance check
To compile an invalid object first:
Copy Code code as follows:

@?/rdbms/admin/utlrp.sql

Copy Code code as follows:

Set Line 150
Set PageSize 99
Col Action_time for A30
Col Action for A30
Col comments for A90
Col object_name for A30
Col object_type for A30
Col Comp_name for A50
Col comp_id for A20
Sql> Spool Post_check.log
Sql> select Instance_name,status from V$instance;
Sql> select Comp_id,comp_name,version,status from Dba_registry;
Sql> Select Action_time, ACTION, COMMENTS from Dba_registry_history;
Sql> Select Owner,object_name,object_type,status from dba_objects where status<> ' VALID ';
Sql> Select COUNT (*) from dba_objects where status<> ' VALID ';
Sql> Spool Off

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.