Tuesday, May 2, 2017

Upgrading Grid Infrastructure Used for Single Instance from 11.2.0.4 to 12.1.0.2

In this post we’ll see the Upgrade of Grid Infrastructure used for Single Instance from 11.2.0.4 to 12.1.0.2.

Note :-
Prior to upgrade make sure ASM SPfile is residing in ASM not on local file system (@/dbs/spfile+ASM.ora). ASM upgrade would fail with Using configuration parameter file: /u01/app/ grid2/crs/install/crsconfig_params

Upgrading ASM failed with the following message:
ORA-32002: cannot create SPFILE already being used by the instance
or
Upgrading ASM failed with the following message:
ORA-01565: error in identifying file '/u01/app/grid1/dbs/spfile+ASM.ora'
ORA-27037: unable to obtain file status

11.2.0.4 GI Home: /u01/app/grid1
12.1.0.2 GI Home: /u01/app/grid2

1. Make sure that ohas and asm and the listener is running under the existing 11.2.0.4 GI_HOME
  

poc$ export ORACLE_HOME=/u01/app/grid1

poc$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg                                 ONLINE  ONLINE       poc
ora.DATA1.dg                               ONLINE  ONLINE       poc
ora.LISTENER.lsnr                          ONLINE  ONLINE       poc
ora.LSNR_POC_1530.lsnr                 ONLINE  ONLINE       poc
ora.asm                                       ONLINE  ONLINE       poc                 Started
ora.ons                                        OFFLINE OFFLINE      poc
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd                        1        ONLINE  ONLINE       poc
ora.diskmon                  1         OFFLINE OFFLINE
ora.evmd                      1        ONLINE  ONLINE       poc
ora.testdb.db                 1        ONLINE  ONLINE       poc                 Open,STABLE




     2. Any databases which are accessing ASM instance from the 11.2.0.4 GI_HOME must be shutdown.  The listener (ASM Listener) should be running from the 11.2.0.4.GI_HOME


poc$ export ORACLE_SID=testdb
Connected to (local): POC DATABASE FOR OEM PATCHING

poc$ srvctl status database -d testdb
Database is running.

poc$ srvctl stop database -d testdb

poc$  srvctl config asm
ASM home: /u01/app/grid1
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.9393937
ASM diskgroup discovery string: /dev/oracleasm/disks/*





   3.  Unset all oracle environment variables - except for ORACLE_BASE e.g.  unset ORACLE_HOME

   4. Having set up your xDISPLAY you can then start up


  poc$ cd /tmp/
  poc$ ./runInstaller


Enter details about software update and progress until you reach the "Select Installation Option" Page - Upgrade Grid Infrastructure and Oracle ASM .
The Installer will recognize that you are running Oracle Restart and ASM and assume that you want to upgrade.

Note: -
 1. You will be asked for the 12.1.0.2.0 software location i.e. where the new 12.1.0.2.0 GI_HOME will be.  From 11.2 all Grid Infrastructure (Oracle Restart and Clusterware) upgrades are "out-of-place” upgrades.  This means that you install 12.1.0.2.0 alongside the existing 11.2.0.4 GI_HOME.

2. Once the 12.1.0.2 Grid Infrastructure/ASM software has been installed in the new GI_HOME and linking has taken place, the Installer will pop up a window asking you to run rootupgrade.sh from the new 12.1.0.2 GI_HOME.

3. The rootupgrade.sh script carries out the upgrade of ASM for you - it will shutdown ASM and then restarts it afterwards. You should ensure that any databases accessing this ASM instance are shut down before running rootupgrade.sh

sample output of rootupgrade.sh:-


[root@poc ~]# /u01/app/grid2/rootupgrade.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/grid2

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

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: /u01/app/grid2/crs/install/crsconfig_params

ASM Configuration upgraded successfully.

Creating OCR keys for user 'oracle', privgrp 'dba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node poc successfully pinned.
2016/10/24 09:34:23 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'

2016/10/24 09:35:25 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'

2016/10/24 09:36:46 CLSRSC-482: Running command: 'upgrade model  -s 11.2.0.4.0 -d 12.1.0.2.0 -p first'

2016/10/24 09:36:54 CLSRSC-482: Running command: 'upgrade model  -s 11.2.0.4.0 -d 12.1.0.2.0 -p last'

poc     2016/10/24 09:36:55     /u01/app/grid2/cdata/poc/backup_20161024_093655.olr     0

poc     2016/10/18 15:26:03     /u01/app/grid1/cdata/poc/backup_20161018_152603.olr     -
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'poc'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'poc'
CRS-2673: Attempting to stop 'ora.LSNR_POC_1530.lsnr' on 'poc'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'poc'
CRS-2677: Stop of 'ora.DATA.dg' on 'poc' succeeded
CRS-2673: Attempting to stop 'ora.DATA1.dg' on 'poc'
CRS-2677: Stop of 'ora.DATA1.dg' on 'poc' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'poc'
CRS-2677: Stop of 'ora.LSNR_POC_1530.lsnr' on 'poc' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'poc' succeeded
CRS-2677: Stop of 'ora.asm' on 'poc' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'poc'
CRS-2677: Stop of 'ora.evmd' on 'poc' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'poc'
CRS-2677: Stop of 'ora.cssd' on 'poc' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'poc' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2016/10/24 09:37:56 CLSRSC-327: Successfully configured Oracle Restart for a standalone server




5. Start your database


export ORACLE_SID=testdb
poc$ srvctl status database -d testdb
Database is not running.
poc$ srvctl start database -d testdb



6. Verify Installation


poc$  export ORACLE_HOME=/u01/app/grid2/

poc$ ./crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [11.2.0.4.0] >> It got changed after logout/login

poc$  ./crsctl query has softwareversion
Oracle High Availability Services version on the local node is [12.1.0.2.0]

poc$ exit

poc$ export ORACLE_HOME=/u01/app/grid2/

poc$  ./crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [12.1.0.2.0]

poc$ ./crsctl query has softwareversion
Oracle High Availability Services version on the local node is [12.1.0.2.0]

poc$ srvctl config asm
ASM home: /u01/app/grid2/
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.925572487
ASM diskgroup discovery string: /dev/oracleasm/disks/*

poc$ export ORACLE_HOME=/u01/app/grid2/

poc$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg                                ONLINE  ONLINE       poc
ora.DATA1.dg                              ONLINE  ONLINE       poc
ora.LISTENER.lsnr                         ONLINE  ONLINE       poc
ora.LSNR_POC_1530.lsnr                ONLINE  ONLINE       poc
ora.asm                                      ONLINE  ONLINE       poc                 Started
ora.ons                                       OFFLINE OFFLINE      poc
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd                       1        ONLINE  ONLINE       poc
ora.diskmon                  1        OFFLINE OFFLINE
ora.evmd                      1       ONLINE  ONLINE       poc
ora.testdb.db                 1       ONLINE  ONLINE       poc                 Open,STABLE

poc$ ./crsctl query has softwareversion
Oracle High Availability Services version on the local node is [12.1.0.2.0]


7. Since the database remains in 11g version only the compatible.asm attribute is updated to 12c version[If Required].


SQL> select group_number, name,compatibility, database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME                           COMPATIBILITY                  DATABASE_COMPATIBILITY
------------ ------------------------------ ------------------------------ ----------------------------------------
           1 DATA1                          11.2.0.0.0                     10.1.0.0.0
           2 DATA                            11.2.0.0.0                     10.1.0.0.0

SQL>    alter diskgroup data set attribute 'compatible.asm'='12.1.0.2.0';

Diskgroup altered.

SQL>  alter diskgroup data1 set attribute 'compatible.asm'='12.1.0.2.0';

Diskgroup altered.

SQL> select group_number, name,compatibility, database_compatibility from v$asm_diskgroup;


GROUP_NUMBER NAME                           COMPATIBILITY                  DATABASE_COMPATIBILITY
------------ ------------------------------ ------------------------------ ----------------------------------------
           1 DATA1                          12.1.0.2.0                     10.1.0.0.0
           2 DATA                            12.1.0.2.0                     10.1.0.0.0 


No comments:

Post a Comment