Oracle Migration 10.2.0.x to 10.2.0.4

Martin Zahn, 12.10.2008


Overview

This guide is a short description how to migrate Oracle 10.2.0.x to 10.2.0.4 based on the original README.html found in the Patch from Metalink for 10.2.0.4.

The following main steps have to be done:

  1. Install complete Oracle 10.2.0.1 with Companion and Patch 10.2.0.4 in new ORACLE_HOME.
  2. Backup the Database with RMAN under old ORACLE_HOME
  3. Switch to new ORACLE_HOME and perform the Data Dictionary Migration.

It is however also possible to install the patch for 10.2.0.4 directly into the existing ORACLE_HOME, but the downtime of the database will be longer.

Migration

Install Patch in new ORACLE_HOME

To keep the downtime as small as possible, install the patch into a new ORACLE_HOME, this location can also be a temporary location which can be changed after the migration.

Save old Passwords

select username,password from dba_users order by username;

USERNAME                       PASSWORD
------------------------------ ------------------------------
SYS                            83AD1A4FEA4573E9
SYSTEM                         F205DE2143168593
......                         ...........

Change Passwords for SYS, SYSTEM and SYSMAN

alter user system identified by manager;
alter user sys identified by manager;
alter user sysman identified by manager;

These passwords will be reset back after the migration.

Check for INVALID Objects

Make sure that there are no INVALID objects when you migrate the database.

cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
start utlrp.sql

Drop all Recyclebin Objects

purge user_recyclebin;
purge dba_recyclebin;
purge recyclebin;

Stop everything

Stop listener, enterprise manager and instance(s).

lsnrctl stop
emctl stop dbconsole
sqlplus / as sysdba
shutdown immediate;

Backup the Database with RMAN

sqlplus / as sysdba
startup mount;
exit;

Make sure ORACLE_HOME and ORACLE_SID is set correctly, set the Backup Directory <backup-dir> to a location where enough diskspace can be found.

rman target / nocatalog <<-EOF
  shutdown immediate;
  startup force dba;
  shutdown immediate;
  startup mount;
  CONFIGURE CONTROLFILE AUTOBACKUP ON;
  CONFIGURE CONTROLFILE AUTOBACKUP FORMAT
     FOR DEVICE TYPE DISK TO '
<backup-dir>/controlfile_%F';
  CONFIGURE DEFAULT DEVICE TYPE TO DISK;
  CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
  CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '
<backup-dir>/database_%U';
  CONFIGURE MAXSETSIZE TO 10000M;
  SHOW ALL;
  BACKUP DATABASE INCLUDE CURRENT CONTROLFILE TAG 'before_upgrade';
alter database open;
shutdown immediate;
EOF
exit

Switch to the new ORACLE_HOME

If you created the patch into a completely new ORACLE_HOME, then it is now the time to switch to this new ORACLE_HOME, because the migration must be performed under the new ORACLE_HOME.

export ORACLE_SID=<ORACLE_SID>
export LISTENER_NAME=$ORACLE_SID
export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_DOC=$ORACLE_HOME/doc
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=/export/home/oracle/admin/sqlnet
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/bin/OPatch:/usr/sbin:$PATH
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORA_NLS10=$ORACLE_HOME/nls/data
export TEMP=/tmp
export TMPDIR=/tmp
export EDITOR=vi

Migrate the database

Now, you are ready to perform the migration.

SQL> STARTUP UPGRADE
SQL> SPOOL upgrade_info.log
SQL> @?/rdbms/admin/utlu102i.sql
SQL> SPOOL OFF

Check the generated upgrade_info.log

Now perform the main step!

SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF

Review the patch.log file for errors and inspect the list of components that is displayed at the end
of catupgrd.sql script.

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

Check for INVALID Objects

Make sure that there are no INVALID objects after the migration

cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
start utlrp.sql

Reset Passwords

alter user sys identified by values '<encrypted password>';
alter user system identified by values '
<encrypted password>';

Start and check everything

Now, you can start again the listener, enterprise manager and the application. Check the alert.log for any errors. Make sure your INIT.ORA is up-to-date (remove obsolete parameters, set compatible, etc).