Oracle upgrade processes

DBA Notes: 2011/09/21

Cheng Li

 

Upgrade Oracle database

 

As part of eHealthy application server upgrading, we support to upgrade repository database from Oracle 10.2.0.1 to Oracle 10.2.0.4. Following are steps applied:

 

1) Preparation of database upgrade

Clearing up and collect statistics information

SQL>TRUNCATE TABLE SYS.AUD$;

SQL>purge DBA_RECYCLEBIN;

SQL> exec DBMS_STATS.GATHER_DICTIONARY_STATS;

 

2) Stop all oracle components

Stop oracle components running like LISTENER, EM , ISQLPLUS and DB itself etc.

/* Stop the isqlplus if running */

$ isqlplusctl stop

 

/* Stop the EM dbconsole */

$ emctl stop dbconsole

 

/* Stop the listener */

$ lsnrctl stop

 

/* Shutdown the database itself */

$ sqlplus / as sysdba

 

SQL> shutdown immediate;

 

3)  Take a backup of Oracle Home and Database

Make a cold backup of database software and data

 

4) Download and Install Oracle Patchset

$ cd /home/oracle

$ unzip p6810189_10204_Linux-x86.zip

$ cd Disk1/

$ ./runInstaller

 

5) Database upgrade processes

Now startup the database with upgrade option and run the pre-upgrade information tool to see if the database is okay for the upgrade and if there is something to be changed before starting the upgrade.

$ cd $ORACLE_HOME/rdbms/admin

$ sqlplus / as sysdba

SQL> startup upgrade;

SQL> @catupgrd.sql;

 

 

6) Check and recompile invalid object

 

SQL> select * from v$version;

SQL> SELECT UNIQUE object_name, object_type, owner FROM dba_objects WHERE status = 'INVALID';

 SQL> @utlrp.sql

 

Reference:

http://www.oracleflash.com/29/Upgrade-Oracle-10g-Release-2-from-10201-to-10204.html

http://www.oracledatabase12g.com/archives/oracle%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8D%87%E7%BA%A7%E5%89%8D%E5%BF%85%E8%A6%81%E7%9A%84%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C.html

 

oradim command for windows:

oradim.exe -startup -sid ehealth -usrpwd * -pfile C:\or10\database\initEHEALTH.ora -log oradim.log -nocheck 0

U1235P2DT20110917081302.jpg

U1235P2DT20110917081321.jpg

U1235P2DT20110917081351.jpg

请使用浏览器的分享功能分享到微信等