首页 > 代码库 > 示例Oracle 10.2.0.1.0升级到10.2.0.4.0一例

示例Oracle 10.2.0.1.0升级到10.2.0.4.0一例

1.查看当前系统版本

[oracle@std Disk1]$ sqlplus /as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 15 16:21:40 2015Copyright (c) 1982, 2005, Oracle.  All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining optionsSQL> select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProdPL/SQL Release 10.2.0.1.0 - ProductionCORE    10.2.0.1.0    ProductionTNS for Linux: Version 10.2.0.1.0 - ProductionNLSRTL Version 10.2.0.1.0 - Production

 

以通过以下命令查看数据库位数

[oracle@std Disk1]$ file $ORACLE_HOME/bin/oracle/u02/app/product/10.2.0/db_1/bin/oracle: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

 

2.升级前请仔细阅读升级文档

在此我们把升级包p6810189_10204_Linux-x86.zip上传到数据库服务器 并执行 unzip p6810189_10204_Linux-x86.zip

注意:升级之前备份数据

 

3.停掉ORACLE所有服务

[oracle@std Disk1]$ sqlplus /as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 15 16:26:53 2015Copyright (c) 1982, 2005, Oracle.  All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining optionsSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.
[oracle@std Disk1]$ lsnrctl stop[oracle@std Disk1]$ isqlplusctl stop[oracle@std Disk1]$ emctl stop dbconsole

 

4.执行升级程序包

 

[oracle@std Disk1]$ ./runInstaller Starting Oracle Universal Installer...Checking installer requirements...Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, UnitedLinux-1.0, asianux-1, asianux-2 or asianux-3                                      Failed <<<<Exiting Oracle Universal Installer, log for this session can be found at /u02/oraInventory/logs/installActions2015-01-15_04-34-21PM.log


对上面的问题   http://blog.csdn.net/huashnag/article/details/8528829

 

调出图形界面升级界面:

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

 

以root身份执行脚本:

[root@std ~]# /u02/app/product/10.2.0/db_1/root.shRunning Oracle10 root.sh script...The following environment variables are set as:    ORACLE_OWNER= oracle    ORACLE_HOME=  /u02/app/product/10.2.0/db_1Enter 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]: y   Copying dbhome to /usr/local/bin ...The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y   Copying oraenv to /usr/local/bin ...The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y   Copying coraenv to /usr/local/bin ...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.Successfully accumulated necessary OCR keys.Creating OCR keys for user root, privgrp root..Operation successful.Configuration for local CSS has been initializedAdding to inittab Startup will be queued to init within 30 seconds.Checking the status of new Oracle init process...Expecting the CRS daemons to be up within 600 seconds.CSS is active on these nodes.    stdCSS is active on all nodes.Oracle CSS service is installed and running under init(1M)

技术分享

 

5.执行升级后续脚本

[oracle@std Disk1]$ sqlplus /as sysdbaSQL*Plus: Release 10.2.0.4.0 - Production on Fri Jan 16 10:31:02 2015Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.Connected to an idle instance.SQL> startup upgradeORACLE instance started.Total System Global Area  608174080 bytesFixed Size            1268896 bytesVariable Size          163578720 bytesDatabase Buffers      436207616 bytesRedo Buffers            7118848 bytesDatabase mounted.Database opened.SQL> @?/rdbms/admin/catupgrd.sql 
。。。。。。。。。。。。。。。。。。。。。。

执行完脚本正常关闭数据库重启查看版本:

SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area  608174080 bytesFixed Size                  1268896 bytesVariable Size             197133152 bytesDatabase Buffers          402653184 bytesRedo Buffers                7118848 bytesDatabase mounted.Database opened.SQL> select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - ProdPL/SQL Release 10.2.0.4.0 - ProductionCORE    10.2.0.4.0    ProductionTNS for Linux: Version 10.2.0.4.0 - ProductionNLSRTL Version 10.2.0.4.0 - Production
SQL> show parameter compati    NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------compatible                           string      10.2.0.1.0plsql_v2_compatibility               boolean     FALSESQL> alter system set compatible=10.2.0.4.0 scope=spfile;SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area  608174080 bytesFixed Size                  1268896 bytesVariable Size             197133152 bytesDatabase Buffers          402653184 bytesRedo Buffers                7118848 bytesDatabase mounted.Database opened.SQL> show parameter compatNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------compatible                           string      10.2.0.4.0plsql_v2_compatibility               boolean     FALSE

 

升级的一个总过程顺序:

技术分享

 

示例Oracle 10.2.0.1.0升级到10.2.0.4.0一例