10.2.0.4_patchset-installation - on - 10.2.0.1 by dbua

37
Upgrading Oracle Database from 10.2.0.1 to 10.2.0.4 | DBUA UPGRADE DATABASE USING DBUA 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 . Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Upload: grthiyagu-oracle-dba

Post on 27-Nov-2015

192 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

UPGRADE DATABASE USING DBUA 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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 2: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

CHECKING DATABASE COMPONENTS AND IT’S 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 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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 3: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

17 rows selected.

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 4: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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.

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.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 5: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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.

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 6: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 7: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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/

Let’s 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 that’s why I skip the step.

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 8: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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.

APPLYING THE PATCH- (6810189)

Downloading the Patch from Oracle (metalink.oracle.com)

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 9: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

1- The First Screen is Welcome Screen.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 10: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 11: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 12: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

You need to provide My Oracle Support details. But I have not seen most of

DBA’s really provide any details. You may skip this.

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

5- Installation Summary.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 13: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

6 - Installation Progress.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 14: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

7 -You will be asked to perform some root specific actions.

Once progress shows 100%, execute root.sh as root user (in real time, DBA’s

will not have root access, so to execute this script SYS admins will help us).

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 15: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

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

Page 16: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 17: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

10 - When root.sh finishes successfully come back to installer

and hit ok. Then you should see the End of Installation page as

below.

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. In this

document, I am showing how to do that using DBUA.

DBUA – DATABASE UPGRADE ASSISTANT is used to upgrade

database to higher versions and can be invoked just like

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 18: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

DBCA. The disadvantage of DBUA is , it can be used only

once.

OPEN THE TERMINAL AND TYPE dbua

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 19: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 20: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 21: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

In the next screen, DBUA provides the option for taking backup.

If we have not done backup already, we can use this.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 22: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 23: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 24: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 25: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 26: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 27: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

ADDITIOANL INFORMATION

********

'TWO PIECES TO YOUR UPGRADE Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 28: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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 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

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 i need (10.2.0.1.0 $ORACLE_HOME) for my current

database ?  

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 29: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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/

b15667/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.

CHECK ORACLE PATCH STATUS

SQL>DESC SYS.REGISTRY$HISTORY

SQL>SELECT * FROM SYS.REGISTRY$HISTORY;

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

Page 30: 10.2.0.4_patchset-Installation - On - 10.2.0.1 by Dbua

Upgrading Oracle Database from 10.2.0.1 to

10.2.0.4 | DBUA

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