数据库: 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:
**********************************************************************
--> name: ORALNX
--> version: 10.2.0.4.0
--> compatible: 10.2.0.3.0
--> blocksize: 8192
--> platform: Linux x86 64-bit
--> timezone file: V4
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 9551 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 400 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 19398 MB
--> 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.
**********************************************************************
--> If Target Oracle is 32-Bit, refer here for Update Parameters:
-- No update parameter changes are required.
.
--> 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]
**********************************************************************
--> background_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"
--> user_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"
.
**********************************************************************
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 Workspace Manager [upgrade] VALID
--> OLAP Analytic Workspace [upgrade] VALID
--> OLAP Catalog [upgrade] VALID
--> EM Repository [upgrade] VALID
--> Oracle Text [upgrade] VALID
--> Oracle XML Database [upgrade] VALID
--> Oracle Java Packages [upgrade] VALID
--> Oracle interMedia [upgrade] VALID
--> Spatial [upgrade] VALID
--> Data Mining [upgrade] VALID
--> Expression Filter [upgrade] VALID
--> Rule Manager [upgrade] VALID
--> Oracle OLAP API [upgrade] VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --> 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: --> 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: --> 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: --> 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/