Update ORACLE from 10.2.0.1 to 10.2.0.4

ORACLE 10.2.0.1 升级至10.2.0.4

环境:
OS: RHEL5U1 32bit
DATABASE: ORACLE 10.2.0.1 32bit

一、root 用户任务
先用sftp把数据包p6810189_10204_Linux-x86.zip 上传到oracle 服务器上的/opt目录
unzip p6810189_10204_Linux-x86.zip
chown oracle.oinstall -R Disk1/

二、oracle用户
env | grep ORACLE
ORACLE_SID=orcl
ORACLE_BASE=/opt/oracle
ORACLE_TERM=xterm
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1

select * from v$version; 获取版本信息
select name from v$datafile; 获取数据文件信息
select member from v$logfile; 获取日志文件信息
select name from v$controlfile;控制文件信息
archive log list 归档模式信息
select name from v$archived_log; 归档文件信息


1.停止数据库以及相关服务
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop

sqlplus / as sysdba
shutdown immediate

2.冷备数据库
备份 数据 日志 控制
cd /opt/oracle/oradata
cp -a orcl/ back
备份 口令文件、spfile
cd $ORACLE_HOME/dbs
cp -a orapworcl /opt/oracle/oradata/back/
cp -a spfileorcl.ora /opt/oracle/oradata/back/

3.配置并运行安装脚本

3.1此处采用静默安装
cd /opt/Disk1/
3.1.1创建应答文件
cd response/
cp -a patchset.rsp orcl.rsp
==============================
相关路径一定要对 否则会报OUI-10203错误

模板中修改如下选项,其它保持不变:
UNIX_GROUP_NAME=oinstall
--安装用户组
FROM_LOCATION=/orapatch/Disk1/stage/products.xml
--patch包的products.xml路径
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_HOME_NAME=OraDb10g_home1

确认ORACLE_HOME_NAME选项稍微麻烦点,通过查看/etc/oraInst.loc中inventory_loc值的指向的

central inventory>/ContentsXML/inventory.xml
我的是/u01/app/oracle/oraInventory/ContentsXML/inventory.xml
# less /u01/app/oracle/oraInventory/ContentsXML/inventory.xml
找到
此处的OraDb10g_home1就是上面ORACLE_HOME_NAME选项的值。
================================
3.1.2 运行脚本
$ cd /opt/Disk1
$ ./runInstaller -silent -responseFile /opt/Disk1/response/orcl.rsp
================================
执行完后会提示:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script. to run
/u01/app/oracle/product/10.2.0/db_1/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts

The installation of Oracle Database 10g Release 2 Patch Set 3 was successful
================================
3.1.3 以root身份运行/u01/app/oracle/product/10.2.0/db_1/root.sh

4.手工升级数据库
4.1确认环境变量
$ env | grep ORACLE
ORACLE_SID=orcl
ORACLE_BASE=/opt/oracle
ORACLE_TERM=xterm
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1

4.2运行utlu102i.sql 和 catupgrd.sql脚本
4.2.1.启动数据库的upgrade 模式
SQL> STARTUP UPGRADE
4.2.2.设置日志
SQL> SPOOL upgrade_info.log
4.2.3.运行升级前信息工具
SQL> @?/rdbms/admin/utlu102i.sql
4.2.4.关闭日志输出
SQL> SPOOL OFF
4.2.5启动监听
lsnrctl start
4.26.运行catupgrd.sql脚本
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
4.2.6.检查path.log中的错误 如果有错误重新运行catupgrd.sql

5.重新启动数据库
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

6.重新编译无效的对象
SQL> @?/rdbms/admin/utlrp.sql

7.检查组件的升级情况
SQL>select * from UTL_RECOMP_ERRORS;

SQL> col comp_name format a30
SQL> col version format a20
SQL> col status format a20
SQL> set line 200
SQL> select comp_name, version, status from sys.dba_registry;

8.配置OEM
emca -upgrade db
会让提供 ORACLE_HOME
SID
Listener port number


参考
byfree的个人空间
ixDBA.net

转载于:https://www.cnblogs.com/storymedia/archive/2009/03/29/4436221.html

你可能感兴趣的:(Update ORACLE from 10.2.0.1 to 10.2.0.4)