Thursday, 25 September 2014

Some Linux Disk Administration Commands


VMWare - Mount windows shared on Oracle Linux (OEL) Guest OS

[root@oel65 ~]# mount -t cifs -o username=*****,password=***** //192.168.XXX.XXX/shared_vm /mnt/shared

[root@oel65 ~]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   11G  4.0G  5.9G  41% /
tmpfs                         3.0G  264K  3.0G   1% /dev/shm
/dev/sda1                     485M   54M  406M  12% /boot
//192.168.210.1/shared_vm     465G  150G  316G  33% /mnt/stage


Vmware - Linux Guest - Add a New Hard Disk Without Rebooting Guest

Add new disk (scsi) using vmware (while guest running)
(*** Please notice only scsi disk allow operation while power on. ***)

[root@oel65 ~]# ls -lrt /dev/sdc*
ls: cannot access /dev/sdc*: No such file or directory
[root@oel65 ~]# ls /sys/class/scsi_host/
host0 host1 host2

[root@oel65 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

[root@oel65 ~]# ls -lrt /dev/sdc*
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdc

One can use below commands to use new disk
fdisk /dev/sdc
mkfs.ext3 /dev/sdc3
mkdir /disk3
mount -t ext3 /dev/sdc3 /disk3
umount /dev/sdc3


How to remove Single Device /dev/sdc ?

[root@oel65 ~]# ls -lrt /dev/sdc*
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdc

[root@oel65 ~]# echo 1 > /sys/block/sdc/device/delete

[root@oel65 ~]# ls -lrt /dev/sdc*
ls: cannot access /dev/sdc*: No such file or directory


Disk Partition and adding space to an existing Linux Volume

[root@oel65 ~]# df -h /
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   11G  4.0G  5.9G  41% /

[root@oel65 ~]# ls -lrt /dev/sd*
brw-rw----. 1 root disk 8,  0 Sep 25 13:11 /dev/sda
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdb
brw-rw----. 1 root disk 8,  2 Sep 25 13:11 /dev/sda2
brw-rw----. 1 root disk 8,  1 Sep 25 13:11 /dev/sda1

[root@oel65 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x1ce3c258.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ce3c258

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3263, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3263, default 3263):
Using default value 3263

Command (m for help): p

Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ce3c258

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3263    26210016   83  Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx
 5  Extended        42  SFS             86  NTFS volume set da  Non-FS data
 6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
 8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[root@oel65 ~]# ls -lrt /dev/sdb*
brw-rw----. 1 root disk 8, 16 Sep 25 15:15 /dev/sdb
brw-rw----. 1 root disk 8, 17 Sep 25 15:15 /dev/sdb1

[root@oel65 ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup
  PV Size               22.51 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              5762
  Free PE               0
  Allocated PE          5762
  PV UUID               mdlQ1P-eGJ9-P1B9-nqrx-bMBR-3y9B-AWYm9W

**If I would have been increased size of sda (disk)**then only below two command needed.
pvresize /dev/sda2
lvextend -l +100%FREE /dev/VolGroup/lv_root


As I have added new disk and want to add this disk space to an existing volume group, so here you go..


[root@oel65 ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               22.51 GiB
  PE Size               4.00 MiB
  Total PE              5762
  Alloc PE / Size       5762 / 22.51 GiB
  Free  PE / Size       0 / 0
  VG UUID               qM0KEH-9HNA-Hbs0-FcXd-xauD-KU1l-pm9XpP

[root@oel65 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/VolGroup/lv_root
  LV Name                lv_root
  VG Name                VolGroup
  LV UUID                zlM0mG-oavS-2CH6-B3Ct-oAEN-zJW4-3Jab0z
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2014-09-24 14:05:18 +0100
  LV Status              available
  # open                 1
  LV Size                10.51 GiB
  Current LE             2690
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/VolGroup/lv_swap
  LV Name                lv_swap
  VG Name                VolGroup
  LV UUID                bOFGL5-3jrz-03z1-TAai-F3Zf-2OpN-wqBPqP
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2014-09-24 14:05:20 +0100
  LV Status              available
  # open                 2
  LV Size                12.00 GiB
  Current LE             3072
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1


[root@oel65 ~]# pvcreate /dev/sdb1        <<<   Creating a New Physical Volume with the New Disk Image
  Physical volume "/dev/sdb1" successfully created

[root@oel65 ~]# vgscan                <<< Extending the Volume Group with the New Physical Disk
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup" using metadata type lvm2

[root@oel65 ~]# vgextend VolGroup /dev/sdb1
  Volume group "VolGroup" successfully extended

[root@oel65 ~]# lvscan                <<< Extending the Logical Volume with the New Volume Group
  ACTIVE            '/dev/VolGroup/lv_root' [10.51 GiB] inherit
  ACTIVE            '/dev/VolGroup/lv_swap' [12.00 GiB] inherit

[root@oel65 ~]# lvextend -l +100%FREE /dev/VolGroup/lv_root
  Extending logical volume lv_root to 35.50 GiB
  Logical volume lv_root successfully resized

[root@oel65 ~]# resize2fs /dev/VolGroup/lv_root    <<< Resizing the File System
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/VolGroup/lv_root is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
Performing an on-line resize of /dev/VolGroup/lv_root to 9306112 (4k) blocks.
The filesystem on /dev/VolGroup/lv_root is now 9306112 blocks long.

[root@oel65 ~]# df -h /
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   35G  4.0G   30G  13% /

Tuesday, 19 June 2012

Upgarde of database 11.1.0.7 (part of Oracle Apps R12.1) to 11.2.0.3

Now I am going to install Oracle Database 11.2.0.3 software as a part of database 11.1.0.7 (which is part of Oracle e-Business Suite R12.1) upgrade to database version 11.2.0.3

[oracle@oel52 tech_st]$ mkdir 11.2.0.3
[oracle@oel52 tech_st]$ ls -lrt
total 8
drwxr-xr-x 76 oracle dba      4096 May 31 16:11 11.1.0
drwxr-xr-x  2 oracle oinstall 4096 May 31 16:22 11.2.0.3
[oracle@oel52 tech_st]$ cd /source/OraDB11203
[oracle@oel52 OraDB11203]$ cd d*
[oracle@oel52 database]$ pwd
/source/OraDB11203/database
[oracle@oel52 database]$ [oracle@oel52 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 63953 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 11199 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

[root@oel52 11.2.0.3]# ./root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/R1213/db/tech_st/11.2.0.3

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
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 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.

So 11.2.0.3 database binaries is in place and now I will go for out-of-place upgrade of 11.1.0.7 using dbua by following below documents
Interoperability Notes EBS R12 with Database 11gR2 [ID 1058763.1]
[oracle@oel52 11.2.0.3]$ pwd
/u01/R1213/db/tech_st/11.2.0.3
[oracle@oel52 11.2.0.3]$
[oracle@oel52 11.2.0.3]$ mkdir -p admin/R12TEST1_oel52

[oracle@oel52 11.2.0.3]$ cd admin/R12TEST1_oel52
[oracle@oel52 R12TEST1_oel52]$ pwd
/u01/R1213/db/tech_st/11.2.0.3/admin/R12TEST1_oel52

After this make sure that:

    The ORACLE_BASE environment variable must be set accordingly.
    The ORACLE_HOME environment variable points to the new 11.2.0 Oracle home.
    The PATH environment variable includes $ORACLE_HOME/bin and the directory where the new perl executable is located (usually $ORACLE_HOME/perl/bin).
    The LD_LIBRARY_PATH environment variable includes $ORACLE_HOME/lib.
    The PERL5LIB environment variable points to the directories where the new perl libraries are located (usually $ORACLE_HOME/perl/lib/[perl version] and
$ORACLE_HOME/perl/lib/site_perl/[perl version])

[oracle@oel52 patches]$ export
PATH=/u01/R1213/db/tech_st/11.2.0.3/perl/bin:/u01/R1213/db/tech_st/11.2.0.3/perl/bin:/u01/R1213/db/tech_st/11.2.0.3/bin:/usr/bin:/usr/sbin:/u01/R1213/db/tech_st/11.2.0.3/appsutil/jre/bin:/usr/ccs/bin:/bin:/usr/bin/X11:/usr/local/bin:/u01/R1213/db/tech_st/11.2.0.3/OPatch:/usr/java/jdk1.6.0_24/bin:/usr/lib/qt-
3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/u01/R1213/inst/apps/R12TEST1_oel52/admin/scripts:.:.
[oracle@oel52 patches]$ export ORACLE_HOME=/u01/R1213/db/tech_st/11.2.0.3
[oracle@oel52 patches]$ export LD_LIBRARY_PATH=/u01/R1213/db/tech_st/11.2.0.3/lib:/usr/X11R6/lib:/usr/openwin/lib:/u01/R1213/db/tech_st/11.2.0.3/lib:/usr/dt/lib:/u01/R1213/db/tech_st/11.2.0.3/ctx/lib
[oracle@oel52 patches]$ export
PERL5LIB=/u01/R1213/db/tech_st/11.2.0.3/perl/lib/5.8.3:/u01/R1213/db/tech_st/11.2.0.3/perl/lib/site_perl/5.8.3:/u01/R1213/db/tech_st/11.2.0.3/appsutil/perl
[oracle@oel52 patches]$ export ORACLE_BASE=/u01/R1213/db/tech_st/11.2.0.3/admin/R12TEST1_oel52
[oracle@oel52 admin]$ export TNS_ADMIN=/u01/R1213/db/tech_st/11.2.0.3/network/admin/R12TEST1_oel52
[oracle@oel52 admin]$ export ADJVAPRG=/u01/R1213/db/tech_st/11.2.0.3/jdk/jre/bin/java
[oracle@oel52 admin]$ export ADPERLPRG=/u01/R1213/db/tech_st/11.2.0.3/perl/bin/perl
[oracle@oel52 admin]$ export SHLIB_PATH=/u01/R1213/db/tech_st/11.2.0.3/lib:/usr/lib:/u01/R1213/db/tech_st/11.2.0.3/ctx/lib
[oracle@oel52 R12TEST1_oel52]$ export LIBPATH=/u01/R1213/db/tech_st/11.2.0.3/lib:/usr/X11R6/lib:/usr/openwin/lib:/u01/R1213/db/tech_st/11.2.0.3/lib:/usr/dt/lib:/u01/R1213/db/tech_st/11.2.0.3/ctx/lib

Create nls/data/9idata directory

On the database server node, as the owner of the Oracle RDBMS file system and database instance, run the $ORACLE_HOME/nls/data/old/cr9idata.pl script to create the $ORACLE_HOME/nls/data/9idata directory.

After creating the directory, make sure that the ORA_NLS10 environment variable is set to the full path of the 9idata directory whenever you enable the 11g Oracle home.

[oracle@oel52 patches]$ perl $ORACLE_HOME/nls/data/old/cr9idata.pl
Creating directory /u01/R1213/db/tech_st/11.2.0.3/nls/data/9idata ...
Copying files to /u01/R1213/db/tech_st/11.2.0.3/nls/data/9idata...
Copy finished.
Please reset environment variable ORA_NLS10 to /u01/R1213/db/tech_st/11.2.0.3/nls/data/9idata!
[oracle@oel52 patches]$ echo $ORA_NLS10
/u01/R1213/db/tech_st/11.2.0.1/nls/data/9idata
[oracle@oel52 patches]$ export ORA_NLS10=/u01/R1213/db/tech_st/11.2.0.3/nls/data/9idata
[oracle@oel52 patches]$ echo $ORA_NLS10
/u01/R1213/db/tech_st/11.2.0.3/nls/data/9idata
Apply below additional 11.2.0.3 RDBMS patches but don't run post-patch steps
For all UNIX/Linux platforms:
    4247037
    9858539
    12942119
    12960302
    12985184
    13001379
    13004894
    13258936
    13366268

Drop SYS.ENABLED$INDEXES (conditional)
If the SYS.ENABLED$INDEXES table exists, use SQL*Plus to connect to the database as SYSDBA and running the following command to drop it:
SQL> drop table sys.enabled$indexes;
drop table sys.enabled$indexes
               *
ERROR at line 1:
ORA-00942: table or view does not exist

Run pre-upgrade script, analyze and resolve errors, if any
SQL> @/u01/R1213/db/tech_st/11.2.0.3/rdbms/admin/utlu112i.sql
As per information from pre-upgrade script output, dba_recycle has been purged and DMSYS schema (which is no longer used for Data Mining) has been dropped.

Better to run pre-clone on both tier on source environment.

Shutdown source database and listener

Create R12TEST1 listener in 11.2.0.1 database and set oracle_sid and oracle_home of newly created 11.2.0.1 software.

Copy $TNS_ADMIN from old oracle_home to new oracle_home and modify listener.ora and tnsnames.ora file as per new oracle_home

[oracle@oel52 admin]$ cp -R * /u01/R1213/db/tech_st/11.2.0.3/network/admin
[oracle@oel52 R12TEST1_oel52]$ which lsnrctl
/u01/R1213/db/tech_st/11.2.0.3/bin/lsnrctl

[oracle@oel52 ~]$ lsnrctl start R12TEST1
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 15-JUN-2012 13:35:01
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /u01/R1213/db/tech_st/11.2.0.3/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/R1213/db/tech_st/11.2.0.3/network/admin/R12TEST1_oel52/listener.ora
Log messages written to /u01/R1213/db/tech_st/11.2.0.3/admin/R12TEST1_oel52/diag/tnslsnr/oel52/r12test1/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel52.localdomain)(PORT=1531)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel52.localdomain)(PORT=1531)))
STATUS of the LISTENER
------------------------
Alias                     R12TEST1
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                15-JUN-2012 13:35:06
Uptime                    0 days 0 hr. 0 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/R1213/db/tech_st/11.2.0.3/network/admin/R12TEST1_oel52/listener.ora
Listener Log File         /u01/R1213/db/tech_st/11.2.0.3/admin/R12TEST1_oel52/diag/tnslsnr/oel52/r12test1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel52.localdomain)(PORT=1531)))
Services Summary...
Service "R12TEST1" has 1 instance(s).
  Instance "R12TEST1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@oel52 ~]$ ps -ef | grep tns
oracle   21823     1  1 13:35 ?        00:00:00 /u01/R1213/db/tech_st/11.2.0.3/bin/tnslsnr R12TEST1 -inherit
oracle   21839 20779  0 13:35 pts/2    00:00:00 grep tns

Start DBUA from the Oracle home where the new database software has been installed
[oracle@oel52 11.2.0.3]$ cd bin
 [oracle@oel52 bin]$ ./dbua
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match

[oracle@oel52 bin]$ echo $DISPLAY
localhost:10.0

[root@oel52 ~]# xhost +
access control disabled, clients can connect from any host
[root@oel52 ~]# xauth list
localhost.localdomain:1  MIT-MAGIC-COOKIE-1  b47350745b145a83eac4fb10826ff086
oel52.localdomain/unix:1  MIT-MAGIC-COOKIE-1  b47350745b145a83eac4fb10826ff086
oel52.localdomain/unix:13  MIT-MAGIC-COOKIE-1  31fb408ec52e582e5e9b666a1101af27
oel52.localdomain/unix:12  MIT-MAGIC-COOKIE-1  978bbf78028db39eef74469b7d0cd042
oel52.localdomain/unix:10  MIT-MAGIC-COOKIE-1  2b965c8d121a01cac19717a857212cef
oel52.localdomain/unix:11  MIT-MAGIC-COOKIE-1  554ce6b2d80ad4ea1509edbbdf71abff

[oracle@oel52 bin]$ xauth add oel52.localdomain/unix:10  MIT-MAGIC-COOKIE-1  2b965c8d121a01cac19717a857212cef
[oracle@oel52 bin]$ ./dbua


 
Ignore this message.

 
As you can see “Configuring Database with Enterprise Manager” is failed, I will see it later as I don’t consider this as important part of upgrade, and now I am going to complete rest of the post steps for upgrade.

Copy .env file from old home to new database home and modify as required.

Modify initialization parameters
Use the following sections in document 396009.1, Database Initialization Parameter Settings for Oracle Applications Release 12 on My Oracle Support as a guideline:

Common database initialization parameters
Release-specific database initialization parameters for 11gR2
Database initialization parameter sizing


Perform patch post-install instructions
Run all the patch post install instructions except for those of 13001379 and 13366268. There is no need to run the post install instructions of 13001379 and 13366268 as they are run as part of the database upgrade.

Run adgrants.sql
Copy $APPL_TOP/admin/adgrants.sql from the administration server node to the database server node and execute as SYSDBA

SQL> ! pwd
/u01/R1213/db/tech_st/11.2.0.3/rdbms/admin

SQL> ! cp /u01/R1213/apps/apps_st/appl/admin/adgrants.sql .

SQL> show user
USER is "SYS"
SQL> @adgrants.sql APPS

Grant create procedure privilege on CTXSYS
Copy $AD_TOP/patch/115/sql/adctxprv.sql from the administration server node to the database server node and execute as SYSDBA
SQL> !pwd
/u01/R1213/db/tech_st/11.2.0.3/rdbms/admin

SQL> ! cp /u01/R1213/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adctxprv.sql .

SQL> show user
USER is "SYS"
SQL> @adctxprv.sql <SYSTEM passwd> CTXSYS

Set CTXSYS parameter
Use SQL*Plus to connect to the database as SYSDBA and run the following command
SQL> show user
USER is "SYS"
SQL> exec ctxsys.ctx_adm.set_parameter('file_access_role', 'public');

Validate Workflow ruleset
On the administration server node, use SQL*Plus to connect to the database as APPS and run the $FND_TOP/patch/115/sql/wfaqupfix.sql script using the following command:

SQL> show user
USER is "APPS"
SQL> @/u01/R1213/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/wfaqupfix.sql APPLSYS APPS

Implement and run AutoConfig
Using AutoConfig to Manage System Configurations in Oracle E-Business Suite Release 12 [ID 387859.1]  Follow Section 3.2. Enabling AutoConfig on a New Oracle Home

Gather statistics for SYS schema
Copy $APPL_TOP/admin/adstats.sql from the administration server node to the database server node. Note that adstats.sql has to be run in restricted mode. Use SQL*Plus to connect to the database as SYSDBA and use the following commands to run adstats.sql in restricted mode:
$ sqlplus "/ as sysdba"
SQL> alter system enable restricted session;
SQL> @adstats.sql
$ sqlplus "/ as sysdba"
SQL> alter system disable restricted session;
SQL> exit;

Re-create grants and synonyms
Oracle Database 11g Release 2 (11.2) contains new functionality for grants and synonyms compared to previous database releases. As a result, you must re-create the grants and synonyms in the APPS schema. On the administration server node, as the owner of the Applications file system, run AD Administration and select the "Recreate grants and synonyms for APPS schema" task from the Maintain Applications Database Objects menu.

Restart Applications server processes
Restart all the Application tier server processes that you shut down previously. Remember that the Oracle Net listener for the database instance, as well as the database instance itself, need to be started in the 11.2 Oracle home. Users may return to the system.

Synchronize Workflow views
Log on to Oracle E-Business Suite with the "System Administrator" responsibility. Click Requests > Run > Single Request and the OK button. Enter the following parameters:

Request Name = Workflow Directory Services User/Role Validation
p_BatchSize = 10000
p_Check_Dangling = Yes
Add missing user/role assignments = Yes
Update WHO columns in WF tables = No

Click "OK" and "Submit". 

Now I am going to Configure “Database with Enterprise Manager” as this was failed earlier.
Checked log file emConfig.log and found below:
oracle.sysman.emcp.exception.EMConfigException: Password file may be missing or configured incorrectly.

OK So let me re-create password file under $ORACLE_HOME and see
orapwd file=$ORACLE_HOME/dbs/orapwR12TEST1.ora password=<passwd> force=y

Changed password of both dbsnmp and sysman as SYSDBA
Run below command to re-configure database with enterprise manager.

[oracle@oel52 dbs]$ emca -config dbcontrol db -repos recreate

Hooray..it’s done now.

Now Login into Oracle Application R12 and do sanity checks to confirm application is running after db upgrade:


 
So, yes application is working fine. Well done.

One can check output of below sql as well:

select COMP_NAME, VERSION, STATUS from dba_registry

COMP_NAME                                     VERSION         STATUS
--------------------------------------------- --------------- -----------
Oracle Enterprise Manager                     11.2.0.3.0      VALID
Oracle XML Database                           11.2.0.3.0      VALID
OLAP Catalog                                  11.2.0.3.0      VALID
Oracle Text                                   11.2.0.3.0      VALID
Spatial                                       11.2.0.3.0      VALID
Oracle Multimedia                             11.2.0.3.0      VALID
Oracle Database Catalog Views                 11.2.0.3.0      VALID
Oracle Database Packages and Types            11.2.0.3.0      VALID
JServer JAVA Virtual Machine                  11.2.0.3.0      VALID
Oracle Database Java Packages                 11.2.0.3.0      VALID
Oracle XDK                                    11.2.0.3.0      VALID
Oracle Real Application Clusters              11.2.0.3.0      INVALID
OLAP Analytic Workspace                       11.2.0.3.0      VALID
Oracle OLAP API                               11.2.0.3.0      VALID

14 rows selected.

Optionally one can apply below security patches:

Apply patch 13696216 on R12 database home 11.2.0.3. Instructions should be followed as per the readme of this patch. This is applied by unzipping the patch and using the OPatch tool. OPatch utility version 11.2.0.3.0 or later must be used to apply this patch and this is the only pre-requisite for applying this patch.

After applying Patch: 13696216 (which is Patch Set Update 11.2.0.3.2 on top of 11.2.0.3.0), apply patch 13656236, 13705338

Invalid Objects after Database upgrade to 11.2.0.3

SQL> select owner, count(*) from dba_objects where status='INVALID' group by owner;

OWNER                            COUNT(*)
------------------------------ ----------
APPS                                    2

SQL> select object_name, object_type from dba_objects where status='INVALID' and owner='APPS';

OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE
-------------------
IGW_BUDGET_CATEGORY_V
VIEW

IGW_REPORT_PROCESSING
PACKAGE BODY

As per note Invalid IGW Objects while Upgrading to Oracle Database 11g [ID 965907.1], one can safely ignore above invalid objects.