Wednesday, February 29, 2012

How to upgrade oracle 11.2.0.1 to 11.2.0.3 through PUTTY or SILENT MODE

Hi Guys,

Upto 10g release 2 database upgradation means first you need to install  base version then apply the upgrade patch. Ex:  If you want to install 10.2.0.5 database software  first install the base version i.e 10.2.0.1 then apply the upgrade patch(ex 10.2.0.5) on that base version so that software will upgraded.

Coming  to 11g Release 2 upgradation means each version patch is equalent  to base version [Here is there no concept of base version]. You can directly install that patch version and upgrade the database. 

 You are installing 11.2.0.3 software and migrating the database to 11.2.0.3.
==========================================================

Step1: Download the below patches for upgrading database.
#Oracle 11.2.0.3 patchset(10404530) is available.
  In metalink you can download, install and upgrade your database.
Depend on OS version download the patch(P1040530), You can see 7 attachments but database upgradation first two is enough.  Download  those patches and unzip it . Now you will get database as a folder.
Step2: Check the database name and current version.
SQL> select name from v$database;

NAME
---------
DB11G

SQL>
select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

step3: Check the oratab file entry
$
cat /etc/oratab
DB11G:/u01/app/oracle/product/11.2.0.1/server:N

Step4: Installing the 11.2.0.3 software.
#su – oracle
$cd /u01/app/oracle/product
$mkdir 11.2.0.3
Now go to software folder
$cd /mnt/database
$ ./runInstaller -silent -ignoreSysPrereqs –ignorePrereq –debug –force \ ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3 \
ORACLE_HOME_NAME=OraDbHome2  \
oracle.install.option=INSTALL_DB_SWONLY  \
oracle.install.db.InstallEdition=EE  \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
 DECLINE_SECURITY_UPDATES=true

Press Enter
 Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 8684 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-02-07_09-22-33PM. Please wait ...
/u01/app/oraInventory/logs/installActions2012-02-07_09-22-33PM.log

Note: Here it may run background level, just open another putty session just check the above log.    At end of the installation, you will get text like run root.sh under root user it means installation is completed else still its running.  You need to wait until the root.sh script information displaying.



As a root user, execute the following script(s):
1. /u01/app/oracle/product/11.2.0.3/server/root.sh


Step5: Run the root.sh script
$
su -
Password:
#
/u01/app/oracle/product/11.2.0.3/server/root.sh
Check /u01/app/oracle/product/11.2.0.3/server/install/root_inatech_2012-02-07_09-39-25.log for the output of root script

#
cat /u01/app/oracle/product/11.2.0/dbhome_2/install/root_inatech_2012-02-07_21-39-25.log
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.3/server
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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

Step6: Upgrading the database
#su – oracle

Stop the listeners.
$
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/server
$
export PATH=$ORACLE_HOME/bin:$PATH
$
cd /u01/app/oracle/product/11.2.0.3/server/bin
$ type dbua
dbua is /u01/app/oracle/product/11.2.0/dbhome_2/bin/dbua
 $ dbua -silent -sid DB11G
Log files for the upgrade operation are located at: /u01/app/oracle/cfgtoollogs/dbua/DB11G/upgrade1
Performing Pre Upgrade
1% complete
7% complete
Upgrading Oracle Server
8% complete
9% complete
10% complete
10% complete
11% complete
12% complete
13% complete
13% complete
14% complete
15% complete
16% complete
16% complete
17% complete
18% complete
….
84% complete
Upgrading Oracle Workspace Manager
Upgrading Expression Filter
Upgrading Rule Manager
Upgrading Oracle Application Express
Upgrading Oracle OLAP API
Performing Post Upgrade
85% complete
86% complete
92% complete
Generating Summary
Database upgrade has been completed successfully, and the database is ready to use.
100% complete
Check the log file "/u01/app/oracle/cfgtoollogs/dbua/logs/silent.log" for upgrade details.

Step7: Check the oratab file entry for that database.
$ cat /etc/oratab
DB11G:/u01/app/oracle/product/11.2.0.3/server:N

SQL>
select name from v$database;

NAME
---------
DB11G

SQL>
select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Step8: * Copy some configures from old Oracle Home *
SQL>SHUT IMMEDIATE
Copy the parameter file (pfile or spfile) from old home to new home.
Copy the listener.ora, tnsname.ora file from old path to new path.
Ex
$cp /u01/app/oracle/product/11.2.0.1/server/dbs/spfileDB11G.ora /u01/app/oracle/product/11.2.0.3/server/dbs

$ cp /u01/app/oracle/product/11.2.0.1/server/network/admin/listener.ora /u01/app/oracle/product/11.2.0.3/server/network/admin/
$ lsnrctl start
*** Make sure no application opens files at old Oracle Home ***
# lsof | grep "/oracle/product/11.2.0.1/server"
...


Step9: start the database and listeners
#su – oracle
$. oraenv
$sqlplus ‘/as sysdba’
Sql>startup

Note: Check the listener status. From 11g release 2 onwards listeners concept is changed.  For listener status check another post.

7 comments:

  1. Superb Murali..... U r rocking..!!!!

    ReplyDelete
  2. Great Post Murali...Good Job man!!!!

    Manish

    ReplyDelete
  3. nice post!! well done

    ReplyDelete
  4. Excellent, worked like a charm! Thank you!

    As a quick hint for those who want to install another edition than Enterprise, here are the values for the option in the "runInstall" command:

    oracle.install.db.InstallEdition=EE # Enterprise Edition
    oracle.install.db.InstallEdition=SE # Standard Edition
    oracle.install.db.InstallEdition=SEONE # Standard Edition One

    ReplyDelete
  5. Awesome work! saved me a day!

    ReplyDelete
  6. Anyway to do this in place so you don't have to go change ORACLE_HOME from 11.2.0.1 to 11.2.0.3 all over the place now?

    ReplyDelete

Share your knowledge it really improves, don't show off...