Friday, October 21, 2011

Patch Set upgrade from 10.2.0.1 to 10.2.0.4 (Physical standby Database)

Patch set Upgrade from 10.2.0.1. to 10.2.0.4 ( Physical Standby database)

You can apply the Oracle Database release 10.2.0.4 patch set to the following Oracle Database 10g release 2 installations:

Oracle Database
Oracle Real Application Clusters
Oracle Database Client
Oracle Database Companion CD
Oracle Clusterware
Oracle Database Vault


Steps:

1. Download the Patch Set p6810189_10204_Linux-x86.zip from oracle support.

2. Inorder to upgrade to 10.2.0.4 our timezone file version should be 4, if it is less than/greater than 4 then
take action as per metalink note 553812.1


SQL> select * from V$timezone_file;

FILENAME VERSION
------------ ----------
timezlrg.dat 4


Process Overview:

1. In the primary disable log shipping to the standby site.


SQL> alter system set log_archive_dest_state_2 = 'DEFER';

System altered.



2. Shutdown the standby site and apply interim patchsets to the RDBMS binaries as per the README.
This includes Patchset/Patchset Update(PSU)/Critical Patch Update (CPU). You will not be able to and do not need to run
the scripts(catpatch.sql etc) against the standby rdbms itself.

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

SQL> exit;


Set the Environmane Variables oracle_home and oracle_sid

$ lsnrctl stop
$ emctl stop dbconsole

-Unzip the Downloaded Patch file.

$ unzip p6810189_10204_Linux-x86.zip -d /u01/patch
$ cd /u01/patch/disk1


7. If your doing a silent installation then modify the parameter in the response file
and start the runInstaller in silent mode.

$ cd /u01/patch/Disk1/response
$ vi patchset.rsp
Modify the values in the patchset.rsp file accordinly.
$ cd /u01/patch/Disk1
$ ./runInstaller -silent -responseFile /u01/patch/Disk1/response/patchset.rsp


- If Installing through GUI mode and not installing the Patch on the local machine
then enable the X forward on your desktop

In your desktop you need to have a software to forward the X Server Screens. eg. cygwin.
Here we have installed cygwin tool.

Double click the cygwin tool from you desktop and enter startxwin.


$ startxwin


It will open a xterminal , there enter the host name where your perfoming the
patch installation.

$ xhost + 192.168.1.5
192.168.1.5 being added to access control list


In your server set the display variable to where you want to forward your
GUI Screen, here to the desktop.

Bourne, Bash, or Korn shell:

$ export DISPLAY=192.168.1.2:0.0

C shell:

% setenv DISPLAY l192.168.1.2:0.0



- Start the runInstaller.

$ cd /u01/patch/Disk1
$ ./runInstaller


- Once the installation is complete it will as for to run the root.sh script
run this script as root user.

# sh /u02/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u02/app/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.


Startup the listener process and the databse:-

$ lsnrctl start
[oracle@rhel11gstdby Disk1]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Oct 22 09:44:22 2011

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 130025204 bytes
Database Buffers 310378496 bytes
Redo Buffers 2924544 bytes
Database mounted.

Note :- Do not run the upgrade scripts in the standby site.



3. Shutdown the primary site, apply the Patchset/PSU/CPU patch to the RDBMS binaries and patch the RDBMS itself using the
instructions in the README (run catpatch/catbundle/catcpu etc).


$ lsnrctl stop
$ emctl stop dbconsole
$ isqlplusctl stop


SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

Now install the patch set (10.2.0.4) as per the instruction said above.


Upgrade the database from 10.2.0.1 to 10.2.0.4

$ sqlplus / as sysdba

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 159385332 bytes
Database Buffers 281018368 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.


SQL> @?/rdbms/admin/catupgrd.sql;

---
---
---
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UPGRD_END 2011-10-22 10:40:34
.
Oracle Database 10.2 Upgrade Status Utility 10-22-2011 10:40:34
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.4.0 00:10:37
JServer JAVA Virtual Machine VALID 10.2.0.4.0 00:03:29
Oracle XDK VALID 10.2.0.4.0 00:00:35
Oracle Database Java Packages VALID 10.2.0.4.0 00:00:26
Oracle Text VALID 10.2.0.4.0 00:00:36
Oracle XML Database VALID 10.2.0.4.0 00:02:38
Oracle Workspace Manager VALID 10.2.0.4.3 00:01:17
Oracle Data Mining VALID 10.2.0.4.0 00:00:51
OLAP Analytic Workspace VALID 10.2.0.4.0 00:01:40
OLAP Catalog VALID 10.2.0.4.0 00:01:48
Oracle OLAP API VALID 10.2.0.4.0 00:01:34
Oracle interMedia VALID 10.2.0.4.0 00:05:43
Spatial VALID 10.2.0.4.0 00:02:05
Oracle Expression Filter VALID 10.2.0.4.0 00:00:11
Oracle Enterprise Manager VALID 10.2.0.4.0 00:01:44
Oracle Rule Manager VALID 10.2.0.4.0 00:00:11
.
Total Upgrade Time: 00:35:30
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> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 197134068 bytes
Database Buffers 243269632 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.

SQL> @?/rdbms/admin/utlrp.sql;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2011-10-22 10:43:03
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 2011-10-22 10:44:36
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> @?/rdbms/admin/utlu102s.sql;
.
Oracle Database 10.2 Upgrade Status Utility 10-22-2011 10:44:59
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.4.0 00:10:37
JServer JAVA Virtual Machine VALID 10.2.0.4.0 00:03:29
Oracle XDK VALID 10.2.0.4.0 00:00:35
Oracle Database Java Packages VALID 10.2.0.4.0 00:00:26
Oracle Text VALID 10.2.0.4.0 00:00:36
Oracle XML Database VALID 10.2.0.4.0 00:02:38
Oracle Workspace Manager VALID 10.2.0.4.3 00:01:17
Oracle Data Mining VALID 10.2.0.4.0 00:00:51
OLAP Analytic Workspace VALID 10.2.0.4.0 00:01:40
OLAP Catalog VALID 10.2.0.4.0 00:01:48
Oracle OLAP API VALID 10.2.0.4.0 00:01:34
Oracle interMedia VALID 10.2.0.4.0 00:05:43
Spatial VALID 10.2.0.4.0 00:02:05
Oracle Expression Filter VALID 10.2.0.4.0 00:00:11
Oracle Enterprise Manager VALID 10.2.0.4.0 00:01:44
Oracle Rule Manager VALID 10.2.0.4.0 00:00:11
.
Total Upgrade Time: 00:35:30





4. Start the primary site, re-enable log shipping to the standby.


SQL> alter system set log_archive_dest_state_2 = 'ENABLE';

System altered.




5. At the standby site restart redo apply/managed recovery and the RDBMS changes implemented in the Primary Site through
catpatch/catbundle/catcpu will also be applied to the standby.

NOTE: Step 5. should be done immediately after upgrading the Database Binaries on the Standby Database. It is to
ensure the Data Dictionary (CATPROC)-Version matches the Version of the Database Binaries. If this does not
match (eg. when you upgrade the Standby Database Binaries first and perform a Role Change on the
Standby before you upgrade the Primary) you may run into severe Problems. Having different Patchlevels in a
Data Guard Physical Standby Database Environment is not supported anyway, see
Mixed Oracle Version support with Data Guard Redo Transport Services (Doc ID 785347.1)
for further Details and Reference.



6. Checks to perform to ensure the patch has been applied successfully at the primary and standby sites.

Check whether all the logs has been applied in the standby database, wailt until all the logs been
applied in the standby database. Once all the logs been applied successully the standby database
been upgraded successfully.


You can also verify it by opening the database in read only mode.


SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shut immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


SQL> startup mount;
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 130025204 bytes
Database Buffers 310378496 bytes
Redo Buffers 2924544 bytes
Database mounted.
SQL> alter database open read only;

Database altered.

SQL> @?/rdbms/admin/utlu102s.sql;
.
Oracle Database 10.2 Upgrade Status Utility 10-22-2011 11:22:54
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.4.0 00:10:37
JServer JAVA Virtual Machine VALID 10.2.0.4.0 00:03:29
Oracle XDK VALID 10.2.0.4.0 00:00:35
Oracle Database Java Packages VALID 10.2.0.4.0 00:00:26
Oracle Text VALID 10.2.0.4.0 00:00:36
Oracle XML Database VALID 10.2.0.4.0 00:02:38
Oracle Workspace Manager VALID 10.2.0.4.3 00:01:17
Oracle Data Mining VALID 10.2.0.4.0 00:00:51
OLAP Analytic Workspace VALID 10.2.0.4.0 00:01:40
OLAP Catalog VALID 10.2.0.4.0 00:01:48
Oracle OLAP API VALID 10.2.0.4.0 00:01:34
Oracle interMedia VALID 10.2.0.4.0 00:05:43
Spatial VALID 10.2.0.4.0 00:02:05
Oracle Expression Filter VALID 10.2.0.4.0 00:00:11
Oracle Enterprise Manager VALID 10.2.0.4.0 00:01:44
Oracle Rule Manager VALID 10.2.0.4.0 00:00:11
.
Total Upgrade Time: 00:35:30

PL/SQL procedure successfully completed.


Reference:-

For information about physical standby databases, review document 278641.1.
For information about logical standby databases, review document 278643.1.

Wednesday, October 19, 2011

Patch Set upgrade from 10.2.0.1 to 10.2.0.4

Upgrade Oracle from 10.2.0.1 to 10.2.0.4 using Patch set (Single Instance)

You can apply the Oracle Database release 10.2.0.4 patch set to the following Oracle Database 10g release 2 installations:

Oracle Database
Oracle Real Application Clusters
Oracle Database Client
Oracle Database Companion CD
Oracle Clusterware
Oracle Database Vault


Steps:

1. Download the Patch Set p6810189_10204_Linux-x86.zip from oracle support.

2. Inorder to upgrade to 10.2.0.4 our timezone file version should be 4, if it is less than/greater than 4 then
take action as per metalink note 553812.1

SQL> select * from V$timezone_file;

FILENAME VERSION
------------ ----------
timezlrg.dat 4

3. Set the Environment Varibales:-

Bourne, Bash, or Korn shell:

$ ORACLE_HOME=Oracle_home
$ ORACLE_SID=sid
$ export ORACLE_HOME ORACLE_SID

C shell:

% setenv ORACLE_HOME Oracle_home
% setenv ORACLE_SID sid



3. Stop all the process:

a. listener - $ lsnrctl stop
b. Enterprise Manager - $ emctl stop dbconsole
c. isqlplus - $ isqlplusctl stop


4. Take the backup of the following components.

1. Oracle Inventory,
$ cp -r oraInventory /u01/bkpof10gbeforepatch/

2. Oracle 10g home
$ cd /u02/app/oracle/product/10.2.0
$ tar -cvf /u01/bkpof10gbeforepatch/10.2.0.1_home_binaries.tar db_1

Here first change the directory to the previous one to the oracle home and then
take the tape archive (tar) bakup of the db_1 directory which contains all
the binaries of the current 10.2.0.1 version and it will store the
backup in the /u01/bkpof10gbeforepatch folder with name as 10.2.0.1_home_binaries.tar


3. Oracle 10g Database
sql> create pfile = '/u01/bkpof10gbeforepatch/initfirstdb.ora' from spfile;
sql> shut immediate;
Take the backup of datafile, redologs and controlfiles.
$ cp -r firstdb /u01/bkpof10gbeforepatch/
Take the backup of Password file.
$ cd $ORACLE_HOME
$ cp orapwfirstdb /u01/bkpof10gbeforepatch


5. Unzip the Downloaded Patch file.

$ unzip p6810189_10204_Linux-x86.zip -d /u01/patch
$ cd /u01/patch/disk1


7. If your doing a silent installation then modify the parameter in the response file
and start the runInstaller in silent mode.

$ cd /u01/patch/Disk1/response
$ vi patchset.rsp
Modify the values in the patchset.rsp file accordinly.
$ cd /u01/patch/Disk1
$ ./runInstaller -silent -responseFile /u01/patch/Disk1/response/patchset.rsp


6. If Installing through GUI mode and not installing the Patch on the local machine
then enable the X forward on your desktop

In your desktop you need to have a software to forward the X Server Screens. eg. cygwin.
Here we have installed cygwin tool.

Double click the cygwin tool from you desktop and enter startxwin.


$ startxwin


It will open a xterminal , there enter the host name where your perfoming the
patch installation.

$ xhost + 192.168.1.4
192.168.1.4 being added to access control list


In your server set the display variable to where you want to forward your
GUI Screen, here to the desktop.

Bourne, Bash, or Korn shell:

$ export DISPLAY=192.168.1.2:0.0

C shell:

% setenv DISPLAY l192.168.1.2:0.0



8. Start the runInstaller.

$ cd /u01/patch/Disk1
$ ./runInstaller


9. Once the installation is complete it will as for to run the root.sh script
run this script as root user.

# sh /u02/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u02/app/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.


10. Now upgrade the database from 10.2.0.1 to 10.2.0.4


[oracle@rhel11g Disk1]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Oct 20 10:20:04 2011

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 159385332 bytes
Database Buffers 281018368 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.



--Run the preupgrade tool and action accordingly.

SQL> @?/rdbms/admin/utlu102i.sql
Oracle Database 10.2 Upgrade Information Utility 10-20-2011 10:24:36
.
**********************************************************************
Database:
**********************************************************************
--> name: FIRSTDB
--> version: 10.2.0.1.0
--> compatible: 10.2.0.1.0
--> blocksize: 8192
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 486 MB
.... AUTOEXTEND additional space required: 6 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 403 MB
.... AUTOEXTEND additional space required: 378 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 247 MB
.... AUTOEXTEND additional space required: 7 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 58 MB
.... AUTOEXTEND additional space required: 38 MB
.
**********************************************************************
Update Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No obsolete parameters found. No changes are required
.
**********************************************************************
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 Java Packages [upgrade] VALID
--> Oracle Text [upgrade] VALID
--> Oracle XML Database [upgrade] VALID
--> Oracle Workspace Manager [upgrade] VALID
--> Oracle Data Mining [upgrade] VALID
--> OLAP Analytic Workspace [upgrade] VALID
--> OLAP Catalog [upgrade] VALID
--> Oracle OLAP API [upgrade] VALID
--> Oracle interMedia [upgrade] VALID
--> Spatial [upgrade] VALID
--> Expression Filter [upgrade] VALID
--> EM Repository [upgrade] VALID
--> Rule Manager [upgrade] VALID
.

PL/SQL procedure successfully completed.


SQL> alter database datafile '/u02/app/oracle/firstdb/system01.dbf' resize 500m;
Database altered.

SQL> alter database datafile '/u02/app/oracle/firstdb/undotbs01.dbf' resize 450m;
Database altered.

SQL> alter database datafile '/u02/app/oracle/firstdb/sysaux01.dbf' resize 250m;

Database altered.

SQL> alter database tempfile '/u02/app/oracle/firstdb/temp01.dbf' resize 100m;

Database altered.

-- Run the catalog upgrade script

SQL>@?/rdbms/admin/catupgrd.sql


---
---
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UPGRD_END 2011-10-20 11:05:47
.
Oracle Database 10.2 Upgrade Status Utility 10-20-2011 11:05:47
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.4.0 00:08:15
JServer JAVA Virtual Machine VALID 10.2.0.4.0 00:02:37
Oracle XDK VALID 10.2.0.4.0 00:00:27
Oracle Database Java Packages VALID 10.2.0.4.0 00:00:23
Oracle Text VALID 10.2.0.4.0 00:00:21
Oracle XML Database VALID 10.2.0.4.0 00:01:17
Oracle Workspace Manager VALID 10.2.0.4.3 00:00:29
Oracle Data Mining VALID 10.2.0.4.0 00:00:18
OLAP Analytic Workspace VALID 10.2.0.4.0 00:00:16
OLAP Catalog VALID 10.2.0.4.0 00:00:41
Oracle OLAP API VALID 10.2.0.4.0 00:00:38
Oracle interMedia VALID 10.2.0.4.0 00:03:22
Spatial VALID 10.2.0.4.0 00:01:26
Oracle Expression Filter VALID 10.2.0.4.0 00:00:08
Oracle Enterprise Manager VALID 10.2.0.4.0 00:01:10
Oracle Rule Manager VALID 10.2.0.4.0 00:00:06
.
Total Upgrade Time: 00:22:00
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>#######################################################################

SQL> shutdown immediate;

SQL> EXIT;


$ sqlplus / as sysdba

sql> startup

ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1267980 bytes
Variable Size 192939764 bytes
Database Buffers 247463936 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.


--Now run the ultrp.sql script to recompile all the invalid objects.


SQL> @?/rdbms/admin/utlrp.sql;


PL/SQL procedure successfully completed.

SQL> col comp_id form a10;
SQL> col comp_name form a30;
SQL> col version form a10;
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS,MODIFIED from dba_registry;

COMP_ID COMP_NAME VERSION STATUS MODIFIED
---------- ------------------------------ ---------- ----------- --------------------
CATALOG Oracle Database Catalog Views 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
CATPROC Oracle Database Packages and T 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
ypes

OWM Oracle Workspace Manager 10.2.0.4.3 VALID 20-OCT-2011 11:11:53
JAVAVM JServer JAVA Virtual Machine 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
XML Oracle XDK 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
CATJAVA Oracle Database Java Packages 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
EXF Oracle Expression Filter 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
ODM Oracle Data Mining 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
CONTEXT Oracle Text 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
XDB Oracle XML Database 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
RUL Oracle Rule Manager 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
ORDIM Oracle interMedia 10.2.0.4.0 VALID 20-OCT-2011 11:11:53
APS OLAP Analytic Workspace 10.2.0.4.0 VALID 20-OCT-2011 11:11:54
XOQ Oracle OLAP API 10.2.0.4.0 VALID 20-OCT-2011 11:11:54
AMD OLAP Catalog 10.2.0.4.0 VALID 20-OCT-2011 11:11:56
SDO Spatial 10.2.0.4.0 VALID 20-OCT-2011 11:11:56
EM Oracle Enterprise Manager 10.2.0.4.0 VALID 20-OCT-2011 11:05:40

SQL> select CNAME,VERSION,STATUS,MODIFIED,DATE_UPGRADED,ORG_VERSION,PRV_VERSION from registry$;

CNAME VERSION STATUS MODIFIED DATE_UPGR ORG_VERSION PRV_VERSION
---------------------------------------- ---------- ---------- --------- --------- ------------------------------ ------------------------------
Oracle Database Catalog Views 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Database Packages and Types 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Workspace Manager 10.2.0.4.3 1 20-OCT-11 20-OCT-11 10.2.0.1.0
JServer JAVA Virtual Machine 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle XDK 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Database Java Packages 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Expression Filter 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Data Mining 10.2.0.4.0 1 20-OCT-11 20-OCT-11 10.2.0.1.0
Oracle Text 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle XML Database 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Rule Manager 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle interMedia 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
OLAP Analytic Workspace 10.2.0.4.0 1 20-OCT-11 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle OLAP API 10.2.0.4.0 1 20-OCT-11 20-OCT-11 10.2.0.1.0 10.2.0.1.0
OLAP Catalog 10.2.0.4.0 1 20-OCT-11 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Spatial 10.2.0.4.0 1 20-OCT-11 10.2.0.1.0 10.2.0.1.0
Oracle Enterprise Manager 10.2.0.4.0 1 20-OCT-11 20-OCT-11 10.2.0.1.0

Run the post upgrade script and check the status.

SQL> @?/rdbms/admin/utlu102s.sql;
.
Oracle Database 10.2 Upgrade Status Utility 10-20-2011 11:25:45
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.4.0 00:08:15
JServer JAVA Virtual Machine VALID 10.2.0.4.0 00:02:37
Oracle XDK VALID 10.2.0.4.0 00:00:27
Oracle Database Java Packages VALID 10.2.0.4.0 00:00:23
Oracle Text VALID 10.2.0.4.0 00:00:21
Oracle XML Database VALID 10.2.0.4.0 00:01:17
Oracle Workspace Manager VALID 10.2.0.4.3 00:00:29
Oracle Data Mining VALID 10.2.0.4.0 00:00:18
OLAP Analytic Workspace VALID 10.2.0.4.0 00:00:16
OLAP Catalog VALID 10.2.0.4.0 00:00:41
Oracle OLAP API VALID 10.2.0.4.0 00:00:38
Oracle interMedia VALID 10.2.0.4.0 00:03:22
Spatial VALID 10.2.0.4.0 00:01:26
Oracle Expression Filter VALID 10.2.0.4.0 00:00:08
Oracle Enterprise Manager VALID 10.2.0.4.0 00:01:10
Oracle Rule Manager VALID 10.2.0.4.0 00:00:06
.
Total Upgrade Time: 00:22:00

PL/SQL procedure successfully completed.

-Upgrade Process Completed---


Running changePerm.sh Script on an Oracle Database Server Home

Important:
Oracle recommends using the most restrictive file permissions possible for the given implementation.
Perform these optional steps only after considering all security ramifications and only if you need to share this installation.

During patch set installation, all new files and directories are created with restricted access, by default. Users or third party
applications with a different group identifier from that of the database, which try to access client-side utilities or libraries in the database home,
will see permission errors when trying to access these files or directories. Perform the following steps to change the permissions:

Change to the install directory by using the following command:

$ cd $ORACLE_HOME/install

Run changePerm.sh and specify the patched server Oracle home location, before accessing client-side utilities or libraries in the database home.


===Revert back the change using the backup if any problem occurs=========

Remove the Oracle inventory

$ cd /u01/app
$ rm -r oraInventory


Remove the oracle home

$ cd /u02/app/oracle/product/10.2.0
$ rm -r db_1


Remove the databasefile, controlfiles and redo files

$ cd /u02/app/oracle
$ rm -r firstdb


Restore the oracle inventory from backup

$ cd /u01/bkpof10gbeforepatch
$ cp -r oraInventory /u01/app

Restore the oracle home from backup

$ cd /u02/app/oracle/product/10.2.0/
$ tar -xvf /u01/bkpof10gbeforepatch/10.2.0.1_home.tar

Restore the database from backup

$ cp -r /u01/bkpof10gbeforepatch/firstdb /u02/app/oracle/

Start the Database:-

[oracle@rhel11g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 20 21:51:12 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 444596224 bytes
Fixed Size 1219904 bytes
Variable Size 159384256 bytes
Database Buffers 281018368 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.

sql> select COMP_NAME, VERSION, status from dba_registry;

COMP_NAME VERSION STATUS
-------------------------------------------------- ------------------------------ -----------
Oracle Database Catalog Views 10.2.0.1.0 VALID
Oracle Database Packages and Types 10.2.0.1.0 VALID
Oracle Workspace Manager 10.2.0.1.0 VALID
JServer JAVA Virtual Machine 10.2.0.1.0 VALID
Oracle XDK 10.2.0.1.0 VALID
Oracle Database Java Packages 10.2.0.1.0 VALID
Oracle Expression Filter 10.2.0.1.0 VALID
Oracle Data Mining 10.2.0.1.0 VALID
Oracle Text 10.2.0.1.0 VALID
Oracle XML Database 10.2.0.1.0 VALID
Oracle Rules Manager 10.2.0.1.0 VALID
Oracle interMedia 10.2.0.1.0 VALID
OLAP Analytic Workspace 10.2.0.1.0 VALID
Oracle OLAP API 10.2.0.1.0 VALID
OLAP Catalog 10.2.0.1.0 VALID
Spatial 10.2.0.1.0 VALID
Oracle Enterprise Manager 10.2.0.1.0 VALID

--------------------------------------

The change has been reverted successfully.

Database Upgrade/Downgrade Compatibility Matrix

Source Database Downgrade Possible to

10.2.x - 9.2.0.6.0 (or higher)
10.2.x - 10.1.0.4.0 (or higher)

Downgrade Compatibility Matrix for Downgrading from 10.1.x


Source Database Downgrade Possible to

10.1.x 9.2.0.4.0 (or higher)


Downgrade Compatibility Matrix for Downgrading from 9.2.x


Source Database Downgrade Possible to

9.2.x 9.0.1.3.0 (or higher)
9.2.x 8.1.7.3.0 (or higher)

UPGRADE


Upgrade Compatibility Matrix for Upgrading to 11.2.x

Minimum Version of the database that can be directly upgraded to Oracle 11g Release 2

Source Database Destination Database

9.2.0.8 (or higher) 11.2.x
10.1.0.5 (or higher) 11.2.x
10.2.0.2 (or higher) 11.2.x
11.1.0.6 (or higher) 11.2.x


The following database version will require an indirect upgrade path.

Source Database Upgrade Path Destination Database

7.3.3 (or lower) => 7.3.4.0 => 9.2.0.8 => 11.2.x
8.0.5 (or lower) => 8.0.6.x => 9.2.0.8 => 11.2.x
8.1.7 (or lower) => 8.1.7.4 => 10.2.0.4 => 11.2.x
9.0.1.3 (or lower) => 9.0.1.4 => 10.2.0.4 => 11.2.x
9.2.0.7 (or lower) => 9.2.0.8 => 11.2.x

Upgrade Compatibility Matrix for Upgrading to 11.1.x

Minimum Version of the database that can be directly upgraded to Oracle 11g Release 1

Source Database Destination Database

9.2.0.4 (or higher) 11.1.x
10.1.0.2 (or higher) 11.1.x
10.2.0.1 (or higher) 11.1.x

The following database version will require an indirect upgrade path.

Source Database Upgrade Path Destination Database

7.3.3 (or lower) => 7.3.4.0 => 9.2.0.8 => 11.1.x
8.0.5 (or lower) => 8.0.6.x => 9.2.0.8 => 11.1.x
8.1.7 (or lower) => 8.1.7.4 => 9.2.0.8 => 11.1.x
9.0.1.3 (or lower) => 9.0.1.4 => 9.2.0.8 => 11.1.x
9.2.0.3 (or lower) => 9.2.0.4.0 => 11.1.x



Upgrade Compatibility Matrix for Upgrading to 10.2.x

Minimum Version of the database that can be directly upgraded to Oracle 10.2.x

Source Database Destination Database

8.1.7.4 (or higher) 10.2.x
9.0.1.4 (or higher) 10.2.x
9.2.0.4 (or higher) 10.2.x
10.1.0.2 (or higher) 10.2.x


The following database version will require an indirect upgrade path.

Source Database Upgrade Path Destination Database

7.3.3 (or lower) => 7.3.4 => 8.1.7 =>8.1.7.4 => 10.2.x
7.3.4 (or lower) =>8.1.7 => 8.1.7.4 => 10.2.x
8.0.n (or lower) =>8.1.7 => 8.1.7.4 => 10.2.x
8.1.n (or lower) =>8.1.7 => 8.1.7.4 => 10.2.x



Upgrade Compatibility Matrix for Upgrading to 10.1.x

Minimum Version of the database that can be directly upgraded to Oracle 10.1.x

Source Database Destination Database

8.0.6 (or higher) 10.1.x
8.1.7 (or higher) 10.1.x
9.0.1 (or higher) 10.1.x
9.2.0 (or higher) 10.1.x


The following database version will require an indirect upgrade path.


Source Database Upgrade Path Destination Database

7.3.4 (or lower) => 8.0.6 => 10.1.x
8.0.5 (or lower) => 8.0.6 => 10.1.x
8.1.6 (or lower) => 8.1.7 => 10.1.x


Upgrade Compatibility Matrix for Upgrading to 9.2.x

Minimum Version of the database that can be directly upgraded to Oracle 9.2.x

Source Database Destination Database

7.3.4 (or higher) 9.2.x
8.0.6 (or higher) 9.2.x
8.1.7 (or higher) 9.2.x
9.0.1 (or higher) 9.2.x


The following database version will require an indirect upgrade path

Source Database Upgrade Path Destination Database

7.3.3 (or lower) => 7.3.4 => 9.2.x
8.0.5 (or lower) => 8.0.6 => 9.2.x
8.1.6 (or lower) => 8.1.7 => 9.2.x


DOWNGRADE



Downgrade Compatibility Matrix for Downgrading from 11.2.x

Source Database Downgrade Possible to

11.2.x 10.1.0.5.0 (or higher)
11.2.x 10.2.0.3.0 (or higher)
11.2.x 11.1.0.6.0 (or higher)


Downgrade Compatibility Matrix for Downgrading from 11.1.x

Source Database Downgrade Possible to

11.1.x 10.1.0.5.0 (or higher)
11.1.x 10.2.0.3.0 (or higher)


Downgrade Compatibility Matrix for Downgrading from 10.2.x

Source Database Downgrade Possible to

10.2.x 9.2.0.6.0 (or higher)
10.2.x 10.1.0.4.0 (or higher)

Downgrade Compatibility Matrix for Downgrading from 10.1.x

Source Database Downgrade Possible to

10.1.x 9.2.0.4.0 (or higher)


Downgrade Compatibility Matrix for Downgrading from 9.2.x

Source Database Downgrade Possible to

9.2.x 9.0.1.3.0 (or higher)
9.2.x 8.1.7.3.0 (or higher)



NOTE
1 : If you have applied a patchset since upgrading then it will not be possible to downgrade.
For example: If you upgraded from 9.2.0.6 to 10.2.0.1 and then applied the 10.2.0.3 patchset, then you cannot downgrade from 10.2.0.3 to 9.2.0.6. (You can only downgrade from 10.2.0.3 to 9.2.0.6 if you upgraded from 9.2.0.6 to 10.2.0.3)


2 : You can only downgrade to a version if you previously upgraded from that version.
For example: You can downgrade an 11.1.0.6 database to 10.2.0.3 only if you upgraded the database from 10.2.3. If you created a new 11.1.0.6 database, then you cannot downgrade the database to 10.2.0.3. Also, if you upgraded directly from 9.2.0.8 to 11.1.0.6, then you cannot downgrade to 10.2.0.3 since you did not upgrade from 10.2.0.3.


3 : You cannot downgrade if the database parameter COMPATIBLE was ever set higher than the version you upgraded from.
For example: If you upgraded from 10.2.0.3 to 11.1.0.6, then after the upgrade set COMPATIBLE to 11.1.0.6, then no downgrade is possible. Also, if you upgraded directly from 9.2.0.8 to 11.1.0.6, then after upgrade set COMPATIBLE to 10.2.0.1, then
no downgrade is possible.

4 : You cannot upgrade database binaries from one major release to another.
For example : You cannot upgrade the binaries from 10.1.0.2.0 to 10.2.0.1.0. Major releases must be installed in a separate oracle home. You cannot install 10.2.0.x on any other major release to upgrade the oracle home.

Refer Metalink note : 551141.1