Wednesday, January 7, 2015

Upgrading Grid Infrastructure 11g to 12c

In this post I will be demonstrating the steps to upgrade Oracle Grid Infrastructure (GI) 11g (11.2.0.4) to Grid Infrastructure 12c (12.1.0.2). Since ASM runs from GI home, ASM would be upgraded automatically while the upgrade of GI. First release version of 12c was 12.1.0.1 and for this example, I would be using 12.1.0.2. As we know that
Oracle now provides full installation binaries for patchset releases, so the binaries (12.1.0.2) are required to be downloaded from MOS – which is patch number 17694377 (Disk 3 and 4). Upgrade in this example is being done on Oracle Linux 6 (x86-64) running on Oracle Virtual Box. There is also an Oracle 11g (11.2.0.4) database (“db11g”) running on this host having files on ASM. After the upgrade of GI, 11g database files would still remain on upgraded ASM.

Please also note the upgrade from 11.2.0.3 to 11.2.0.4 is almost similar and same article can be used to perform this upgrade. Likewise, came article can be used if you want to upgrade from 11.2.0.4 grid infrastructure to 12.2.0.x

Before moving forward, make sure that all 12c pre-installation tasks have been completed as mentioned in this Oracle official document https://docs.oracle.com/database/121/LADBI/pre_install.htm


Installation/Upgrade Steps
You should log in as Grid Infrastructure software owner to perform this installation. Stop the databases (db11g) which is dependent on 11g GI (ASM).
$srvctl stop database –d db11g

Extract the binaries from 12.1.0.2 GI patchset
Before starting the installer, you should unset ORACLE_HOME and ORACLE_BASE environment variables as these would be set automatically during the installation

$unset ORACLE_BASE
$unset ORACLE_HOME
$./runInstaller 



Select 3rd option for upgrade and Click Next




























Click Next




























Click the checkbox and provide OMS details if you have OEM, to which you would like your database to register with. Click Next




























Select appropriate OS groups. Click Next




























Enter appropriate values for Oracle Base and Oracle Home directories. Click Next




























Click Next




























Resolve any warnings or errors during Prerequisite Check. In my case, my Virtual Box was lacking sufficient RAM so I saw following warning which I “Ignored”. Click Next




























Click Install




























Monitor the progress




























When prompted, open a new terminal window and after login as user root, execute rootupgrade.sh
























Output of rootupgrade.sh should be similar to the following
[root@salman1 ~]# /u02/app/grid/product/12.1.0/grid/rootupgrade.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u02/app/grid/product/12.1.0/grid

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 by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u02/app/grid/product/12.1.0/grid/crs/install/crsconfig_params

ASM Configuration upgraded successfully.

Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node salman1 successfully pinned.
2014/12/29 15:54:20 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.conf'

2014/12/29 15:55:23 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.conf'

2014/12/29 15:57:07 CLSRSC-482: Running command: 'upgrade model  -s 11.2.0.4.0 -d 12.1.0.2.0 -p first'

2014/12/29 15:57:16 CLSRSC-482: Running command: 'upgrade model  -s 11.2.0.4.0 -d 12.1.0.2.0 -p last'


salman1     2014/12/29 15:57:17     /u02/app/grid/product/12.1.0/grid/cdata/salman1/backup_20141229_155717.olr     0

salman1     2014/12/26 09:40:42     /u01/app/grid/product/11.2.0/grid/cdata/salman1/backup_20141226_094042.olr     -
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'salman1'
CRS-2673: Attempting to stop 'ora.CRS.dg' on 'salman1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'salman1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'salman1'
CRS-2677: Stop of 'ora.CRS.dg' on 'salman1' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'salman1' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'salman1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'salman1'
CRS-2677: Stop of 'ora.asm' on 'salman1' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'salman1'
CRS-2677: Stop of 'ora.evmd' on 'salman1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'salman1'
CRS-2677: Stop of 'ora.cssd' on 'salman1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'salman1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2014/12/29 16:00:44 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

After executing the rootupgrade.sh, click OK and installer would move forward for executing some more steps. Keep monitoring.
Once done, click Close to finish the Install/upgrade the process




























Now you can update your .bash_profile of GI Software Owner (grid) to reflect new ORACLE_HOME and other environment variables. Once done, you can check how your GI is doing after the upgrade and check the versions of different GI components

[grid@salman1 ~]$ echo $ORACLE_HOME
/u02/app/grid/product/12.1.0/grid
[grid@salman1 ~]$ echo $PATH
/u02/app/grid/product/12.1.0/grid/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/grid/bin
[grid@salman1 ~]$ crsctl query has softwareversion
Oracle High Availability Services version on the local node is [12.1.0.2.0]
[grid@salman1 ~]$ srvctl config asm
ASM home: <CRS home>
PRCA-1057 : Failed to retrieve the password file location used by ASM asm
PRCR-1097 : Resource attribute not found: PWFILE

While using “srvctl config asm” command, you will see the error message highlighted above in red. This is because from 12.1 onward, ASM instance  resource (you can see ora.asm resource in the output of “crsctl stat res –t”), has an attribute named PWFILE which is currently not configured because this ora.asm resource is upgraded from 11g and 11g did not have this attribute. You can find solution of this problem here.

Now your GI home and all services are upgraded and running from new 12c home. You may remove 11g Oracle GI home using deinstall utility. You can also now startup your 11g database, but remember that srvctl command should be used from 11g database home to manage this 11g database. 

$/u01/oracle/product/11.2.4/db_1/bin/srvctl start database -d db11g


Related Articles

5 comments:

  1. A useful article, thanks for posting.

    ReplyDelete
  2. Thanks for Sharing, this makes it very Easy for someone planning for something similar.

    ReplyDelete
  3. Awesome. I am going to install 12.2.0.1 Grid, ASM and the database soon. I am sure this article will be helpful to me.
    Thank you very much.
    Ram Srinivasan

    ReplyDelete
  4. this is not a rac setup, only tried to upgrade database from 11204 to 12101 in virtualbox, first upgraded ASM to 12101, after upgrading ASM from 11204 to 12101 i was unable to start database using srvctl start database -d from oracle11204 home as u mentioned above, and

    i am getting this error

    [oracle@rac1 bin]$ srvctl start database -d prod1
    PRCR-1079 : Failed to start resource ora.prod1.db
    CRS-5017: The resource action "ora.prod1.db start" encountered the following error:
    ORA-01078: failure in processing system parameters
    . For details refer to "(:CLSN00107:)" in "/grid/app/grid2/diag/crs/rac1/crs/trace/ohasd_oraagent_oracle.trc".

    ohasd_oraagent_oracle_2.trc contains,

    Could not connect to the Event Manager daemon
    2018-07-27 16:22:42.108089 : CLSCEVT:2249467648: (:CLSCE0028:)clsce_unsubscribe 0x7f9f80068540 successfully unsubscribed : 0
    2018-07-27 16:22:43.108350 : CLSCEVT:2249467648: clsce_subscribe 0x7f9f740265c0 filter='^CRS_RESOURCE_PROFILE_CHANGE.*NAME='ora\.(scan|rac1\.vip).*RESOURCE_CLASS='(scan_vip|vip)'', flags=1, handler=0xa4b772, arg=0x7f9f74023bc0

    ReplyDelete
  5. Thanks a lot Salman :-)
    This is a very nice article...

    ReplyDelete

Popular Posts - All Times