From 61c914e284eb61be34ed8de58c0db63f90c6a352 Mon Sep 17 00:00:00 2001 From: Yannick Charton Date: Thu, 2 Sep 2021 12:33:27 +0200 Subject: [PATCH] Fix detection of invalid domain indexes Fix detection of invalid domain indexes. Indeed, in some cases the main status is VALID but DOMIDX_STATUS or DOMIDX_OPSTATUS could be not VALID, impacting statements on the related table (for example, fails with ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE). --- plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm b/plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm index 6382223..1e2b246 100755 --- a/plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm +++ b/plugins-scripts/Nagios/DBD/Oracle/Server/Database.pm @@ -126,6 +126,10 @@ sub init_invalid_objects { SELECT 'dba_indexes', index_type||' index '||owner||'.'||index_name||' of '||table_owner||'.'||table_name||' is '||status FROM dba_indexes WHERE status <> 'VALID' AND status <> 'N/A' + UNION + SELECT 'dba_indexes', index_type||' index '||owner||'.'||index_name||' of '||table_owner||'.'||table_name||' is domain status '||DOMIDX_STATUS||' and domain opstatus '||DOMIDX_OPSTATUS + FROM dba_indexes + WHERE status = 'VALID' AND ( DOMIDX_STATUS <> 'VALID' OR DOMIDX_OPSTATUS <> 'VALID') }); # should be only USABLE @{$self->{invalidobjects}->{invalid_ind_partitions_list}} =