ACL resource



Colleague had an issue with ASM not starting and I think this was due to groups / users being changed during install. Asked to check this and came across this :

[grid@ORA01 ~]$ crsctl stat res ora.asm -f | grep -i acl

ACL=owner:grid:rwx,pgrp:asmdba:r-x,other::r--

should have been (comparing with a working server)

ACL=owner:grid:rwx,pgrp:oinstall:r-x,other::r--

After a lot of digging the command to change this is (why it is necessary to have something unsupported) 

[root@uszw2q2c2ods01 lib]# crsctl setperm resource ora.asm -g 'oinstall' -unsupported

[root@uszw2q2c2ods01 lib]# crsctl stat res ora.asm -f | grep -i acl

ACL=owner:grid:rwx,pgrp:oinstall:r-x,other::r--

DESCRIPTION=Oracle ASM resource

Still have an issue with ASM but made a note of this for future reference

Patching - April 2020


Please test on non-production env.

1.      Download the latest RU


This correct RU can be found by using Oracle Doc ID 2118136.2

Example used in this document is Apr 2020. The GI APR 2020 Release Update 12.2.0.1.200414 includes updates for both the Clusterware home and Database home that can be applied in a standby first method on Data Guard.

Install the Release Update for Apr 2020

The GI APR 2020 Release Update 12.2.0.1.190716 includes updates for both the Clusterware home and Database home that can be applied in a rolling fashion.

This information is found in Oracle Doc ID 2118136.2

3       Download and unzip the patch in a temp directory e.g.

sudo su – grid

# cd /u99/media/apr20/30920127

Check that the directory is empty

# ls

Unzip the patch as the grid home owner (i.e. grid)

unzip p30920127_122010_Linux-x86-64.zip

4        Perform pre-requisite checks for dbhome and grid home

Check the version of opatch installed, version must be 12.2.0.1.19 or later

. oraenv

Enter database instance e.g. oradb01

·        As oracle user enter

$ORACLE_HOME/OPatch/opatch version

export GI_UPDATE=/u99/media/apr20


Validate the Oracle inventory

$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME

If this command works save the output so you have a status prior to patch apply.

Run the Opatch conflict check FROM README.
For Database home, as home user:

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30886680

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30882603


Check if enough free space is available on the db home filesystem for the patches to be applied as given below:

Create file /tmp/patch_list_dbhome.txt with the following content FROM README :

                   vi /tmp/patch_list_dbhome.txt
                        /u99/media/apr20/30920127/30886680
                         /u99/media/apr20/30920127/30882603
                       
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile 
/tmp/patch_list_dbhome.txt
 Stop the OEM agent (also other apps, Golden Gate etc - outside scope of this doc)

·        As the oracle user

agentbin

               ./emctl stop agent

               exit

·        sudo su – grid

. oraenv

Enter the ASM instance e.g. +ASM

export GI_UPDATE=/u99/media/software/database/apr20qtrupdate

/u01/app/12.2.0/gridhome/OPatch/opatch version

Validate the Oracle inventory

/u01/app/12.2.0/gridhome/OPatch/opatch lsinventory -detail -oh /u01/app/12.2.0/gridhome

If this command works save the output so you have a status prior to patch apply.

Run the Opatch conflict check

For Grid Infrastructure Home, as home user FROM README:

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30886680

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30882603

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30869447

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/26839277

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30888810

Check if enough free space is available on the grid home filesystem for the patches to be applied as given below:

Create file /tmp/patch_list_gihome.txt with the following content:

vi /tmp/patch_list_gihome.txt FROM README
 
                    /u99/media/software/database/apr20/30920127/30886680
/u99/media/software/database/apr20/30920127/30882603
/u99/media/software/database/apr20/30920127/30869447
/u99/media/software/database/apr20/30920127/26839277
/u99/media/software/database/apr20/30920127/30888810

Run the opatch command to check if enough free space is available in the Grid Infrastructure Home:

               $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
 
If OPatch reports Prereq "checkSystemSpace" passed., then no action is needed. 
Proceed with patch installation.



If the version of opatch is not satisfactory download the relevant version of Opatch to a temporary directory, for each database home and the grid home that are being patched, run the following commands as the home owner to extract the Opatch utility

5       Run the following commands as the home owner to extract the opatch utility

unzip <OPATCH-ZIP. -d /u01/app/oracle/product/12.2.0/dbhome

/u01/app/oracle/product/12.2.0/dbhome /Opatch/opatch version


6       Verify the patch


This must be run as the root user

·        sudo su –

. oraenv

Select the grid instance i.e. +ASM

export GRID_HOME=$ORACLE_HOME

export PATH=$PATH:$GRID_HOME

export GI_UPDATE=/u99/media/apr20/30920127

$GRID_HOME/OPatch/opatchauto apply $GI_UPDATE -analyze 

exit

    
7        Apply the Apr 2020 Release Update

The Opatch utility has automated the patch application for the Oracle Grid Infrastructure (GI) home and the Oracle RAC database homes. It operates by querying existing configurations and automating the steps required for patching each Oracle RAC database home of same version and the GI home.

The utility must be executed by an operating system (OS) user with root privileges, and it must be executed on each node in the cluster if the GI home or Oracle RAC database home is in non-shared storage. The utility should not be run in parallel on the cluster nodes.

Depending on command line options specified, one invocation of opatchauto can patch the GI home, Oracle RAC database homes, or both GI and Oracle RAC database homes of the same Oracle release version as the patch. You can also roll back the patch with the same selectivity.

In these instructions we are patching the DB home and grid home together

7.4   Add the directory containing Opatch to the Path environment variable


 export PATH=$PATH:$GRID_HOME/OPatch


7.5   Apply the patch


 opatchauto apply /u99/media/software/database/apr20/30920127


7.6   Run datapatch only on the primary database to update the databases using the db home that has been patched, these changes will then be replicated to the standby servers


Run as the database home user

cd .oraenv

Select the database instance i.e. dbora1


cd $ORACLE_HOME/OPatch

./datapatch -verbose



7.7   To rollback the patch from GI Home

# opatchauto rollback /u99/media/software/database/30920127 -oh <GI_HOME>


7.8   To rollback the patch from database home

# opatchauto rollback /u99/media/software/database/30920127 -oh <ORACLE_HOME>


7.9   Patch post installation instructions

Run the following script to check that the updates have been applied

                      Set lines 200

Col description format a50

                      Col action_time format a30

                      select patch_id, status, action_time, description from dba_registry_sqlpatch

       
7.10                   Start the Enterprise Manager agent       


agentbin

./emctl start agent

Deinstall of Oracle Grid - Metalink 1570358.1

Following a failed upgrade on grid from 12.1 to 12.2 (test box)

Ran the “Upgrade Oracle Grid Infrastructure” from gridsetup.sh which ran successfully; however when running the root.sh script we hit :

The log of current session can be found at:
/u01/app/crsdata/odw01/crsconfig/roothas_2020-04-17_04-23-08AM.log
PROTL-4: Failed to retrieve data from the local registry
2020/04/17 04:23:26 CLSRSC-169: Failed to create or upgrade OLR
Died at /u01/app/product/12.2.0/gridhome_1/crs/install/oraolr.pm line 495.
The command 
'/u01/app/product/12.2.0/gridhome_1/perl/bin/perl -I/u01/app/product/12.2.0/gridhome_1/perl/lib -I/u01/app/product/12.2.0/gridhome_1/crs/install /u01/app/product/12.2.0/gridhome_1/crs/install/roothas.pl ' execution failed

Checked for possible fixes but did not want to run any patches or unsupported fixes without going through Oracle (did not want to cause further probs).

We ran the deinstall tool for the Grid Home 12.2 (which by that point had updated the inventory) which ran successfully. This was to go back to 12.1

However, when we started everything back up the “crsctl stat res -t” was reporting missing “targets” specifically missing ASM diskgroups – very strange. 

When we checked the ASM parameters in the ASM instance, some were empty. 

SQL> show parameter asm

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string DATA
asm_diskstring string /dev/oracleasm/disks
asm_power_limit integer 1
asm_preferred_read_failure_groups string 


The deinstall seems to be more than just remove the s/w gird directory.
More on Metalink here :

How to Reconfigure Oracle Restart on 12c / 12.1 (Doc ID 1570358.1)

Followed this document – back with everything working 😊

Handy Metalink doc to know about if you ever need to remove Oracle grid - hence the note here.