【Oracle】10.2.0.1升级到10.2.0.5

升级数据库到10.2.0.5
 
因是测试环境,不需要备份;如是生产系统,建议进行全备份后再进行升级操作,预防数据丢失造成不必要的影响。
 
步骤: 上传并解压补丁,安装前准备,安装补丁,预升级检查,字典信息升级,重新编译无效 PL/SQL 包,检查升级是否成功,其他升级。补丁包编号为:p8202632_10205_Linux-x86-64.zip
 
1.1     上传并解压补丁
具体操作省略,使用 FTP 上传补丁包,再解压即可,如使用 unzip 解压 zip 压缩包。
 
1.2     安装前准备
停止所有与数据库相关的进程
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
SQL> SHUTDOWN IMMEDIATE
 
1.3     安装补丁(图形界面)
运行安装脚本
$ ./runInstaller
如果提示说不是红帽或者xx系统的话,可以这么执行:
./runInstaller -ignoreSysPrereqs
执行后,如无意外会弹出安装界面如下,默认, next


  
注意这里的路径跟之前安装的软件路径一样, next

 
默认, next

 
默认, next

 
install 开始安装补丁

 
开始安装,安装到后面需要用 root 执行一个脚本


弹出需要执行的窗口


打开一个终端,切换到 root 用户,执行即


点击 ok 完成安装,单击 Exit 退出。


1.4    预升级检查
先连接到 oracle 环境,使用 startup upgrade 打开数据库。
$ sqlplus / as sysdba
SQL> startup upgrade
ORACLE instance started.
 
Total System Global Area  599785472 bytes
Fixed Size                  2085840 bytes
Variable Size             180358192 bytes
Database Buffers          411041792 bytes
Redo Buffers                6299648 bytes
Database mounted.
Database opened.
SQL> SPOOL upgrade_info.log
SQL> @?/rdbms/admin/utlu102i.sql
Oracle Database 10.2 Upgrade Information Utility    06-13-2017 06:07:29
.
**********************************************************************
Database:
**********************************************************************
--> name:       ORCL
--> version:    10.2.0.1.0
--> compatible: 10.2.0.1.0
--> blocksize:  8192
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 486 MB
.... AUTOEXTEND additional space required: 6 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 401 MB
.... AUTOEXTEND additional space required: 376 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 252 MB
.... AUTOEXTEND additional space required: 12 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 58 MB
.... AUTOEXTEND additional space required: 38 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
.
 
PL/SQL procedure successfully completed.
SQL> SPOOL OFF
 
1.5    数据库字典信息升级
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
… … …
SQL> SPOOL OFF
这个会运行比较久,约 10-30 分钟左右。运行完后,检查 patch.log 文件,如果有问题,重新运行 catupgrd.sql
 
1.6     重新编译无效PL/SQL包
 
SQL> @?/rdbms/admin/utlrp.sql
 
1.7     检查升级是否成功
SQL> COL COMP_NAME FOR A50
SQL> COL VERSION FOR A12
SQL> COL STATUS FOR A12
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
如果 STATUS 全部是 VALID ,表示升级成功。

COMP_NAME VERSION STATUS
-------------------------------------------------- ------------ ------------
Oracle Database Catalog Views 10.2.0.5.0 VALID
Oracle Database Packages and Types 10.2.0.5.0 VALID
Oracle Workspace Manager 10.2.0.5.0 VALID
JServer JAVA Virtual Machine 10.2.0.5.0 VALID
Oracle XDK 10.2.0.5.0 VALID
Oracle Database Java Packages 10.2.0.5.0 VALID
Oracle Expression Filter 10.2.0.5.0 VALID
Oracle Data Mining 10.2.0.5.0 VALID
Oracle Text 10.2.0.5.0 VALID
Oracle XML Database 10.2.0.5.0 VALID
Oracle Rule Manager 10.2.0.5.0 VALID
Oracle interMedia 10.2.0.5.0 VALID
OLAP Analytic Workspace 10.2.0.5.0 VALID
Oracle OLAP API 10.2.0.5.0 VALID
OLAP Catalog 10.2.0.5.0 VALID
Spatial 10.2.0.5.0 VALID
Oracle Enterprise Manager 10.2.0.5.0 VALID
 
1.8     其他升级
选择性升级
$ emca -upgrade db
STARTED EMCA at Jun 15, 2017 6:28:51 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
ORACLE_HOME for the database to be upgraded: /u01/app/oracle/product/10.2.0/db_1
Database SID: orcl
Listener port number: 1521
Do you wish to continue? [yes(Y)/no(N)]: y
……
 
如果使用 Oracle Recovery Manager catalog, 需要对 catalog 进行升级,如下 :
$ rman catalog username/ [email protected]
RMAN> UPGRADE CATALOG;