oracle 数据库从10.2.0.4升级到11.2.0.3

       环境:linux 5.4  红帽双机(RHCS)
              数据库:  10.2.0.4
     前期准备:在两台机器的相同目录下安装11.2.0.3的数据库软件,别安装在以前的10G目录下。
      一、停双机,挂存储
            service  rgmanager  stop
            service  cman  stop
            mount /dev/arc_vg01/arc_lv01 /oradata
            mount /dev/oralnx_vg01/ora_lv01 /oradata/oralnx
            mount /dev/oralnx_vg01/ora_lv02 /oradata/lbsdata
            mount /dev/lbsdata_vg01/lbs_lv01 /oradata/lbsdata01
            mount /dev/lbsdata_vg02/lbs_lv02 /oradata/lbsdata02
            mount /dev/lbsdata_vg03/lbs_lv03  /oradata/lbsdata03
            mount /dev/lbsdata_vg04/lbs_lv04 /oradata/lbsdata04
       二、启动数据库
            su - oracle
            sqlplus / as sysdba
            startup;
        三、做测试前的准备
     在11G的安装目录下,运行utlu112i.sql,进行升级前的检查。      

SQL> @/home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/utlu112i.sql
Oracle Database 11.2 Pre-Upgrade Information Tool 07-21-2014 14:10:21
Script Version: 11.2.0.3.0 Build: 001
.
**********************************************************************
Database:
**********************************************************************
--&gt name:          ORALNX
--&gt version:       10.2.0.4.0
--&gt compatible:    10.2.0.3.0
--&gt blocksize:     8192
--&gt platform:      Linux x86 64-bit
--&gt timezone file: V4
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--&gt SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 9551 MB
--&gt UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 400 MB
--&gt SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 19398 MB
--&gt TEMP tablespace is adequate for the upgrade.
.... minimum required size: 60 MB
.
**********************************************************************
Flashback: OFF
**********************************************************************
**********************************************************************
Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]
Note: Pre-upgrade tool was run on a lower version 64-bit database.
**********************************************************************
--&gt If Target Oracle is 32-Bit, refer here for Update Parameters:
-- No update parameter changes are required.
.

--&gt If Target Oracle is 64-Bit, refer here for Update Parameters:
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
--&gt background_dump_dest         11.1       DEPRECATED   replaced by  "diagnostic_dest"
--&gt user_dump_dest               11.1       DEPRECATED   replaced by  "diagnostic_dest"
.

**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
--&gt Oracle Catalog Views         [upgrade]  VALID
--&gt Oracle Packages and Types    [upgrade]  VALID
--&gt JServer JAVA Virtual Machine [upgrade]  VALID
--&gt Oracle XDK for Java          [upgrade]  VALID
--&gt Oracle Workspace Manager     [upgrade]  VALID
--&gt OLAP Analytic Workspace      [upgrade]  VALID
--&gt OLAP Catalog                 [upgrade]  VALID
--&gt EM Repository                [upgrade]  VALID
--&gt Oracle Text                  [upgrade]  VALID
--&gt Oracle XML Database          [upgrade]  VALID
--&gt Oracle Java Packages         [upgrade]  VALID
--&gt Oracle interMedia            [upgrade]  VALID
--&gt Spatial                      [upgrade]  VALID
--&gt Data Mining                  [upgrade]  VALID
--&gt Expression Filter            [upgrade]  VALID
--&gt Rule Manager                 [upgrade]  VALID
--&gt Oracle OLAP API              [upgrade]  VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --&gt Database is using a timezone file older than version 14.
.... After the release migration, it is recommended that DBMS_DST package
.... be used to upgrade the 10.2.0.4.0 database timezone version
.... to the latest version which comes with the new release.
WARNING: --&gt Database contains INVALID objects prior to upgrade.
.... The list of invalid SYS/SYSTEM objects was written to
.... registry$sys_inv_objs.
.... The list of non-SYS/SYSTEM objects was written to
.... registry$nonsys_inv_objs.
.... Use utluiobj.sql after the upgrade to identify any new invalid
.... objects due to the upgrade.
.... USER JSHX has 5 INVALID objects.
.... USER LBS has 83 INVALID objects.
.... USER SPOT has 11 INVALID objects.
WARNING: --&gt EM Database Control Repository exists in the database.
.... Direct downgrade of EM Database Control is not supported. Refer to the
.... Upgrade Guide for instructions to save the EM data prior to upgrade.
WARNING: --&gt Your recycle bin contains 65 object(s).
.... It is REQUIRED that the recycle bin is empty prior to upgrading
.... your database.  The command:
        PURGE DBA_RECYCLEBIN
.... must be executed immediately prior to executing your upgrade.
.
**********************************************************************
Recommendations
**********************************************************************
Oracle recommends gathering dictionary statistics prior to
upgrading the database.
To gather dictionary statistics execute the following command
while connected as SYSDBA:

    EXECUTE dbms_stats.gather_dictionary_stats;

**********************************************************************
Oracle recommends reviewing any defined events prior to upgrading.

To view existing non-default events execute the following commands
while connected AS SYSDBA:
  Events:
    SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2
      WHERE  UPPER(name) ='EVENT' AND  isdefault='FALSE'

  Trace Events:
    SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2
      WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'

Changes will need to be made in the init.ora or spfile.

**********************************************************************

四、收集字典统计信息。
EXECUTE dbms_stats.gather_dictionary_stats;

五、开始升级
在11G ORACLE_HOME/bin下运行DBUA。
下面的操作比较简单,根据图形界面的操作提示进行操作。在操作的过程中,我一直在监控日志,中间有启停数据库的操作。由于数据量比较大,有3、4个T,但3个小时总算搞完了。

六、升级完后,进行数据库检查,发现一台ORACLE_HOME下有spfile 文件、密码文件已经TNS文件,于是将这几个文件拷贝到另一台。手动启数据,如果正常的话,可以起双机进行测试。
     具体操作:停止数据库。
            umount  /oradata/oralnx
            umount   /oradata/lbsdata
            umount  /oradata/lbsdata01
            umount   /oradata/lbsdata02
            umount  /oradata/lbsdata03
            umount  /oradata/lbsdata04
            umount  /oradata
   启双机,注意先在一台上启,启完后再在另一台上启。
    service  cman   start
    service  rgmanager  start
            
附录:通过脚本升级10.2.0.4到11.2.0.3
1、安装11.2.0.3的patchset(安装在新的ORACLE_HOME下)
2、升级前的预检查
    sqlplus / as sysdba
    SQL>spool  upgrade_info.log
    SQL>@$ORACLE_HOME/rdbms/admin/utlu112i.sql
     SQL>spool  off
    检查upgrade_info.log 日志信息,将相关警告及错误一一解决
3、手动升级数据库
    SQL>shutdown  immediate
    SQL>startup  upgrade
    SQL>spool  upgrade.log
    SQL>@catupgrd.sql
    SQL>startup
    SQL>@utlu112s.sql
    SQL>@catuppst.sql
    SQL>@utlrp.sql
    SQL>select count(*)  from dba_invalid_objects;
    SQL>select  distinct  object_name  from dba_invalid_objects;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22969361/viewspace-1224553/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22969361/viewspace-1224553/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值