Tuesday, 7 July 2020

Enable/Disable Oracle Cluster Health Advisor monitoring using chactl

chad stands for the Cluster Health Advisor (CHA) daemon which is is part of the Oracle Autonomous Health Framework(AHF), It continuously monitors cluster nodes and Oracle RAC databases for performance and availability issues. 

Check ochad status:
[grid@dbracnode1 ~]$  crsctl stat res ora.chad -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.chad
               OFFLINE  OFFLINE       dbracnode1        STABLE
               OFFLINE  OFFLINE       dbracnode2        STABLE
--------------------------------------------------------------------------------               
[grid@dbracnode1 ~]$ crsctl status res ora.chad
NAME=ora.chad
TYPE=ora.chad.type
TARGET=OFFLINE, OFFLINE
STATE=OFFLINE, OFFLINE

[grid@dbracnode1 ~]$ chactl status
not monitoring nodes
not monitoring databases

we can start ochad using srvctl 
[grid@dbracnode1 ~]$ srvctl start cha

check status again, it's online now 
[grid@dbracnode1 ~]$ crsctl status res ora.chad
NAME=ora.chad
TYPE=ora.chad.type
TARGET=ONLINE             , ONLINE
STATE=ONLINE on dbracnode1, ONLINE on dbracnode2

[grid@dbracnode1 ~]$  crsctl stat res ora.chad -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.chad
               ONLINE  ONLINE       dbracnode1        STABLE
               ONLINE  ONLINE       dbracnode2        STABLE
--------------------------------------------------------------------------------
[grid@dbracnode1 ~]$
    
we can use chactl to manage cluster health advisor 
check status:            
[grid@dbracnode1 ~]$ chactl status
monitoring nodes dbracnode1, dbracnode2
not monitoring databases

[grid@dbracnode1 ~]$ chactl status database -db tstdb01 -verbose
not monitoring database tstdb01

add db to cha monitoring:
[grid@dbracnode1 ~]$ chactl monitor database -db tstdb01

Now db added to cha monitoring 
[grid@dbracnode1 ~]$ chactl status cluster -verbose
monitoring nodes dbracnode1, dbracnode2 using model DEFAULT_CLUSTER

[grid@dbracnode1 ~]$ chactl status database -db tstdb01 -verbose
monitoring database tstdb01 using model DEFAULT_DB
monitoring instance tstdb011 on node dbracnode1
monitoring instance tstdb012 on node dbracnode2

remove db from cha monitoring:
[grid@dbracnode1 ~]$ chactl unmonitor database -db tstdb01

[grid@dbracnode1 ~]$ chactl status database -db tstdb01 -verbose
not monitoring database tstdb01

chactl useful commands:
[grid@dbracnode1 ~]$ chactl -help
Usage:
chactl monitor cluster [-model <model_name> [-force]]
chactl monitor database -db <db_unique_name>
                        [-model <model_name> [-force]]
chactl unmonitor database -db <db_unique_name>
chactl status [cluster|database [-db <db_unique_name>]] [-verbose]
chactl config [cluster|database -db <dbname>]
chactl calibrate {cluster|database -db <db_unique_name>}
                 -model <model_name> [-force]
                 [-timeranges "start=<time_stamp>,end=<time_stamp>,..."]
                 [-kpiset "name=<kpi_name> min=<val> max=<val>,..."]
    WHERE:
        -timeranges "start=<time_stamp>,end=<time_stamp>,..." :
             Timestamp must be in format 'YYYY-MM-DD HH24:MI:SS'
    KPI for db:
        CPUPERCENT - CPU utilization - Percent
        IOREAD - Disk read - Mbyte/sec
        DBTIMEPERCALL - Database time per user call - usec/call
        IOWRITE - Disk write - Mbyte/sec
        IOTHROUGHPUT - Disk throughput - IO/sec
    KPI for cluster:
        CPUPERCENT - CPU utilization - Percent
        IOREAD - Disk read - Mbyte/sec
        IOWRITE - Disk write - Mbyte/sec
        IOTHROUGHPUT - Disk throughput - IO/sec
chactl query diagnosis [-cluster|-db <db_uniq_name>]
                       [-start <time> -end <time>]
                       [-htmlfile <file_name>]
chactl query model [-name <model_name> [-verbose]]
chactl query repository
chactl query calibration {-cluster|-db <db_uniq_name>}
        [-timeranges "start=<time_stamp>,end=<time_stamp>,..."]
        [-kpiset "name=<kpi_name> min=<val> max=<val>,..."]
        [-interval <val>]
    WHERE:
        -interval <val> : interval is in hrs
        -timeranges "start=<time_stamp>,end=<time_stamp>,..." :
             Timestamp must be in format 'YYYY-MM-DD HH24:MI:SS'
    KPI for db:
        CPUPERCENT - CPU utilization - Percent
        IOREAD - Disk read - Mbyte/sec
        DBTIMEPERCALL - Database time per user call - usec/call
        IOWRITE - Disk write - Mbyte/sec
        IOTHROUGHPUT - Disk throughput - IO/sec
    KPI for cluster:
        CPUPERCENT - CPU utilization - Percent
        IOREAD - Disk read - Mbyte/sec
        IOWRITE - Disk write - Mbyte/sec
        IOTHROUGHPUT - Disk throughput - IO/sec
chactl remove model -name <model_name>
chactl rename model -from <model_name> -to <model_name>
chactl import model -name <model_name> -file <model_file> [-force]
chactl export model -name <model_name> -file <output_file>
chactl export repository -format mdb -start <time> -end <time>
chactl set maxretention -time <retention_time>
chactl resize repository -entities <total # of hosts and database instances> [-force | -eval]
chactl authorize user -name <db_user>
chactl revoke user -name <db_user>





No comments:

Post a Comment