Upgrading Steps from 10.2.0.1 to 10.2.0.4

First of all, you will need to download the patch, for example:
p6810189_10204_Linux-x86.zip

Upgrading Database Software from 10g Release 2 (10.2.0.1) to Oracle 10g R2 (10.2.0.4)

Copy p6810189_10204_Linux-x86.zip to oracle users' home directory and use below command to extract the archive;
[oracle]$unzip p6810189_10204_Linux-x86.zip
 
TIP: Shutdown all Oracle Database, Listener, iSQLPlus and Database Console before you Patch Oracle Software (at the end of this doc)
 
Now execute below command to Launch Oracle Universal installer that came with 10.2.0.4.
[oracle]$ cd Disk1
[oracle]$ ./runInstaller

And follow up the screen process.

Upgrading Data Files from 10g Release 2 (10.2.0.1) to Oracle 10g R2 (10.2.0.4)

TIP: Shutdown all Oracle Database, Listener, iSQLPlus and Database Console before you Patch Oracle Software; Check out Start and Shutdown Oracle Database/Processes

Login as oracle user to perform the next actions.

Upgrade Instance

[oracle]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 19 22:25:46 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

SQL> connect sys/yoursyspassword as sysdba
Connected to an idle instance.

SQL> STARTUP UPGRADE
ORACLE instance started.
Total System Global Area  167772160 bytes
Fixed Size                  1266392 bytes
Variable Size              83889448 bytes
Database Buffers           79691776 bytes
Redo Buffers                2924544 bytes
Database mounted.
Database opened.

SQL> SPOOL /tmp/DB_upgrade.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
 
To see Upgrade Start and End Times;
 
[oracle]$ cat /tmp/DB_upgrade.log |awk '/COMP_TIMESTAMP/ || /DBUA_TIMESTAMP/'
COMP_TIMESTAMP UPGRD__BGN 2009-01-19 22:28:12 2454851 80892
COMP_TIMESTAMP PATCH_BGN  2009-01-19 22:28:44
COMP_TIMESTAMP CATPROC    2009-01-20 00:03:04
COMP_TIMESTAMP RDBMS      2009-01-20 00:03:04
DBUA_TIMESTAMP RDBMS      VALID       2009-01-20 00:03:04
COMP_TIMESTAMP JAVAVM     2009-01-20 00:17:38
DBUA_TIMESTAMP JAVAVM     VALID       2009-01-20 00:17:38
COMP_TIMESTAMP XML        2009-01-20 00:23:32
DBUA_TIMESTAMP XML        VALID       2009-01-20 00:23:32
COMP_TIMESTAMP CATJAVA    2009-01-20 00:29:06
DBUA_TIMESTAMP CATJAVA    VALID       2009-01-20 00:29:06
COMP_TIMESTAMP CONTEXT    2009-01-20 00:32:32
DBUA_TIMESTAMP CONTEXT    VALID       2009-01-20 00:32:32
COMP_TIMESTAMP XDB        2009-01-20 00:51:03
DBUA_TIMESTAMP XDB        VALID       2009-01-20 00:51:03
COMP_TIMESTAMP OWM        2009-01-20 00:58:09
DBUA_TIMESTAMP OWM        VALID       2009-01-20 00:58:09
COMP_TIMESTAMP ODM        2009-01-20 01:01:56
DBUA_TIMESTAMP ODM        VALID       2009-01-20 01:01:56
COMP_TIMESTAMP APS        2009-01-20 01:04:39
DBUA_TIMESTAMP APS        VALID       2009-01-20 01:04:39
COMP_TIMESTAMP AMD        2009-01-20 01:12:10
DBUA_TIMESTAMP AMD        VALID       2009-01-20 01:12:10
COMP_TIMESTAMP XOQ        2009-01-20 01:20:12
DBUA_TIMESTAMP XOQ        VALID       2009-01-20 01:20:12
COMP_TIMESTAMP ORDIM      2009-01-20 02:11:51
DBUA_TIMESTAMP ORDIM      VALID       2009-01-20 02:11:51
COMP_TIMESTAMP SDO        2009-01-20 02:28:27
DBUA_TIMESTAMP SDO        VALID       2009-01-20 02:28:27
COMP_TIMESTAMP EXF        2009-01-20 02:30:13
DBUA_TIMESTAMP EXF        VALID       2009-01-20 02:30:13
COMP_TIMESTAMP EM         2009-01-20 02:45:25
DBUA_TIMESTAMP EM         VALID       2009-01-20 02:45:25
COMP_TIMESTAMP RUL        2009-01-20 02:48:03
DBUA_TIMESTAMP RUL        VALID       2009-01-20 02:48:03
COMP_TIMESTAMP UPGRD_END  2009-01-20 02:48:04
 
To see List of Upgrades Components;
 
[oracle]$ tail -40 /tmp/DB_upgrade.log
Component                                Status         Version  HH:MM:SS
Oracle Database Server                    VALID      10.2.0.4.0  01:34:52
JServer JAVA Virtual Machine              VALID      10.2.0.4.0  00:14:34
Oracle XDK                                VALID      10.2.0.4.0  00:05:53
Oracle Database Java Packages             VALID      10.2.0.4.0  00:05:33
Oracle Text                               VALID      10.2.0.4.0  00:03:25
Oracle XML Database                       VALID      10.2.0.4.0  00:18:31
Oracle Workspace Manager                  VALID      10.2.0.4.3  00:07:05
Oracle Data Mining                        VALID      10.2.0.4.0  00:03:47
OLAP Analytic Workspace                   VALID      10.2.0.4.0  00:02:42
OLAP Catalog                              VALID      10.2.0.4.0  00:07:30
Oracle OLAP API                           VALID      10.2.0.4.0  00:08:02
Oracle interMedia                         VALID      10.2.0.4.0  00:51:38
Spatial                                   VALID      10.2.0.4.0  00:16:35
Oracle Expression Filter                  VALID      10.2.0.4.0  00:01:46
Oracle Enterprise Manager                 VALID      10.2.0.4.0  00:15:11
Oracle Rule Manager                       VALID      10.2.0.4.0  00:02:37
.
Total Upgrade Time: 04:19:52
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The above PL/SQL lists the SERVER components in the upgraded
DOC>   database, along with their current version and status.
DOC>
DOC>   Please review the status and version columns and look for
DOC>   any errors in the spool log file.  If there are errors in the spool
DOC>   file, or any components are not VALID or not the current version,
DOC>   consult the Oracle Database Upgrade Guide for troubleshooting
DOC>   recommendations.
DOC>
DOC>   Next shutdown immediate, restart for normal operation, and then
DOC>   run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL>
SQL>
SQL> SPOOL OFF
 

Restart Instance

SQL> SHUTDOWN
SQL> STARTUP
 

Recompile Invalid Objects

After you start the database instance in normal mode, Login as sysdba and run below script;

SQL> SPOOL /tmp/DB_utltp.log
SQL> @?/rdbms/admin/utlrp.sql
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2009-01-20 02:56:49
DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2009-01-20 03:09:53
DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
                  0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
                          0
SQL> SPOOL OFF
SQL>
 
 

Start and Shutdown Oracle Database/Processes

Issue ps -eaf to see any oracle processes running in the OS, if you have chosen an option to install reconfigured database then below services will be running.
 

To start, iSQL Plus

[oracle@dblx131 ~]$ isqlplusctl start
iSQL*Plus 10.2.0.4.0
Copyright (c) 2003, 2007, Oracle.  All Rights Reserved.
Starting iSQL*Plus ...
iSQL*Plus started.
[oracle@dblx131 ~]$
 

To Stop, iSQLPlus

[oracle@dblx131 ~]$ isqlplusctl stop
iSQL*Plus 10.2.0.4.0
Copyright (c) 2003, 2007, Oracle.  All Rights Reserved.
Stopping iSQL*Plus ...
iSQL*Plus stopped.
[oracle@dblx131 ~]$


To Start, Database Control for Database Management

[oracle@dblx131 ~]$ emctl start dbconsole
TZ set to US/Central
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
http://dblx131:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ..... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/pdb10/dblx131_pdb10/sysman/log
[oracle@dblx131 ~]$


To Stop, Database Control for Database Management

[oracle@dblx131 ~]$ emctl stop dbconsole
TZ set to US/Central
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
http://dblx131:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
 ...  Stopped.
[oracle@dblx131 ~]$
 

To Start, Oracle Listener

[oracle@dblx131 ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 20-JAN-2009 03:19:02
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/10.2.0/pdb10/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/pdb10/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/pdb10/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dblx131)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                20-JAN-2009 03:19:03
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/pdb10/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/pdb10/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dblx131)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dblx131 ~]$


To Stop, Oracle Listener

[oracle@dblx131 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 20-JAN-2009 03:27:19
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully
[oracle@dblx131 ~]$


To Start, Oracle Database

[oracle@dblx131 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jan 20 03:17:35 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  167772160 bytes
Fixed Size                  1266392 bytes
Variable Size             142609704 bytes
Database Buffers           20971520 bytes
Redo Buffers                2924544 bytes
Database mounted.
Database opened.
SQL>


To Stop, Oracle Database

[oracle@dblx131 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jan 20 03:27:43 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>