Saturday, June 2, 2012

10.2.0.5 patch application and database upgrade from 10.2.0.4-hp-ux

10.2.0.5 patch application and database upgrade from 10.2.0.4-hp-ux

 Applying 10.2.0.5 patch and Database Upgrade:

 Introduction: Database patching primarily involves the following steps:

 1. Applying the patch using OUI.

 2. Upgrade the database to a higher version using Manual upgrade.

 Environment Details: Server Name LAB2.server.org(HP-UX)

Database Name LAB2 Current Oracle DB Version 10.2.0.4.0

Oracle Home Location /oraLAB201/u01/app/oracle/product/10.2.0/LAB2

 Listener Name LISTENER_LAB2

 Pre-checks &

Preparations before applying 10.2.0.5 patch set:

 1. Set the ORACLE_HOME and ORACLE_SID Environment Variables

 Enter the following commands to set the ORACLE_HOME and ORACLE_SID
 environment variables:
 $ ORACLE_HOME=/oraLAB201/u01/app/oracle/product/10.2.0/LAB2
$ ORACLE_SID= LAB2
$ export ORACLE_HOME ORACLE_SID

2. Shut Down Oracle Databases and related Oracle processes
 Shut down any existing Oracle Database instances with normal or immediate priority.
 $ emctl stop dbconsole
 $ lsnrctl stop LISTENER_ LAB2
 $ sqlplus “/ as sysdba”
 SQL> SHUTDOWN IMMEDIATE

 3. Back Up the Oracle Database and Oracle Home:

 Oracle recommends that you create a backup of the Oracle Inventory, Oracle 10g home and Oracle 10g Database before you install the patch set.

 Command to backup Oracle Home:

 tar -cvf orahome_.tar $ORACLE_HOME 


 Make sure that the latest full backup of the database was successful before proceeding with patch installation. 


 Also, take a backup of the following files: o Init.ora or spfile.ora,Tnsnames.ora,Listener.ora


 4. Comment out all the jobs scheduled for the database until the upgrade is over.


 $ crontab –e Comment the entries related to LAB2 database. 


 5. Display settings for GUI: If you are not installing the software on the local computer, then perform the following steps on remote machine (LAB2.server.org). 


 1. Enable the X11 option in Putty. Navigate as shown below. 


 Putty configurationàSSHàEnable X11(after loading the server in putty). 


 2. Launch the Xming application. 


 3. Execute XCLOCK command in the Usetxora02 server and it should give the clock window. 6. 


Initializing the Oracle Universal Installer: 


 Enter the following commands to start Oracle Universal Installer, 


where /home/oracle/patchdir/10205_Patch is the directory where you unpacked the patch set software: 


 $ cd /home/oracle/patchdir/10205_Patch /Disk1 


 $ ./runInstaller


 On the Welcome screen, click Next. 


On the Specify Home Details screen, 


select the name of the Oracle home that you want to update (10.2.0.4 in this case), 


or select the Path that you want to update from the list, then click Next.


 On the Product-specific Prerequisite Checks screen, 


correct any reported errors, and click Next. On the Summary screen, 


click Install. 


This screen lists all of the patches available for installation.


 When prompted, 


run the $ORACLE_HOME/root.sh script as the root user. 


(Contact the system admin to run this script)


. On the End of Installation screen, 


click Exit,


 then click Yes to exit from Oracle Universal Installer. 


 Post Installation Tasks Log in as the Oracle software owner user


. Set the values for the environment variables


 $ORACLE_HOME, 


$ORACLE_SID and 


$PATH. 


Start the listener as follows: 


$ lsnrctl start LISTENER_ LAB2

 Database Upgrade: Manually Upgrading a Release 10.2 Database

 If you are upgrading database manually,

then you should analyze it by running the Pre-Upgrade Information Tool.

 Run the Pre-Upgrade Information Tool

Start the database in the UPGRADE mode:

SQL> STARTUP UPGRADE

 Set the system to spool results to a log file for later analysis:

SQL> SPOOL upgrade_info.log

 Run the Pre-Upgrade Information Tool:

 SQL> @$ORACLE_HOME/rdbms/admin/utlu102i.sql

 Turn off the spooling of script results to the log file:

SQL> SPOOL OFF

 Check the output of the Pre-Upgrade Information Tool in the upgrade_info.log file

 Upgrading a Release 10.2 Database After you install the patch set,
you must perform the following steps on every database associated with the upgraded Oracle home:

 1. Log in as the Oracle software owner user


 2. Start the listener as follows: $ lsnrctl start LISTENER_LAB2

3. Enter the following SQL*Plus commands:

 SQL> STARTUP UPGRADE

 SQL> SPOOL patch.log

 SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql

 SQL> SPOOL OFF

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

This list provides the version and status of each SERVER component in the database.
 If necessary, rerun the catupgrd.sql script after correcting any problems.

 5. Restart the database:

 SQL> SHUTDOWN IMMEDIATE

 SQL> STARTUP

 POST UPGRADE CHECKS:

 Run the utlrp.sql script to recompile all invalid PL/SQL packages. 

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

 When the 10.2.0.5 patch set is applied to an Oracle10g Standard Edition database,

there may be 54 invalid objects after the utlrp.sql script runs.

 These objects belong to the unsupported components and do not affect the database operation.

 Ignore any messages indicating that the database contains invalid recycle bin objects similar to the following: BIN$4lzljWIt9gfgMFeM2hVSoA==$0

 Run the following command to check the status of all the components after the upgrade:

 SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;

 In the output of the preceding command, the status of all the components should be VALID for a successful upgrade.

 To configure and secure Enterprise Manager follow these steps:

 Ensure the database and Listener are operational.
 Execute
emca -upgrade db

 Note:If you are upgrading a database where Oracle Database Control is configured in non-secure mode, then Oracle Database Control will run in secure mode after upgrade.

 Removing the Patch Set Software The catdwgrd.sql script enables the user to restore the Oracle Database installation of the database back to the original 10.2 release that the user backed up before applying the patch set.
The catdwgrd.sql script is run in the 10.2.0.5 Oracle home to perform necessary downgrade actions.

 After the 10.2.0.4 release is restored, the catrelod.sql script is run from 10.2.0.4 Oracle home to reload the 10.2.0.4 release packages and views.

 Removing the Patch Set Software for Single Instance Installation Perform the following steps for removing the patch set from the 10.2.0.5 patch release:

 Use SQL*Plus to log in to the database as the SYS user with SYSDBA privileges:
 2. SQL> SHUTDOWN IMMEDIATE
 Take a backup of the following files in 10.2.0.5 Oracle home directory:
 $ ORACLE_HOME/rdbms/admin/catrelod.sql
 $ ORACLE_HOME/network/admin/tnsnames.ora
 Enter the following SQL*Plus commands:
 SQL> CONNECT SYS AS SYSDBA
 SQL> STARTUP DOWNGRADE
 SQL> SPOOL downgrade.out
 SQL> @?/rdbms/admin/catdwgrd.sql
 SQL> SPOOL OFF
 SQL> SHUTDOWN IMMEDIATE
 SQL> EXIT

 Review the downgrade.out file for errors.
 Restore the Oracle10g installation and Central Inventory (see /etc/oraInst.loc) that you backed up before applying the patch set.
After restoring the original Oracle home, copy the saved version of catrelod.sql script into the restored Oracle home rdbms/admin directory.
 Also copy the saved version 10.2.0.5/network/admin/tnsnames.ora
directory into the restored Oracle home /network/admin/tnsnames.ora directory,
 and then perform the following steps:

SQL> CONNECT SYS AS SYSDBA

 SQL> STARTUP DOWNGRADE

 SQL> SPOOL catrelod.out

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

 SQL> SPOOL OFF

 SQL> SHUTDOWN IMMEDIATE

 Review the catrelod.out file for errors.

Note: Ignore the ORA-29844 and ORA-31085 errors found in the catrelod.out file

. These errors are tracked with Oracle bugs 4758112 and 4425495 respectively.

 After reloading the 10.2.0.2 release, the version numbers for Oracle Data Mining and Oracle OLAP Analytic Workspace remain at 10.2.0.5.

These issues are tracked with Oracle bugs 4758695 and 4751917.

 Start the database and recompile the remaining invalid objects:

SQL> STARTUP

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

 Cross-check the status of installed components with the following script:

 SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY; *********************END OF DOCUMENT************************

No comments: