Saturday, June 19, 2021

Installing Oracle Restart Without ASM

By default Oracle resstart requires at least one ASM disk group to be created during the installation. This post shows steps for installing Oracle restart without creating any ASM disk group.
1. First step in this process is to install the grid infrastructure using the "software only" option. If OUI is used this will be the "Set up Software Only" option. For this post the test steup was done using the grid response file. The response file indicate which section to fill to do a software only instllation.
## To register software for 'Grid Infrastructure'                            ##
##  - Fill out sections A,B and D                                            ##
##  - Provide the cluster nodes in section D when choosing CRS_SWONLY as     ##
##    installation option in section A                                       ##
Section A consists of information for oraIneventory, oracle base and installation option.
#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/opt/app/oraInventory

#-------------------------------------------------------------------------------
# Specify the installation option.
# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY
#   - CRS_CONFIG  : To register home and configure Grid Infrastructure for cluster
#   - HA_CONFIG   : To register home and configure Grid Infrastructure for stand alone server
#   - UPGRADE     : To register home and upgrade clusterware software of earlier release
#   - CRS_SWONLY  : To register Grid Infrastructure Software home (can be configured for cluster
#                   or stand alone server later)
#   - HA_SWONLY   : To register Grid Infrastructure Software home (can be configured for stand
#                   alone server later. This is only supported on Windows.)
#   - CRS_ADDNODE : To add more nodes to the cluster
#   - CRS_DELETE_NODE : To delete nodes to the cluster
#-------------------------------------------------------------------------------
oracle.install.option=CRS_SWONLY

#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=/opt/app/oracle
Section B specify ASM related privileged user groups. Even though ASM is not configured in this case, it is possible to use the same set of user group that would be used in a ASM setup. If not setup the group appropriatly for the enviornment being setup.
################################################################################
#                                                                              #
#                              SECTION B - GROUPS                              #
#                                                                              #
#   The following three groups need to be assigned for all GI installations.   #
#   OSDBA and OSOPER can be the same or different.  OSASM must be different    #
#   than the other two.                                                        #
#   The value to be specified for OSDBA, OSOPER and OSASM group is only for    #
#   Unix based Operating System.                                               #
#   These groups are not required for upgrades, as they will be determined     #
#   from the Oracle home to upgrade.                                           #
#                                                                              #
################################################################################
#-------------------------------------------------------------------------------
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges.
#-------------------------------------------------------------------------------
oracle.install.asm.OSDBA=asmdba

#-------------------------------------------------------------------------------
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges.
# The value to be specified for OSOPER group is optional.
# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE.
#-------------------------------------------------------------------------------
oracle.install.asm.OSOPER=asmoper

#-------------------------------------------------------------------------------
# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This
# must be different than the previous two.
#-------------------------------------------------------------------------------
oracle.install.asm.OSASM=asmadmin
Section D has many parameters but for Oracle restart setup only the following is needed to be filled, which specify the hostname.
################################################################################
#                                                                              #
#                           SECTION D - CLUSTER & GNS                         #
#                                                                              #
################################################################################
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
oracle.install.crs.config.clusterNodes=ip-172-31-7-187

#-------------------------------------------------------------------------------
2. Install the grid infrastructure using the response file.
./gridSetup.sh -silent -responseFile grid.rsp
3. At the end of the installation the grid infrastructure would be configured to an Oracle restart configuration by running roothas.sh in GI_HOME/crs/install as the root user.
./roothas.sh
Using configuration parameter file: /opt/app/oracle/product/19.x.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /opt/app/oracle/crsdata/ip-172-31-12-240/crsconfig/roothas_2021-02-15_04-09-40PM.log
2021/02/15 16:09:41 CLSRSC-363: User ignored prerequisites during installation
Redirecting to /bin/systemctl restart rsyslog.service
LOCAL ADD MODE
Creating OCR keys for user 'oracle', 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 ip-172-31-12-240 successfully pinned.
2021/02/15 16:10:08 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

ip-172-31-12-240     2021/02/15 16:12:24     /opt/app/oracle/crsdata/ip-172-31-12-240/olr/backup_20210215_161224.olr     1944883066
2021/02/15 16:12:25 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
4. At this stage the resource states would be as below
Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.cssd                  ora.cssd.type             OFFLINE            OFFLINE
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-7-187
ora.ons                   ora.ons.type              OFFLINE            OFFLINE
It is important to have the cssd status online. Without it, when managing the databases following errors is thrown
$ srvctl start database -db testfs
PRCD-1024 : Failed to retrieve instance list for database testfs
PRCR-1055 : Cluster membership check failed for node ip-172-31-12-240
5. Enable the cssd to auto start and restart HAS.
crsctl modify resource "ora.cssd" -attr "AUTO_START=1" -unsupported
crsctl stop has
crsctl start has -nowait

Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.cssd                  ora.cssd.type             ONLINE             ONLINE             ip-172-31-7-187
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-7-187
ora.ons                   ora.ons.type              OFFLINE            OFFLINE


6. Add listener
srvctl add listener -endpoints tcp:1521
srvctl start listener

Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.LISTENER.lsnr         ora.listener.type         ONLINE             ONLINE             ip-172-31-7-187
ora.cssd                  ora.cssd.type             ONLINE             ONLINE             ip-172-31-7-187
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-7-187
ora.ons                   ora.ons.type              OFFLINE            OFFLINE
7. Enable ONS if this is used for data guard and client failover is setup.
srvctl enable ons
srvctl start ons

Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.LISTENER.lsnr         ora.listener.type         ONLINE             ONLINE             ip-172-31-7-187
ora.cssd                  ora.cssd.type             ONLINE             ONLINE             ip-172-31-7-187
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-7-187
ora.ons                   ora.ons.type              ONLINE             ONLINE             ip-172-31-7-187
8. Create the CDB. File system is given as the storage type for CDB and two directories are specified for datafileDestination and recoveryAreaDestination. These gets set to db_create_file_dest and db_recovery_file_dest since OMF is set to true. The CDB will be automatically registered with the HAS service and could be managed with srvctl commands.
dbca -createDatabase -gdbName testfs -templateName /home/oracle/New_Database.dbt 
-characterSet AL32UTF8 -emConfiguration DBEXPRESS 
-storageType FS -datafileDestination  /opt/data  
-recoveryAreaDestination /opt/fra 
-sysPassword testCDB1234 -systemPassword testCDB1234 
-createAsContainerDatabase true 
-memoryMgmtType AUTO_SGA  -enableArchive false 
-useOMF true  -nationalCharacterSet AL16UTF16 
-databaseConfigType SINGLE -silent

Resource Name             Type                      Target             State              Host
-------------             ------                    -------            --------           ----------
ora.LISTENER.lsnr         ora.listener.type         ONLINE             ONLINE             ip-172-31-7-187
ora.cssd                  ora.cssd.type             ONLINE             ONLINE             ip-172-31-7-187
ora.diskmon               ora.diskmon.type          OFFLINE            OFFLINE
ora.evmd                  ora.evm.type              ONLINE             ONLINE             ip-172-31-7-187
ora.ons                   ora.ons.type              ONLINE             ONLINE             ip-172-31-7-187
ora.testfs.db             ora.database.type         ONLINE             ONLINE             ip-172-31-7-187
9. Create the PDB
dbca -silent -createPluggableDatabase -pdbName testpdb -sourceDB $ORACLE_SID -createUserTableSpace true -pdbAdminPassword adminPBD123
10. If a data guard configuraiton is created from a similar setup and data guard broker is created then it will detect the presence of clusterware.
DGMGRL> validate database testfs2

  Database Role:     Physical standby database
  Primary Database:  testfs

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Managed by Clusterware:
    testfs :  YES
    testfs2:  YES
Related Posts
Oracle Extended Cluster Setup on 19c
Installing 19c (19.3) RAC on RHEL 7 Using Response File
Installing 18c (18.3) RAC on RHEL 7 with Role Separation - Clusterware
Installing 12cR2 (12.2.0.1) RAC on RHEL 6 with Role Separation - Clusterware
Installing 12c (12.1.0.2) Flex Cluster on RHEL 6 with Role Separation
Installing 12c (12.1.0.1) RAC on RHEL 6 with Role Separation - Clusterware
Installing 11gR2 (11.2.0.3) GI with Role Separation on RHEL 6
Installing 11gR2 (11.2.0.3) GI with Role Separation on OEL 6
Installing 11gR2 Standalone Server with ASM and Role Separation on RHEL 6
11gR2 Standalone Data Guard (with ASM and Role Separation)