sunilthetechfreak.comsunilthetechfreak.com/wp-content/uploads/2014/09/upgrade... · Web viewOracle...

24
Upgrade non asm oracle database 11.2.0.1 to 11.2.0.4 using dbua My current environment OS : Enterprise Linux AS 4.5 64bit Kernel : 2.6.9-55.0.0.0.2.ELsmp Oracle Database software version Installed : 11.2.0.1 ORACLE_HOME = /u02/ap/oracle/product/11.2.0/dbhome1 ORACLE_SID = ora10gdb01 Currently I am having 5 database on this server [oracle@db10g ~]$ cat /etc/oratab # This file is used by ORACLE utilities. It is created by root.sh # and updated by the Database Configuration Assistant when creating # a database. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # ora10gdb01:/u02/app/oracle/product/11.2.0/dbhome1:N 10gdb02:/u02/app/oracle/product/11.2.0/dbhome1:N clone1:/u02/app/oracle/product/11.2.0/dbhome1:N clone2:/u02/app/oracle/product/11.2.0/dbhome1:N clone4:/u02/app/oracle/product/11.2.0/dbhome1:N clone5:/u02/app/oracle/product/11.2.0/dbhome1:N ora10gdb:/u01/app/oracle/product/10.2.0.1/db01:N

Transcript of sunilthetechfreak.comsunilthetechfreak.com/wp-content/uploads/2014/09/upgrade... · Web viewOracle...

Upgrade non asm oracle database 11.2.0.1 to 11.2.0.4 using dbua

My current environment

OS : Enterprise Linux AS 4.5 64bitKernel : 2.6.9-55.0.0.0.2.ELsmpOracle Database software version Installed : 11.2.0.1ORACLE_HOME = /u02/ap/oracle/product/11.2.0/dbhome1ORACLE_SID = ora10gdb01

Currently I am having 5 database on this server

[oracle@db10g ~]$ cat /etc/oratab# This file is used by ORACLE utilities. It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.

# A colon, ':', is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign, '#', are comments.## Entries are of the form:# $ORACLE_SID:$ORACLE_HOME:<N|Y>:## The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should , "Y", or should not,# "N", be brought up at system boot time.## Multiple entries with the same $ORACLE_SID are not allowed.##ora10gdb01:/u02/app/oracle/product/11.2.0/dbhome1:N10gdb02:/u02/app/oracle/product/11.2.0/dbhome1:Nclone1:/u02/app/oracle/product/11.2.0/dbhome1:Nclone2:/u02/app/oracle/product/11.2.0/dbhome1:Nclone4:/u02/app/oracle/product/11.2.0/dbhome1:Nclone5:/u02/app/oracle/product/11.2.0/dbhome1:Nora10gdb:/u01/app/oracle/product/10.2.0.1/db01:N

We will upgrade ora10gdb01 from 11.2.0.1 to 11.2.0.4 using dbua

Download patchset p13390677 from My Oracle Support

https://support.oracle.com

[oracle@db10g u03]$ lltotal 4898920drwxr-xr-x 4 oracle oinstall 4096 Jun 11 19:21 10gdb02drwxr-xr-x 3 oracle oinstall 4096 Jun 20 21:40 clone1drwxr-xr-x 3 oracle oinstall 4096 Jun 21 17:04 clone2drwxr-xr-x 3 oracle oinstall 4096 Jun 21 19:11 clone3drwxr-xr-x 3 oracle oinstall 4096 Jun 21 19:58 clone4drwxr-xr-x 3 oracle oinstall 4096 Jun 23 16:38 clone5drwxr-xr-x 3 oracle oinstall 4096 Jun 23 20:11 ora10gdbdrwxr-xr-x 4 oracle oinstall 4096 Jun 23 19:51 ora10gdb01-rw-r--r-- 1 oracle oinstall 2288121887 Jul 21 20:05 oraclehomebackupdb01.tar.gz-rw-r--r-- 1 oracle oinstall 176348295 Jul 21 20:07 oraclehomebackupdb02.tar.gz-rwxr-Sr-t 1 oracle oinstall 1395582860 Sep 13 17:43 p13390677_112040_Linux-x86-64_1of7.zip-rwxr-Sr-t 1 oracle oinstall 1151304589 Sep 13 17:46 p13390677_112040_Linux-x86-64_2of7.zip-rwxr-xr-x 1 oracle oinstall 171882 Mar 17 2008 README.html [oracle@db10g u03]$ unzip p13390677_112040_Linux-x86-64_1of7.zip[oracle@db10g u03]$ unzip p13390677_112040_Linux-x86-64_2of7.zip

Source the environment variable

[oracle@db10g ~]$ . oraenvORACLE_SID = [ora10gdb01] ? ora10gdb01

SQL> select instance_name, host_name, version, status from v$instance;

INSTANCE_N HOST_NAME VERSION STATUS---------- -------------------- ---------- ----------ora10gdb01 db10g.localdomain 11.2.0.1.0 OPEN

SQL> select comp_name, version, status from dba_registry;

COMP_NAME VERSION STATUS----------------------------------- ---------- ----------Oracle Enterprise Manager 11.2.0.1.0 VALIDOLAP Catalog 11.2.0.1.0 VALIDSpatial 11.2.0.1.0 VALIDOracle Multimedia 11.2.0.1.0 VALIDOracle XML Database 11.2.0.1.0 VALIDOracle Text 11.2.0.1.0 VALIDOracle Data Mining 11.2.0.1.0 VALIDOracle Expression Filter 11.2.0.1.0 VALIDOracle Rule Manager 11.2.0.1.0 VALIDOracle Workspace Manager 11.2.0.1.0 VALIDOracle Database Catalog Views 11.2.0.1.0 VALID

COMP_NAME VERSION STATUS----------------------------------- ---------- ----------

Oracle Database Packages and Types 11.2.0.1.0 VALIDJServer JAVA Virtual Machine 11.2.0.1.0 VALIDOracle XDK 11.2.0.1.0 VALIDOracle Database Java Packages 11.2.0.1.0 VALIDOLAP Analytic Workspace 11.2.0.1.0 VALIDOracle OLAP API 11.2.0.1.0 VALID

17 rows selected.

Create new folder to install new oracle home

[oracle@db10g u03]$ mkdir -p /u01/app/oracle/product/11.2.0/dbhome2

Set the oracle home to new home[oracle@db10g ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome2

I have unzipped patch (New software binaries) under /u03/database

[oracle@db10g ~]$ cd /u03/database/

[oracle@db10g database]$ ./runInstaller

Untick on I wish to receive security updates via my oracle support as this is a test lab.

Click on next

Click on yes and click next

Click on skip software updates and click on next

Click on Install database software only and click on next

Click on Single instance database installation and click on next

I have kept it default as this is my test lab or else select the required language to be installed and click on next

Click on Enterprise Edition and click on next

As I have set the new oracle home before running the installer its picking up correct oracle home location to be installed just verify and click on next.

Keep it default and click on next

After running the prerequisite checks if everything is fine it will show the summary page as below

Click on Install

Open another terminal as root user and run as below

[root@db10g ~]# /u01/app/oracle/product/11.2.0/dbhome2/root.sh

Performing root user operation for Oracle 11g

The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome2

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]: y Copying dbhome to /usr/local/bin ...The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)[n]: y Copying oraenv to /usr/local/bin ...The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)[n]: y Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.[root@db10g ~]#

The database software installation is successful

Click on close

Now run the dbua (Database upgrade assistant from the new home)

[oracle@db10g ~]$ $ORACLE_HOME/bin/dbua

Click on Next

Now select the database you need to upgrade. In our case it is ora10gdb01 and click next

Verify the warnings and resolve the issues . I am going to continue with the upgrade click on yes.

Click on recompile invalid objects at the end of upgradeClick on upgrade timezone version and timestamp with time zone dataClick on backup database and specify the directory in which it should save the backup and then click on next

I got warning to increase the undotbs so resize the undotbs tablespace

SQL> select name from v$datafile;

NAME--------------------------------------------------------------------------------/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/system01.dbf/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/sysaux01.dbf/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/users01.dbf/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/users02.dbf/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/undotbs02.dbf

SQL> alter database datafile '/u02/app/oracle/product/11.2.0/dbhome1/oradata/ora10gdb01/undotbs02.dbf' resize 800M;

Database altered.

As I want to move the files I selected move database files during upgrade and click on file system as we are not using ASM at this moment then click on Next.

Specify the where all the datafiles should be moved while upgrade as we have selected to move the datafile during upgrade.Click on Next

Specify flash recovery area and Fast recovery area size and click on next

I have not selected this option at this moment and click on next

It will show you the database upgrade summary. Click on finish to start the upgrade.

The upgrade process starts

As the upgrade completes click on ok. You will see the database summary

As you can see the database is successfully upgraded

You can change the database passwords for the required users and unlock the account or click on close

[oracle@db10g ~]$ . oraenvORACLE_SID = [oracle] ? ora10gdb01The Oracle base has been set to /u01/app/oracle

[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 17 16:06:38 2014

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

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select comp_name, version, status from dba_registry;

COMP_NAME VERSION STATUS----------------------------------- --------------- ---------------Oracle Enterprise Manager 11.2.0.1.0 VALIDOLAP Catalog 11.2.0.4.0 VALIDSpatial 11.2.0.4.0 VALIDOracle Multimedia 11.2.0.4.0 VALIDOracle XML Database 11.2.0.4.0 VALIDOracle Text 11.2.0.4.0 VALIDOracle Data Mining 11.2.0.4.0 VALIDOracle Expression Filter 11.2.0.4.0 VALIDOracle Rules Manager 11.2.0.4.0 VALIDOracle Workspace Manager 11.2.0.4.0 VALIDOracle Database Catalog Views 11.2.0.4.0 VALID

COMP_NAME VERSION STATUS----------------------------------- --------------- ---------------Oracle Database Packages and Types 11.2.0.4.0 VALIDJServer JAVA Virtual Machine 11.2.0.4.0 VALIDOracle XDK 11.2.0.4.0 VALIDOracle Database Java Packages 11.2.0.4.0 VALIDOLAP Analytic Workspace 11.2.0.4.0 VALIDOracle OLAP API 11.2.0.4.0 VALID

17 rows selected.

If you have any queries feel free to write to me at [email protected]

For more documents visit http://www.sunilthetechfreak.com

CheersSunil