ITPub博客

首页 > 数据库 > Oracle > HPUX oracle 10G patch作业

HPUX oracle 10G patch作业

原创 Oracle 作者:wwjfeng 时间:2019-06-27 19:56:56 0 删除 编辑

一.备份

1.备份数据库

2.备份ORACLE_HOME

3.记录升级前组件和无效对象信息

 SQL> spool registry_before.log
 SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
 SQL> spool off
 SQL> spool object_before.log
 SQL> select owner, object_name, status from dba_objects where status <> 'VALID' order by 1;
 SQL> spool off


二.patchset(10.2.0.4->10.2.0.5)

1.关闭数据库&监听器

lsnrctl stop
SQL> shutdown immediate
#ps -ef |grep lsnr
#ps -ef |grep ora_


2.检查环境变量

$ ORACLE_HOME=Oracle_home
$ ORACLE_SID=sid
$PATH=$ORACLE_HOME/bin:$ORACLE_HOME/bin/OPatch:$PATH


3.安装patchset

(1).图形化界面安装

$ unzip p8202632_10205_HPUX-IA64.zip
$ cd patchset_directory/Disk1
$ ./runInstaller





*When prompted, run the $ORACLE_HOME/root.sh script as the root user.



(2).修改权限

$ cd $ORACLE_HOME/install
$ sh changePerm.sh


(3).升级前检查

SQL> startup upgrade
SQL> SPOOL upgrade_info.log           
SQL> @?/rdbms/admin/utlu102i.sql   
SQL> SPOOL OFF

确认所有组件为valid

SQL> @?/rdbms/admin/utlu102i.sql
Oracle Database 10.2 Upgrade Information Utility    10-01-2018 10:14:42         
.                                                                               
**********************************************************************          
Database:                                                                       
**********************************************************************          
--> name:       HISDB                                                           
--> version:    10.2.0.4.0                                                      
--> compatible: 10.2.0.3.0                                                      
--> blocksize:  8192                                                            
.                                                                               
**********************************************************************          
Tablespaces: [make adjustments in the current environment]                      
**********************************************************************          
--> SYSTEM tablespace is adequate for the upgrade.                              
.... minimum required size: 997 MB                                              
--> SYSAUX tablespace is adequate for the upgrade.                              
.... minimum required size: 692 MB                                              
--> TEMP tablespace is adequate for the upgrade.                                
.... minimum required size: 58 MB                                               
--> UNDOTBS2 tablespace is adequate for the upgrade.                            
.... minimum required size: 64 MB                                               
.                                                                               
**********************************************************************          
Update Parameters: [Update Oracle Database 10.2 init.ora or spfile]             
**********************************************************************          
-- No update parameter changes are required.                                    
.                                                                               
**********************************************************************          
Renamed Parameters: [Update Oracle Database 10.2 init.ora or spfile]            
**********************************************************************          
-- No renamed parameters found. No changes are required.                        
.                                                                               
**********************************************************************          
Obsolete/Deprecated Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************          
-- No obsolete parameters found. No changes are required                        
.                                                                               
**********************************************************************          
Components: [The following database components will be upgraded or installed]   
**********************************************************************          
--> Oracle Catalog Views         [upgrade]  VALID                               
--> Oracle Packages and Types    [upgrade]  VALID                               
--> JServer JAVA Virtual Machine [upgrade]  VALID                               
--> Oracle XDK for Java          [upgrade]  VALID                               
--> Oracle Java Packages         [upgrade]  VALID                               
--> Oracle Text                  [upgrade]  VALID                               
--> Oracle XML Database          [upgrade]  VALID                               
--> Oracle Workspace Manager     [upgrade]  VALID                               
--> Oracle Data Mining           [upgrade]  VALID                               
--> OLAP Analytic Workspace      [upgrade]  VALID                               
--> OLAP Catalog                 [upgrade]  VALID                               
--> Oracle OLAP API              [upgrade]  VALID                               
--> Oracle interMedia            [upgrade]  VALID                               
--> Spatial                      [upgrade]  VALID                               
--> Expression Filter            [upgrade]  VALID                               
--> EM Repository                [upgrade]  VALID                               
--> Rule Manager                 [upgrade]  VALID                               
.                                                                               
**********************************************************************          
Miscellaneous Warnings                                                          
**********************************************************************          
WARNING: --> Database contains INVALID objects prior to upgrade.                
.... USER LXY has 1 INVALID objects.                                            
.... USER MONITOR has 1 INVALID objects.                                        
.... USER MD_MESPRD has 1 INVALID objects.                                      
.... USER PKG_MESPRD has 1 INVALID objects.                                     
.... USER ADMIN has 1 INVALID objects.                                          
.                                                                               
PL/SQL procedure successfully completed.


(4).升级数据字典

SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql 
SQL> SPOOL OFF

确认patch.log 无error


(5).重启DB并编译无效对象

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
SQL> @?/rdbms/admin/utlrp.sql


(6).确认组件状态及无效对象

与之前记录一致即可。


三.PSU(10.2.0.5.13)

1.opatch upgrade

(1).下载最新的OPatch 工具

(2).备份OPatch目录

$ cd $ORACLE_HOME

$ cp -R OPatch OPatch_bak

(3).删除原opatch目录下文件

$ cd $ORACLE_HOME/OPatch

$ rm -rf *

(4).安装opatch

unzip p6880880_102000_HPUX-IA64.zip -d $ORACLE_HOME


2.Patch Pre-Installation

(1).环境变量检查

Ensure that the $PATH definition has the following executables: make, ar, ld, and nm.

export PATH=$PATH:/usr/ccs/bin


(2).冲突检查

unzip p17082365_10205_HPUX-IA64.zip

opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./17082365


3.Patch Installation

(1).安装

unzip p17082365_10205_HPUX-IA64.zip

cd 17082365

opatch apply


(2).Loading Modified SQL Files into the Database

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> -- Execute the next statement only if this is the first PSU applied for 10.2.0.5 or this is the first PSU applied since 10.2.0.5.3.
SQL> @utlrp.sql
SQL> QUIT


(3).Check the following log files in $ORACLE_HOME/cfgtoollogs/catbundle or $ORACLE_BASE/cfgtoollogs/catbundle for any errors:

catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log

catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log


四.interim patch 安装

$ unzip patch_name.zip
$ cd patch_no/
$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
$ opatch apply
$ opatch apply
Invoking OPatch 10.2.0.5.1
 
Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /oracle/product/10.2.0/db_1
Central Inventory : /oracle/oraInventory
   from           : /var/opt/oracle/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.5.0
OUI location      : /oracle/product/10.2.0/db_1/oui
Log file location : /oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2018-09-27_10-08-02AM.log
 
Patch history file: /oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
 
ApplySession applying interim patch '5519322' to OH '/oracle/product/10.2.0/db_1'
 
Running prerequisite checks...
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 
 
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  
Email address/User Name: 
 
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y
 
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 = '/oracle/product/10.2.0/db_1')
 
 
Is the local system ready for patching? [y|n]
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 '5519322' for restore. This might take a while...
Backing up files affected by the patch '5519322' for rollback. This might take a while...
 
Patching component oracle.rdbms, 10.2.0.5.0...
Updating archive file "/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kkpod.o"
Updating archive file "/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kdic.o"
Running make for target ioracle
 
 
 
 
ApplySession adding interim patch '5519322' to inventory
 
Verifying the update...
Inventory check OK: Patch ID 5519322 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 5519322 are present in Oracle Home.
 
The local system has been patched and can be restarted.
 
 
OPatch succeeded.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15412087/viewspace-2215514/,如需转载,请注明出处,否则将追究法律责任。

上一篇: merge改写update
请登录后发表评论 登录
全部评论

注册时间:2010-03-27

  • 博文量
    146
  • 访问量
    91430