oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

文档课题:oracle 10.2.0.1 64bit升级10.2.0.4 64bit.
数据库:oracle 10.2.0.1 64位
系统:oel 5.11 64位
1、前期准备
1.1、关闭实例
关闭需要升级的实例.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
1.2、关闭相关进程
--关闭监听
[oracle@leo-10g-ogg ~]$ lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-DEC-2022 16:46:31

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
--关闭em
[oracle@leo-10g-ogg ~]$ emctl stop dbconsle
1.3、备份
备份oracle home目录及相关数据文件.
2、升级DB软件
2.1、升级包处理
[root@leo-10g-ogg ~]# mkdir -p /u01/setup/psu
sftp> cd /u01/setup/psu
sftp> lcd F:\installmedium\10g\Linux
sftp> put p6810189_10204_Linux-x86-64.zip
[root@leo-10g-ogg ~]# chown -R oracle:oinstall /u01/setup/psu
[root@leo-10g-ogg ~]# su - oracle
[oracle@leo-10g-ogg ~]$ cd /u01/setup/psu
[oracle@leo-10g-ogg psu]$ unzip -q p6810189_10204_Linux-x86-64.zip
2.2、DB软件升级
[oracle@leo-10g-ogg psu]$ cd Disk1/
[oracle@leo-10g-ogg Disk1]$ export DISPLAY=192.168.133.1:0.0
[oracle@leo-10g-ogg Disk1]$ ./runInstaller

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

注意:指定Oracle Home目录时,依然指定为旧路径.如原 ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1,升级时依然指定为该目录.

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

[root@leo-10g-ogg ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
You have mail in /var/spool/mail/root

oracle 10.2.0.1 64bit升级到10.2.0.4 64bit

点击“exit”.
2.3、数据字典
更新数据字典.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size 2083560 bytes
Variable Size 318768408 bytes
Database Buffers 889192448 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
SQL> spool patch.log
SQL> @?/rdbms/admin/catupgrd.sql --注9i 使用catpatch.sql,耗时9分钟.
.......(省略若干日志记录)
2.4、编译失效对象
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size 2083560 bytes
Variable Size 385877272 bytes
Database Buffers 822083584 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/utlrp.sql
3、验证
升级后验证.
SQL> col comp_name for a40
SQL> col version for a15
SQL> select comp_name,version,status from dba_registry

COMP_NAME VERSION STATUS
---------------------------------------- --------------- ---------------
Oracle Database Catalog Views 10.2.0.4.0 VALID
Oracle Database Packages and Types 10.2.0.4.0 VALID
Oracle Workspace Manager 10.2.0.4.3 VALID
JServer JAVA Virtual Machine 10.2.0.4.0 VALID
Oracle XDK 10.2.0.4.0 VALID
Oracle Database Java Packages 10.2.0.4.0 VALID
Oracle Expression Filter 10.2.0.4.0 VALID
Oracle Data Mining 10.2.0.4.0 VALID
Oracle Text 10.2.0.4.0 VALID
Oracle XML Database 10.2.0.4.0 VALID
Oracle Rule Manager 10.2.0.4.0 VALID

COMP_NAME VERSION STATUS
---------------------------------------- --------------- ---------------
Oracle interMedia 10.2.0.4.0 VALID
OLAP Analytic Workspace 10.2.0.4.0 VALID
Oracle OLAP API 10.2.0.4.0 VALID
OLAP Catalog 10.2.0.4.0 VALID
Spatial 10.2.0.4.0 VALID
Oracle Enterprise Manager 10.2.0.4.0 VALID

17 rows selected.
SQL> select * from utl_recomp_errors;

no rows selected
4、补充操作
--修改兼容性参数
SQL> show parameter compatible

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 10.2.0.1.0
SQL> alter system set compatible='10.2.0.4.0' scope=spfile;

System altered.
--重启数据库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size 2083560 bytes
Variable Size 385877272 bytes
Database Buffers 822083584 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
--如果使用了恢复目录,还需执行以下命令.
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
--升级回退
SQL> STARTUP DOWNGRADE
SQL> SPOOL downgrade.log
SQL> @catdwgrd.sql
Sql>spool off
Sql>shutdown immediate

参考文档:
https://blog.51cto.com/u_15155073/2716067