Manual Upgrade Single Instance Oracle Database 11.2.0.3 to 11.2.0.4 Part 2


Apply July 2016 PSU to 11.2.0.4 database (optional):
1.      Set ORACLE_HOME variable to 11.2.0.4.































[oracle@oeldev01 ~]$ cat .bash_profile
# .bash_profile
umask 022

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

TMP=/tmp
TMPDIR=$TMP
export TMP TMPDIR

ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2
export ORACLE_HOME

TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN

ORACLE_SID=orcl01
export ORACLE_SID

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

#PATH=$PATH:$HOME/bin
export PATH
2.     Upgrade 11.2.0.4 opatch to latest version.











[oracle@oeldev01 ~]$ cd $ORACLE_HOME
[oracle@oeldev01 dbhome_2]$ ./OPatch/opatch version
OPatch Version: 11.2.0.3.4

OPatch succeeded.
[oracle@oeldev01 dbhome_2]$ mv OPatch OPatch_11.2.0.3.4
[oracle@oeldev01 dbhome_2]$ unzip /u02/installers/p6880880_112000_BS2000.zip -d .
 [oracle@oeldev01 dbhome_2]$ ./OPatch/opatch version
OPatch Version: 11.2.0.3.12

OPatch succeeded.
3.                 Download and unzip July 2016 PSU.















[oracle@oeldev01 ~]$ cd /u02/installers/
[oracle@oeldev01 installers]$ ls -ltr
total 109640
drwxr-xr-x. 7 oracle oinstall      4096 Aug 27  2013 database
-rwxr-x---. 1 oracle oinstall   7599699 Sep  6 20:06 p6880880_112000_BS2000.zip
-rwxr-x---. 1 oracle oinstall     24612 Sep  6 20:06 dbupgdiag.sql
-rwxr-x---. 1 oracle oinstall 104635639 Sep  6 20:11 p23054359_112040_Linux-x86-64.zip
[oracle@oeldev01 installers]$ unzip p23054359_112040_Linux-x86-64.zip
Archive:  p23054359_112040_Linux-x86-64.zip
[oracle@oeldev01 installers]$ ls -ltr
total 109716
drwxr-xr-x.  7 oracle oinstall      4096 Aug 27  2013 database
drwxrwxr-x. 13 oracle oinstall      4096 Jun 16 00:10 23054359
-rw-rw-r--.  1 oracle oinstall     72206 Jul 19 21:56 PatchSearch.xml
-rwxr-x---.  1 oracle oinstall   7599699 Sep  6 20:06 p6880880_112000_BS2000.zip
-rwxr-x---.  1 oracle oinstall     24612 Sep  6 20:06 dbupgdiag.sql
-rwxr-x---.  1 oracle oinstall 104635639 Sep  6 20:11 p23054359_112040_Linux-x86-64.zip
4.                Apply the PSU.












[oracle@oeldev01 installers]$ cd 23054359/
[oracle@oeldev01 23054359]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.12 
OPatch succeeded.
[oracle@oeldev01 23054359]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

OPatch succeeded.
[oracle@oeldev01 23054359]$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12

OPatch succeeded.

Upgrade 11.2.0.3 to 11.2.0.4:
1.      Run Pre-Upgrade Information Tool (utlu112i.sql) and make necessary adjustments.
After installing 11.2.0.4 RDBMS software, log in to the 11.2.0.3 instance with the previous ORACLE_HOME and spool/run 11.2.0.4 $ORACLE_HOME/rdbms/admin/utlu112i.sql script against the running, previous instance.





















[oracle@oeldev01 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@oeldev01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 7 17:17:31 2016

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


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

SQL> SPOOL utlu112i.log
SQL> @/u01/app/oracle/product/11.2.0/dbhome_2/rdbms/admin/utlu112i.sql
Oracle Database 11.2 Pre-Upgrade Information Tool 09-07-2016 17:18:00
Script Version: 11.2.0.4.0 Build: 007
.
SQL> EXIT
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
2.     Run dbupgdiag.sql.
Run dbupgdiag.sql from below My Oracle Support doc to verify that all the components in dba_registry are valid and no invalid data dictionary objects exist in dba_objects.

Note 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)















[oracle@oeldev01 ~]$ ls -ltr dbupgdiag.sql
-rwxr-x---. 1 oracle oinstall 24612 Sep  7 17:20 dbupgdiag.sql
[oracle@oeldev01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 7 17:21:29 2016

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


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

SQL> @dbupgdiag.sql

PL/SQL procedure successfully completed.



3.                 Check and recompile invalid objects.
Run $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid objects.






SQL> COLUMN object_name format a30
SQL> SELECT owner, object_name, object_type FROM dba_objects WHERE status='INVALID';

no rows selected

SQL>
4.                Copy parameter and password files from 11.2.0.3 to 11.2.0.4.
Update first pfile in 11.2.0.3 instance.









SQL> CREATE pfile from spfile;

File created.

SQL> EXIT
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@oeldev01 ~]$ cd $ORACLE_HOME/dbs
[oracle@oeldev01 dbs]$ cp initorcl01.ora orapworcl01 /u01/app/oracle/product/11.2.0/dbhome_2/dbs
5.                 Copy network configuration files from 11.2.0.3 to 11.2.0.4.
[oracle@oeldev01 dbs]$ cd $TNS_ADMIN
[oracle@oeldev01 admin]$ ls -ltr
total 16
-rw-r--r--. 1 oracle oinstall  205 May 11  2011 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4096 Jun 15 18:01 samples
-rw-r--r--. 1 oracle oinstall  387 Jun 16 14:53 listener.ora
-rw-r--r--. 1 oracle oinstall  462 Sep  9 14:11 tnsnames.ora
[oracle@oeldev01 admin]$ cp listener.ora tnsnames.ora /u01/app/oracle/product/11.2.0/dbhome_2/network/admin
6.                Copy database control files from 11.2.0.3 to 11.2.0.4.
Do this if enterprise manager database control is configured and being used.

[oracle@oeldev01 admin]$ cd $ORACLE_HOME
[oracle@oeldev01 dbhome_1]$ ls -ltr
drwxr-----.  3 oracle oinstall  4096 Jun 16 16:11 oeldev01_orcl01
drwxr-xr-x.  2 oracle oinstall  4096 Sep  7 17:25 dbs
[oracle@oeldev01 dbhome_1]$ cp -avr oeldev01_orcl01 /u01/app/oracle/product/11.2.0/dbhome_2/

[oracle@oeldev01 dbhome_1]$ cd $ORACLE_HOME/oc4j/j2ee
[oracle@oeldev01 j2ee]$ ls -ltr
total 32
drwxr-x---.  6 oracle oinstall 4096 Jun 15 18:00 OC4J_DBConsole
drwxr-xr-x.  5 oracle oinstall 4096 Jun 15 18:00 OC4J_Workflow_Management_Container
drwxr-xr-x.  5 oracle oinstall 4096 Jun 15 18:00 OC4J_Workflow_Component_Container
drwxr-xr-x.  3 oracle oinstall 4096 Jun 15 18:00 oc4j_applications
drwxr-xr-x.  2 oracle oinstall 4096 Jun 15 18:01 utilities
drwxr-xr-x. 14 oracle oinstall 4096 Jun 15 18:01 home
-rw-r--r--.  1 oracle oinstall 1006 Jun 15 18:03 deploy_db_wf.ini
drwxr-x---. 10 oracle oinstall 4096 Jun 16 16:04 OC4J_DBConsole_oeldev01_orcl01
[oracle@oeldev01 j2ee]$ cp -avr OC4J_DBConsole_oeldev01_orcl01 /u01/app/oracle/product/11.2.0/dbhome_2/oc4j/j2ee/

7.                 Shutdown database.
[oracle@oeldev01 ~]$ echo $ORACLE_SID $ORACLE_HOME
orcl01 /u01/app/oracle/product/11.2.0/dbhome_1
[oracle@oeldev01 ~]$ ps -ef | grep pmon
[oracle@oeldev01 ~]$ emctl status agent
Agent is Running and Ready
[oracle@oeldev01 ~]$ sqlplus / as sysdba 
SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@oeldev01 ~]$ lsnrctl stop listener_orcl01 
[oracle@oeldev01 ~]$ emctl stop dbconsole
8.                Make sure environment variables are set to point to 11.2.0.4 installation.
Update /etc/oratab with the new ORACLE_HOME.
[oracle@oeldev01 ~]$ echo $ORACLE_SID
orcl01
[oracle@oeldev01 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_2
[oracle@oeldev01 ~]$ cat /etc/oratab
orcl01:/u01/app/oracle/product/11.2.0/dbhome_2:N
[oracle@oeldev01 ~]$
9.                Upgrade the database manually.
Start sqlplus and run catupgrd.sql script from the newly installed $ORACLE_HOME/rdbms/admin. Check catupgrd.sql spool file for errors.
Here’s the spooled upgrade log.
10.            Restart the database in normal mode and run catuppst.sql.
[oracle@oeldev01 ~]$ sqlplus / as sysdba 
SQL> startup
SQL> @?/rdbms/admin/catuppst.sql
Here’s the spooled catuppst.sql log.
Restart also the listener (and database control).
Recompile invalid objects using utlrp.sql.

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

SQL>
11.              Run dbupgdiag.sql and verify that all the components in dba_registry are valid and there are no invalid objects in dba_objects.
[oracle@oeldev01 ~]$ ls -ltr dbupgdiag.sql
-rwxr-x---. 1 oracle oinstall 24612 Sep  7 17:20 dbupgdiag.sql
[oracle@oeldev01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 9 15:25:45 2016

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


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

SQL> @dbupgdiag.sql


Deinstall 11.2.0.3 binaries:
1.      Deinstall the old 11.2.0.3 ORACLE_HOME.
The listener was also de-configured in this example, so I just created a new one using netca.
[oracle@oeldev01 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/deinstall/
[oracle@oeldev01 deinstall]$ ./deinstall
ADVERTISING




No comments: