返回列表 回复 发帖

教你"傻瓜式"升级oracle9.2.0.5->9.2

用以下方法做了好几个升级了。。
oracle9.2.0.5->9.2.0.7 升级全过程(对可能牵扯到公司的信息,做了修改)
- 9207 Patch Installation
- OPatch Utility Tool Installation
- Security&BUG Patch Installation

########OPatch Utility Tool Installation #######
注意: 一定要确认perl 工具和java的版本
[TESTracle] /home/oracle/patch> id
uid=301(oracle) gid=201(dba)
[TEST:oracle] /home/oracle/patch>cp p2617419_10102_GENERIC.zip /p01/oracle/app/product/9.2.0/
[TEST:oracle] /home/oracle/patch> cd $ORACLE_HOME
[TEST:oracle] /p01/oracle/app/product/9.2.0> which perl
/usr/bin/perl
[TEST:oracle] /p01/oracle/app/product/9.2.0> which unzip
/usr/local/bin/unzip
[TEST:oracle] /p01/oracle/app/product/9.2.0>unzip p2617419_10102_GENERIC.zip
[TEST:oracle] /p01/oracle/app/product/9.2.0> ls -l
drwxr-xr-x 5 oracle dba 256 Jan 24 2006 OPatch/
[TEST:oracle] /p01/oracle/app/product/9.2.0> cd
[TEST:oracle] /home/oracle> vi .profile
PATH=$PATHORACLE_HOME/bin:/usr/bin:/etc:/usr/lbin:/usr/bin/X11:/usr/local/bin; export PATH ->
PATH=$ORACLE_HOME/OPatch:$PATH:$ORACLE_HOME/bin:/usr/bin:/etc:/usr/lbin:/usr/bin/X11:/usr/local/bin; export
[TEST:oracle] /home/oracle> . .profile
[TEST:oracle] /home/oracle> opatch version
Oracle Interim Patch Installer version 1.0.0.0.55
Copyright (c) 2006 Oracle Corporation. All Rights Reserved..
We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com
OPatch Version: 1.0.0.0.55
============================ I have finished OPatch Utilty Tool Installation.=======================

########## 9.2.0.7 Patch Installtion #############################
安装前准备
1. 确认安装前DB 的COLD 备份是否是可用的。。
2. 提前下载9207 安装补丁包
 - 9207 安装补丁包p4163445_92070_AIX64-5L.zip,941M,
- CPU Security Patch:4751923
- Group by BUG Patch:4573980
- OPatch (version:55) p2617419_10102_GENERIC.zip

3. 安装前一定要把数据库和监听 全停掉
sqlplus "/as sysdba"
sql>shutdown immediate
lsnrctl stop LISTENER
ps -ef | grep ora_
ps -ef | grep tns
4. 安装前一定要验证dba_objects 的"INVALID" 个数,以便安装补丁后对比
- SQL>select count(*) from dba_objects
where status ='INVALID'

5. 安装前一定要修改SHARED_POOL_SIZE 和JAVA_POOL_SIZE 必须都大于150M以上
- vi cd $ORACLE_HOME/dbs/initTEST.ora
6. 注销掉initTEST.ora 中 _old_connect_by_enable 参数
7. /etc/oraInst.loc 文件确认! #### 如果,是几个数据库在同一个服务器里,相当重要!!!!! 切记!!
  - 文件属性确认,应该是root:system
ls -l /etc/oraInst.loc
- oraInst.loc 内文件内容确认,inventory 路径一定是要升级的数据库的路径
 例如:/p01/oracle/app/product/inventory
8. /etc/oratab 文件确认! #### 如果,是几个数据库在同一个服务器里,相当重要!!!!! 切记!!
- 文件属性确认,应该是oracle:system (要升级数据库的DBA 用户)
ls -l /etc/oratab 
chown -R oracle:dba /etc/oratab
9.OPatch Path 的确认
  -/home/oracle/.profile 中OPatch Path 增加
10. Clear Memory,必须是 root user exec
# /usr/sbin/slibclean
## XWindows
XWindows login
oracle/passwd

$export DISPLAY=150.150.20.80:0.0
$xclock
$cd /p14/POPupgrade/Disk1/
$./runInstaller
rootpre.sh 文件的解决。异步I/O的确认。。

出现如下错误。
$ORACLE_HOME/bin/libjox9.a
解决方法:
ls -l libjox9.a
mv libjox9.a
retry
When prompted, run the $ORACLE_HOME/root.sh script as the root user
#### oracle user login
Start the Oracle Net listener as follows:
$ lsnrctl start
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP MIGRATE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catpatch.sql
SQL> SPOOL OFF
Review the patch.log file for errors and inspect the list of components that is displayed at the end of catpatch.sql script.
This list provides the version and status of each SERVER component in the database.
Restart the database:
SQL> SHUTDOWN
SQL> STARTUP
SQL>select count(*) from dba_objects
where status ='INVALID'
SQL> @?/rdbms/admin/utlrp.sql
SQL>select count(*) from dba_objects
where status ='INVALID'
If Oracle Internet Directory release 9.2.0 is installed in the Oracle home, run the following shell script:

Note:
Make sure that the database and database listener are running, and all parameters for the oidpatchca.sh script are specified before running the script.

$ORACLE_HOME/bin/oidpatchca.sh
-connect Connect_String
-lsnrport Listener_Port
-systempwd SYSTEM_Password
-odspwd ODS_Password
-sudn Super-User_DN
-supwd Super-User_Password
-dippwd Password_to_register_DIP_Server
mod_plsql Postinstallation Steps
Complete the following steps only if mod_plsql is installed. The following steps should be repeated with all the database instances associated with this 9.2.0.7 Oracle home.
Run owa_patch.sql to update owa packages from mod_plsql patch directory:
Change to the $ORACLE_HOME/Apache/modplsql/patch directory. For example,
$ cd $ORACLE_HOME/Apache/modplsql/patch
Connect to the database instance as sysdba:
$ sqlplus " / as sysdba"
SQL> @@owa_patch.sql
Check owa_patch_sid.log file for any errors.
Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.
SQL> @?/rdbms/admin/utlrp.sql

#### Bug and Security Patch Installation ###########################33
- 4573980 Group by Bug Patch
- 4751923 Security Patch
- 一定先打CPU 的安全补丁,然后再打另外一个补丁。
- 需要重新安装OPATCH ,因为9207升级完毕后,版本变成了52
- 做OPATCH 前一定把LISENTER 和DB DOWN

[TEST:oracle] /home/oracle/patch> unzip p4751923_92070_AIX64-5L.zip
$cd 4751923
$opatch apply
Note: Due to changes in the installation scripts, it is no longer a requirement to startup the database in MIGRATE mode.
cd $ORACLE_HOME/cpu/CPUJan2006
sqlplus /nolog
SQL> connect / as sysdba
SQL> STARTUP
SQL> @catcpu.sql
SQL> QUIT
Please note that for large numbers of objects, this compilation step can take some time.
If this patch is being applied through the EntERPrise Manager console, you will be prompted to run this compilation script. )
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> connect / as sysdba
SQL>select count(*) from dba_objects
where status ='INVALID'
SQL> @utlrp.sql
SQL>select count(*) from dba_objects
where status ='INVALID'
SQL> select OBJECT_NAME from DBA_OBJECTS where status = 'INVALID';
To de-install the patch, set your current directory to the directory where the patch is located and then run opatch by entering the following command:
cd 4751923
opatch rollback -id 4751923

[TEST:oracle] /home/oracle/patch> unzip p4573980_92070_AIX64-5L.zip
[TEST:oracle] /home/oracle/patch> cd 4573980/
[TEST:oracle] /home/oracle/patch/4573980>opatch apply
[TEST:oracle] /home/oracle/patch/4573980>opatch lsinventory
#####Patch Deinstallation Instructions ###
$opatch rollback -id  4573980
[TEST:oracle] /home/oracle/patch> unzip p4573980_92070_AIX64-5L.zip
[TEST:oracle] /home/oracle/patch> cd 4573980/
[TEST:oracle] /home/oracle/patch/4573980>opatch apply
[TEST:oracle] /home/oracle/patch/4573980>opatch lsinventory

#### 最后的确认#########################33
- PL/SQL ,确认到底是哪几个DBA_OBJECTS是INVALID的,要根据自己的经验和和开发人员协助判断
- 把升级前的修改的initSID.ora对应的参数修改过去。
- 登陆到相关的APPLICATION 确认 正常与否。
- 及时的对数据库做一次全COLD 备份
-

[ 本帖最后由 old_pig 于 2006-9-16 05:10 AM 编辑 ]
绝对原创! 请支持原创!!
支持原創
返回列表