Vous êtes sur la page 1sur 25

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.

4 | MANUAL

UPGRADE ORACLE DATABASE FROM 10.2.0.1 TO 10.2.0.4

This article is intended as a brief guide to upgrade Oracle Database from 10.2.0.1 to 10.2.0.4 on Oracle Enterprise Linux (OEL 5.5) for Self Practice. I explain step by step how to upgrade oracle database from 10.2.0.1 to 10.2.0.4 using DBUA ( DATBASE UPGRADE ASSISTANT) - We can

upgrade database to 10.2.0.4 either using DBUA or MANUAL method. Patch no : p6810189 Database Product : Oracle 10.2.0.1 Operating System : Oracle Enterprise Linux (OEL) 5.5 I am going to apply oracle patchset 10.2.0.4 (patch number 6810189) on 10.2.0.1 database. We can download from Oracle metalink (MOS). We

need a support contract to obtain a MOS. PRE -REQUISITES CHECK TO BEFORE APPLYING THE PATCHSET CHECKING DATABASE VERSION : SQL> SELECT * FROM V$VERSION;
BANNER

Oracle Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production

TNS for Linux: Version 10.2.0.1.0 Production NLSRTL Version 10.2.0.1.0 - Production

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

CHECKING DATABASE COMPONENTS AND ITS STATUS View dba_registry displays information about the components loaded

into the database. We can query this view to find database components are valid or not , on version (10.2.0.1). SQL > SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS

Oracle Database Catalog Views Oracle Database Packages and Types Oracle Workspace Manager JServer JAVA Virtual Machine Oracle XDK Oracle Database Java Packages Oracle Expression Filter Oracle Data Mining Oracle Text Oracle XML Database Oracle Rules Manager Oracle interMedia OLAP Analytic Workspace Oracle OLAP API OLAP Catalog Spatial Oracle Enterprise Manager 17 rows selected.

10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0 10.2.0.1.0

VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID VALID

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

CHECK DATABASE OBJECTS ARE VALID OR NOT SQL> select object_name, status from dba_objects where status='INVALID'; No rows selected
NO INVALID OBJECTS. If we find any invalid objects then execute script

utlrp.sql to compile all invalid objects within a whole database . SQL> @?/rdbms/admin/utlrp.sql; It can be found in the standard admin dir of the $ORACLE_HOME. This recompiles all existing PL/SQL modules that were previously in an INVALID state, such as (packages, procedures, functions, triggers, types , etc . PREPARING FOR THE DATABASE UPGRADE
STOP ALL ORACLE COMPONENTS ( LISTENER, EMC , ISQL*PLUS ) STOPPING THE EM DBCONSOLE

linux> $ emctl stop dbconsole TZ set to Asia/Calcutta Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved. http://oel.linuxserver:1158/em/console/aboutApplication Stopping Oracle Enterprise Manager 10g Database Control ... ... Stopped.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

STOPPING ISQL*Plus linux> $ isqlplusctl stop iSQL*Plus 10.2.0.1.0 Copyright (c) 2003, 2005, Oracle. All rights reserved. Stopping iSQL*Plus ... iSQL*Plus stopped. CHECK LISTENER IS RUNNING OR NOT linux> $ ps -ef | grep tns linux> $ lsnrctl stop LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-APR-2013 04:45:33 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel.linuxserver)(PORT=1521)))

The command completed successfully ALREADY STOPPED PERFECTLY- OTHER OPTIONS TO CHECK ; linux> $ ps -ef | grep tns linux> $ ps -ef | grep ema linux> $ ps -ef | grep pmon We need to take full backup of the database. Once the oracle database is shutdown, take a cold backup of oracle database and a backup of our
$ORACLE_HOME.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

SHUTDOWN THE DATABASE SQL> SHOW USER; USER is "SYS" SQL> shut immediate; Database closed. Database dismounted. ORACLE instance shut down. Take a backup of $ORACLE_HOME and Database So, I am going to take a backup of $ORACLE_HOME and database using tar. we can take a cold backup of our database then a backup of our $ORACLE_HOME and Oracle Inventory. Using TAR Command backup for { datafiles/control files/Log files } All my data files , control files and log files are in a directory orcl at the location /u01/app/oracle/oradata/ If these files are at separate locations then add all those locations into the tar archive. linux> $ cd /u01/app/oracle/oradata/ linux> $ tar -czf /home/oracle/orclbackup.tar.gz orcl Using TAR Command backup $ORACLE_HOME linux> $ echo $ORACLE_HOME /u01/app/oracle/product/10.2.0/db_1

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

linux> $ cd /u01/app/oracle/product/10.2.0/ linux> $ ls -l linux> $ drwxr-xr-x 55 oracle oinstall 4096 Apr 22 04:30 db_1 So , I would make a tar archive of "db_1" directory. linux> $ tar -czf /home/oracle/orclhomebackup.tar.gz db_1 Using TAR Command backup oraInventory directory linux> $ more /etc/oraInst.loc inventory_loc=/u01/app/oracle/oraInventory inst_group=oinstall linux> $ cd /u01/app/oracle/ linux> $ tar -czf /home/oracle/oraInv_backup.tar.gz oraInventory/ Lets check /home/oracle path. linux> $ ls /home/oracle/ Desktop oraInv_backup.tar.gz orclbackup.tar.gz orclhomebackup.tar.gz Manage data with TimeZone before upgrade If anyone have huge volume of data and scheduler jobs, kindly follow the
README.TXT file according to your environment.

Manage your data with Time Zone before upgrade In my environment there are no data and scheduler jobs with Time Zone information thats why I skip the step. Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

If you have huge volume of data and scheduler jobs means please follow the below steps SQL> SELECT VERSION FROM V$TIMEZONE_FILE;
Version

2 If this gives 4 then we may simply proceed with the upgrade even if you have TZ data. If this gives higher then 4 look at the Meta link note: Note 553812.1 If this gives lower then 4 perform the following steps: Download utltzpv4.sql from www.metalink.oracle.com and run it.

timezone.txt

APPLYING THE PATCH- (6810189) Downloading the Patch from Oracle (metalink.oracle.com)

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

PLEASE NOTE : For Linux x86 (32-bit): 10.2.0.4 for Linux x86 For Linux x86-64 (64-bit): 10.2.0.4 for Linux x86-64
UNZIP and Installing the Patch

Unzip the 10.2.0.4 patchset software to a location (/tmp). This will create a directory by name Disk1. I login as $oracle user and going to unzip the file (patch-6810189). Before unzip the patch login as # root and execute following command. linux> # xhost + SI:localuser:oracle localuser:oracle being added to access control list linux> # su - oracle linux> $ unzip p6810189_10204_Linux-x86.zip inflating: Disk1/install/lsnodes extracting: Disk1/install/addLangs.sh inflating: Disk1/install/addNode.sh inflating: Disk1/install/oraparamsilent.ini inflating: Disk1/10204_buglist.htm Go to Disk1 directory. Start runInstaller from there. linux> $ cd Disk1 linux> $ ./runInstaller Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

1- The First Screen is Welcome Screen.

2 - Provide the Oracle home details here ( The oracle 10.2.0.1 home).

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

NOTE (ON SCREEN SHOT 2 )

If correct ORACLE_HOME is not pointing here , please use browse option and select it. 3 - The installer will perform prerequisite checks on this screen. Make sure you see the message "The overall result of this check is passed" in the output.

4- In the next screen, Oracle configuration Manager allows you to associate your configuration with your metalink support account. You need to provide My Oracle Support details. But I have not seen most of DBAs really provide any details. You may skip this. Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

>> No need to enter details, we may skip this screen >>

5- Installation Summary.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

6 - Installation Progress.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

7 -You will be asked to perform some root specific actions. Once progress shows 100%, execute root.sh as root user (in real time, DBAs will not have root access, so to execute this script SYS admins will help us).

8 - Login as root (#) # which dbhome /usr/local/bin/dbhome /* This shows the location of dbhome, oraenv and coraenv files rename them for 10.2.0.1 as the root.sh create new ones for 10.2.0.4 */ # cd /usr/local/bin/ # mv dbhome dbhome_10201 # mv oraenv oraenv_10201 # mv coraenv coraenv_10201 Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL


NOTE :

We can save copies of these files, but this is not required. It is recommended to use the latest versions of these files provided by the patch.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

10 - When root.sh finishes successfully come back to installer and hit ok. Then you should see the End of Installation page as below.

POINTS TO NOTE :

Now that 10.2.0.4 binaries installation completed. Now we need to upgrade our database to 10.2.0.4. This we can either using DBUA or Manual method. You can check here how to do that using DBUA. Database upgrade assistant is used to upgrade database to higher versions and can be invoked just like DBCA. The disadvantage of

DBUA is, it can be used only once where as manual process can be used Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

multiple times even if it fails. In this doc i am explaining manual procedure. Lets start .

>> GOING TO OPEN MY DATABASE

We can see the database is unable to open and throwing the error ORA-01092. Lets look at the alert log file to know what actually happened.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL >> ERROR DETAILS >> The alert log states that the database has to be upgraded first using UPGRADE option to be able to OPEN normally. $ cd $ORACLE_BASE $ tail -f admin/orcltest/bdump/alert_orcltest.log SMON: enabling cache recovery Mon Oct 7 03:25:50 2013 Errors in file /u01/app/oracle/admin/orcltest/udump/orcltest_ora_21703.trc: ORA-00704: bootstrap process failure ORA-39700: database must be opened with UPGRADE option

UPGRADE THE DATABASE FROM 10.2.0.1 TO 10.2.0.4 Now we try to startup the database with upgrade option.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

We run the pre-upgrade information tool to see if the database is okay for the upgrade and if there is some thing to be changed before starting the upgrade.

@utlu102i.sql

The output from utlu102i.sql shows that everything is fine, no changes are required and the database is ready for upgrade. We need to run a script called CATUPGRD.SQL which will actually do the upgrade of the database. LETS START THE UPGRADE PROCESS. EXECUTE FOLLOWIN SCRIPT SQL>@$ORACLE_HOME/rdbms/admin/catupgrd.sql

. . .

[ Output trimmed ]
. . . .

see spool file to get more details

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

The upgrade got completed successfully. Now shutdown the database and startup in normal mode . When the upgrade script catupgrd.sql finishes shutdown the database and open the spool of the upgrade process and try to find out if anything failed. If you see something failed try to fix it and re-run the upgrade process. The upgrade process may leave many objects invalid in the database. Perform a normal startup and run the utlrp.sql script to recompile any invalid objects. SQL>select count(*) from dba_objects where status='INVALID'; >> If you get any invalid objects count , should execute utlrp.sql script. SQL>@$ORACLE_HOME/rdbms/admin/utlrp.sql

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

Below is the method to find out if upgrade is successful or not

We can see the database components are at 10.2.0.4 version now. Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL Following screenshot indicates that the upgrade was successful

TWO PIECES TO YOUR UPGRADE

1. Installing the 10.2.0.4 patch on top of the 10.2.0.1 binaries - you need to back up the $ORACLE_HOME and oraInventory directories before you apply the patch - If the binary upgrade fails for any reason, you can restore the $ORACLE_HOME and oraInventory from backups and re-apply the 10.2.0.4 binaries. 2. If the above step is successful, then you need to upgrade the database using DBUA. Again, before you start the upgrade, you backup the database. If there are any issues during this portion, you simply restore the database from backups and perform the upgrade again. Purpose of the oraInventory and what does it content ? Purpose is for Oracle installer/patcher to know what products you have already installed in which versions. The list of all products installed with the versions/patches/home directory/home name.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

3) Why it is required to keep ? Deletion of this file can affect database ? It is necessary to OUI/opatch to INSTALL/DEINSTALL ( COMPONENTS/ VERSIONS/ PATCHES.).

Deletion of OraInventory does NOT impact databases (it is not required for normal running of the database, but is required for patches and upgrades) but you'll be no more able to INSTALL/DEINSTALL/PACTH Oracle components. After Patch on 10.2.0.1 database , Should we need (10.2.0.1.0 $ORACLE_HOME) for current database? Is this really necessary?
IT DEPENDS - If there are multiple databases running out of the 10.2.0.1

HOME and you want to only upgrade some of those database to 10.2.0.4, then you will have to create/clone a new 10.2.0.1 HOME, apply the 10.2.0.4 patch to the new HOME, and upgrade needed databases to 10.2.0.4 and use the new HOME for them. Hit below link (Cloning an oracle home). http://docs.oracle.com/cd/B19306_01/install.102/b1566 7/app_cloning.htm#CIHGCJBS If you have only one database in the 10.2.0.1 HOME, or are wanting to upgrade all databases in the 10.2.0.1 HOME to 10.2.0.4, then you do not require a separate 10.2.0.1 HOME. Shutdown all of the databases. Apply the 10.2.0.4 patch, upgrade all of the databases, bring up the upgraded databases. Let's suppose the upgrade process fails, Hit the link to refer it :
http://www.scribd.com/doc/187584951/Restore-the-Database-Back-to-10-2-0-1

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | MANUAL

CHECK ORACLE PATCH STATUS SQL>DESC SYS.REGISTRY$HISTORY SQL>SELECT * FROM SYS.REGISTRY$HISTORY;

HOW TO PATCH A DATABASE ? First see readme doc before applying Patchset Patch sets are a mechanism for delivering fully tested and integrated product fixes. Patch sets provide bug fixes only; they do not include new functionality and they do not require certification on the target system. All patch has readme part, so you need to check patch's read me part and follow to steps. By the way version specific notes are already avaliable at metalink.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Vous aimerez peut-être aussi