How I installed the CPU 2009 on HP-UNIX



I followed the Metalink note 835649.1 "Critical Patch Update July 2009 Patch Availability Document for Oracle Products" in order to find out which patches were available for HP UNIX databases.

As we are running Oracle 10.2.0.4 the matrix offered the patch id 8534387; the steps are described in the accompaining readme.txt

1. move to the patch directory and run "opatch napply -skip_subset -skip_duplicate"


cd /oracle/product/10.2.0/CPU2009/8534387

Make sure that all the Oracle processes accessing the ORACLE_HOME have been stopped; this includes all the instances for that ORACLE_HOME.

$ORACLE_HOME/OPatch/opatch napply -skip_subset -skip_duplicate

Invoking OPatch 10.2.0.4.3
Oracle Interim Patch Installer version 10.2.0.4.3
Copyright (c) 2007, Oracle Corporation.  All rights reserved.

UTIL session

Oracle Home       : /oracle/product/10.2.0
Central Inventory : /oracle/oraInventory
   from           : /var/opt/oracle/oraInst.loc
OPatch version    : 10.2.0.4.3
OUI version       : 10.2.0.4.0
OUI location      : /oracle/product/10.2.0/oui
Log file location : /oracle/product/10.2.0/cfgtoollogs/opatch/opatch2009-08-12_11-51-06AM.log

Invoking utility "napply"
Checking conflict among patches...
Checking if Oracle Home has components required by patches...
Checking skip_duplicate
Checking skip_subset
Checking conflicts against Oracle Home...
OPatch continues with these patches:    7155248   7155249   7155250   7155251   7155252   7155253   7155254   7197583   7375611   7375613   7375617   7609057   7609058   8309587   8309592   8309623   8309632   8309637   8309642   8534387   8568395   8568397   8568398   8568402   8568404   8568405

Do you want to proceed? [y|n]
y
User Responded with: Y
Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

A lengthy output is generated ... At the end of opatch a message similar to the following will be displayed.
--------------------------------------------------------------------------------

Execution of 'sh /oracle/product/10.2.0/CPU2009/8534387/8534387/custom/scripts/post -apply 8534387 ':

Return Code = 0

The local system has been patched and can be restarted.

UtilSession: N-Apply done.

OPatch succeeded.
[ /oracle/product/10.2.0/CPU2009/8534387 ]

2. Execute catbundle.sql cpu apply

cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
startup
@catbundle.sql cpu apply
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/oracle/product/10.2.0/cfgtoollogs/catbundle/catbundle_CPU_CZSTDV1_APPLY_2009Aug12_14_27_23.log

3. Recompile the views, if not done in previous CPU patching



Note that the script to be run is called view_recompile_jan2008cpu.sql independently on the patch version (in this article, Jul 2009)
cd /oracle/product/10.2.0/cpu/view_recompile 
[ oracle@london81 ] [ ksh ]: sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 12 14:30:01 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @recompile_precheck_jan2008cpu.sql

Running precheck.sql...

Number of views to be recompiled :1954
-----------------------------------------------------------------------

Number of objects to be recompiled :4996
Please follow the README.txt instructions for running viewrecomp.sql

PL/SQL procedure successfully completed.

sqlplus / as sysdba
startup upgrade 
Database mounted.
Database opened.
SQL> set timing on
SQL> @view_recompile_jan2008cpu.sql

... ... ...
Elapsed: 00:00:00.01
No. of Invalid Objects is :1447
Please refer to README.html to for instructions on validating these objects

PL/SQL procedure successfully completed.
shutdown immediate
startup


SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2009-08-12 14:43:48

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.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2009-08-12 14:48:22


PL/SQL procedure successfully completed.

DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). 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
-------------------
                  1

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


PL/SQL procedure successfully completed.

SQL>  select owner, count(*)  from dba_objects where status = 'INVALID'
  2   group by owner;

OWNER                            COUNT(*)
------------------------------ ----------
FLOWS_020000                            1



PL/SQL procedure successfully completed.

SQL>  SELECT ACTION_TIME, ACTION, COMMENT FROM registry$history where ID = '6452863';

ACTION_TIME                  ACTION  COMMENT
---------------------------- ------- ---------------------
12-AUG-09 02.58.38.421467 PM CPU     view recompilation



As a result of the CPU Jul 2009, I have noticed that the database console uses https instead of http
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 13, 2009 11:20:01 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/product/10.2.0/cfgtoollogs/emca/TSIGPRD1/emca_2009-08-13_11-19-13-AM.log.
Aug 13, 2009 11:20:05 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Aug 13, 2009 11:20:18 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 13, 2009 11:24:12 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 13, 2009 11:24:17 AM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for london27.local.se
Aug 13, 2009 11:24:20 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 13, 2009 11:26:11 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 13, 2009 11:26:11 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 13, 2009 11:28:04 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 13, 2009 11:28:04 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: The Database Control URL is https://london27.local.se:5502/em 
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 13, 2009 11:28:04 AM

Rate this note ...
Useless Poor Average Good Very helpful