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
oradim command for windows:
oradim.exe -startup -sid ehealth -usrpwd * -pfile C:\or10\database\initEHEALTH.ora -log oradim.log -nocheck 0
U1235P2DT20110917081302.jpg