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.

No comments:

Post a Comment