Skip to content

How to add em graph to ZABBIX

How to add em graph to ZABBIX published on Комментариев к записи How to add em graph to ZABBIX нет

add to crontab:

* * * * * /etc/zabbix/set_wait_classes.sh oracle_sid /oracle/app/base/db/12.1.0.2 /etc/zabbix/res_sqldb.ini WRITE_WAITS

script:

cat /etc/zabbix/set_wait_classes.sh
#!/bin/bash

ORACLE_SID="$1"
ORACLE_HOME="$2"
INI_FILE="$3"
PARAM="$4"
WAIT_CLASS="$5"

export ORACLE_HOME
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH
LD_LIBRARY_PATH_64=$ORACLE_HOME/lib64:/usr/local/lib64:/lib64:/usr/lib64
export LD_LIBRARY_PATH_64
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/local/lib:/lib:/usr/lib
export LD_LIBRARY_PATH

NLS_DATE_FORMAT='DD-MM-YYYY HH24:MI:SS'
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_SID

USERNAME="zabbix"
USERPASSWORD="herewasthepassword"


#Проверка кода завершения
function detect_error  () {
if [ $? -ne 0 ]
then
    echo "ERROR for ${1}. "
    exit 1
fi
}

#Выполнить SQL
function sqlexecute {
result=`sqlplus -s ${USERNAME}/${USERPASSWORD} <<EOF
set echo off serverout on HEADS off FEED off HEA off TRIM on TRIMS on
 ${SQL}
 ;
exit

EOF`

detect_error "sqlplus ${SQL}"

if echo "${result}" | egrep "^(SP-|ORA-|PLS-)" >/dev/null
then
 echo "ERROR for SQL. ${SQL}"
 echo "${result}"
 exit 1
fi

#Удалить пустые строки, пробелы и табуляции из результата
echo "${result}" | grep -v ^Elapsed | grep -v ^$ | sed 's/ [\t]*//g'
detect_error "sed 's/[ \t]*//g'"
}


#BEGIN

SQL=""
case $PARAM in
"WRITE_WAITS")
             SQL="select
		     count (*) ||
		     '~'|| nvl(wait_class,'CPU')||
		     '~'||to_char(sysdate,'yyyy-dd-mm-hh24:mi')
		from v\$active_session_history
		where
		   SAMPLE_TIME > sysdate-1/1440
		group by wait_class"
             sqlexecute > ${INI_FILE}
          ;;
"SET_PARAM")
           if grep "${WAIT_CLASS}" ${INI_FILE} >/dev/null
             then grep "${WAIT_CLASS}" ${INI_FILE} | awk -F"~" '{print $1}'
             else echo "0"
           fi
          detect_error "Error print WAIT_CLASS"
          ;;

*)
          help
          ;;
esac

modify /etc/zabbix/zabbix_agentd.conf add

UserParameter=oracle.monitor.wait[*],/etc/zabbix/set_wait_classes.sh oracle_sid /oracle/app/base/db/12.1.0.2 /etc/zabbix/res_sqldb.ini SET_PARAM "$1"

and here is zabbix template with correct colors :

zbx_export_templates.xml

<zabbix_export>
    <version>2.0</version>
    <date>2016-11-23T14:00:15Z</date>
    <groups>
        <group>
            <name>db_hosts_INC000002161969</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>db_wait_template</template>
            <name>db_wait_template</name>
            <groups>
                <group>
                    <name>db_hosts_INC000002161969</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Oracle wait event</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>wait Administrative</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Administrative]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Application</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Application]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Cluster</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Cluster]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Commit</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Commit]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Concurrency</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Concurrency]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Configuration</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Configuration]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait CPU</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[CPU]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait IO</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[UserI/O]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Network</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Network]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Other</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Other]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Queueing</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Queueing]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait Scheduler</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[Scheduler]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>wait SystemIO</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>oracle.monitor.wait[SystemI/O]</key>
                    <delay>60</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>ses</units>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Oracle wait event</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
            </items>
            <discovery_rules/>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
    <graphs>
        <graph>
            <name>EM</name>
            <width>900</width>
            <height>200</height>
            <yaxismin>0.0000</yaxismin>
            <yaxismax>100.0000</yaxismax>
            <show_work_period>1</show_work_period>
            <show_triggers>1</show_triggers>
            <type>1</type>
            <show_legend>1</show_legend>
            <show_3d>0</show_3d>
            <percent_left>0.0000</percent_left>
            <percent_right>0.0000</percent_right>
            <ymin_type_1>0</ymin_type_1>
            <ymax_type_1>0</ymax_type_1>
            <ymin_item_1>0</ymin_item_1>
            <ymax_item_1>0</ymax_item_1>
            <graph_items>
                <graph_item>
                    <sortorder>8</sortorder>
                    <drawtype>0</drawtype>
                    <color>444444</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Administrative]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>5</sortorder>
                    <drawtype>0</drawtype>
                    <color>FF3333</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Application]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>11</sortorder>
                    <drawtype>0</drawtype>
                    <color>CCCCCC</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Cluster]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>6</sortorder>
                    <drawtype>0</drawtype>
                    <color>EEEE00</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Commit]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>4</sortorder>
                    <drawtype>0</drawtype>
                    <color>AA0000</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Concurrency]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>7</sortorder>
                    <drawtype>0</drawtype>
                    <color>888800</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Configuration]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>0</sortorder>
                    <drawtype>0</drawtype>
                    <color>00C800</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[CPU]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>2</sortorder>
                    <drawtype>0</drawtype>
                    <color>0000CC</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[UserI/O]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>9</sortorder>
                    <drawtype>0</drawtype>
                    <color>777777</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Network]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>12</sortorder>
                    <drawtype>0</drawtype>
                    <color>FF9999</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Other]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>10</sortorder>
                    <drawtype>0</drawtype>
                    <color>555555</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Queueing]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>1</sortorder>
                    <drawtype>0</drawtype>
                    <color>99FF99</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[Scheduler]</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>3</sortorder>
                    <drawtype>0</drawtype>
                    <color>9999FF</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>db_wait_template</host>
                        <key>oracle.monitor.wait[SystemI/O]</key>
                    </item>
                </graph_item>
            </graph_items>
        </graph>
    </graphs>
</zabbix_export>

[свернуть]

The result is:
screen-shot-2016-11-23-at-17-09-42

Short variant:

touch res_sqldb.ini
touch set_wait_classes.sh
chown oracle: res_sqldb.ini
chown oracle: set_wait_classes.sh
chmod 777 set_wait_classes.sh
chmod 777 res_sqldb.ini



* * * * * /etc/zabbix/set_wait_classes.sh u02pgu1  /oracle/app/base/db/11.2.0.4/ /etc/zabbix/res_sqldb.ini WRITE_WAITS
* * * * * /etc/zabbix/set_wait_classes.sh u02pgu2  /oracle/app/base/db/11.2.0.4/ /etc/zabbix/res_sqldb.ini WRITE_WAITS

add to /etc/zabbix/zabbix_agentd.conf

UserParameter=oracle.monitor.wait[*],/etc/zabbix/set_wait_classes.sh u02pgu1 /oracle/app/base/db/11.2.0.4 /etc/zabbix/res_sqldb.ini SET_PARAM "$1"

Thx to Vladimir Mukin for material

SQLT ORA-06598: insufficient INHERIT PRIVILEGES privilege

SQLT ORA-06598: insufficient INHERIT PRIVILEGES privilege published on Комментариев к записи SQLT ORA-06598: insufficient INHERIT PRIVILEGES privilege нет

Hi, faced with this error while generate report to Oracle support:

BEGIN SQLTXADMIN.sqlt$i.xtract(p_statement_id => :v_statement_id, p_sql_id_or_hash_value => '1v4z8fymw07t8', p_password => 'Y'); END;

*
ERROR at line 1:
ORA-06598: insufficient INHERIT PRIVILEGES privilege
ORA-06512: at "SQLTXADMIN.SQLT$I", line 1
ORA-06512: at line 1

solution is:

grant INHERIT ANY PRIVILEGES to sqltxadmin;

ORA-03297 how-to find how data distributed

ORA-03297 how-to find how data distributed published on Комментариев к записи ORA-03297 how-to find how data distributed нет

original

column segment heading 'Segment Name' format a14
column file_name heading 'File Name' format a50
column segment_type heading 'Segment Type' format a10
select
            tablespace_name,
            file_id,
            file_name,
            dfsizeMB,
            hwmMB,
            dffreeMB,
            trunc((dffreeMB/dfsizeMB)*100,1) "% Free",
            trunc(dfsizeMB-hwmMB,2) "Resizeble"
   from
   (
      select
           df.tablespace_name tablespace_name,
           df.file_id file_id,
           df.file_name file_name,
           round (df.bytes/1024/1024) dfsizeMB,
           round((ex.hwm*(ts.block_size))/1024/1024) hwmMB,
           dffreeMB
      from
           dba_data_files df,
           dba_tablespaces ts,
      (
           select file_id, round(sum(bytes/1024/1024)) dffreeMB
           from dba_free_space
           group by file_id
      ) free,
      (
           select file_id, max(block_id+blocks) hwm
           from dba_extents
           group by file_id
      ) ex
      where df.file_id = ex.file_id
      and df.tablespace_name = ts.tablespace_name
      and df.file_id = free.file_id (+)
      order by df.tablespace_name, df.file_id
    ) 
/


TABLESPACE_NAME      |    FILE_ID | File Name                                          |   DFSIZEMB |      HWMMB |   DFFREEMB |     % Free |  Resizeble
-------------------- | ---------- | -------------------------------------------------- | ---------- | ---------- | ---------- | ---------- | ----------
ADMSF_TS             |         14 | +DATA/S00TESIA2/DATAFILE/admsf_ts.292.924278433    |        100 |         27 |         87 |         87 |         73
ESIA                 |          5 | +DATA/s00tesia2/datafile/esia.262.911677179        |      32767 |      32767 |      25380 |       77.4 |          0
ESIA                 |         12 | +DATA/s00tesia2/datafile/esia.261.911673773        |      32768 |      32768 |      20200 |       61.6 |          0
ESIA                 |         13 | +DATA/s00tesia2/datafile/esia.265.911681735        |       3100 |       3100 | <NULL>     | <NULL>     |          0
ESIA_PDS             |          8 | +DATA/s00tesia2/datafile/esia_pds.271.911682045    |        100 |          6 |         99 |         99 |         94
ESIA_TECH            |          6 | +DATA/s00tesia2/datafile/esia_tech.269.911682035   |        100 |          9 |         93 |         93 |         91
SIA_DB               |         10 | +DATA/s00tesia2/datafile/sia_db.266.911681879      |       1260 |       1199 |         61 |        4.8 |         61
SYSAUX               |          2 | +DATA/s00tesia2/datafile/sysaux.264.911681479      |       4096 |       1591 |       2519 |       61.4 |       2505
SYSTEM               |          1 | +DATA/s00tesia2/datafile/system.267.911681965      |        890 |        886 |         57 |        6.4 |          4
UNDOTBS1             |          3 | +DATA/s00tesia2/datafile/undotbs1.268.911681999    |        910 |        620 |        884 |       97.1 |        290
USERS                |          4 | +DATA/s00tesia2/datafile/users.263.911680523       |       9069 |       8587 |       9030 |       99.5 |        482

column segment heading 'Segment Name' format a40
column file_name heading 'File Name' format a50
column segment_type heading 'Segment Type' format a20
select
                file_name,
                segment_type,
                owner||'.'||segment_name segment,
                block_id,
                blockIdMB
        from
        (
         select
              ex.owner owner,
              ex.segment_name segment_name,
              ex.segment_type segment_type,
              ex.block_id block_id,
              df.file_name file_name,
              trunc((ex.block_id*(ts.block_size))/1024/1024,2) blockIdMB
      from
              dba_extents ex, dba_data_files df, dba_tablespaces ts
              where df.file_id = &file_id
              and df.file_id = ex.file_id
              and df.tablespace_name = ts.tablespace_name
              order by ex.block_id desc
      )
      where rownum <= 100
/


File Name                                          | Segment Type         | Segment Name                             |   BLOCK_ID |  BLOCKIDMB
-------------------------------------------------- | -------------------- | ---------------------------------------- | ---------- | ----------
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_INT_R_OBJ                   |    4194168 |   32766.93
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_INT_R_OBJ                   |    4194160 |   32766.87
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_INT_R_OBJ                   |    4194152 |   32766.81
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194144 |   32766.75
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194136 |   32766.68
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194128 |   32766.62
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194120 |   32766.56
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194112 |    32766.5
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194104 |   32766.43
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194096 |   32766.37
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194088 |   32766.31
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194080 |   32766.25
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194072 |   32766.18
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194064 |   32766.12
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194056 |   32766.06
+DATA/s00txxxx2/datafile/xxxx.262.911677179        | INDEX SUBPARTITION   | XXXX.AUD_EVT_CRT_ON                      |    4194048 |      32766

how to get ash report from sqlplus

how to get ash report from sqlplus published on Комментариев к записи how to get ash report from sqlplus нет
Select *
    from table(dbms_workload_repository.ASH_report_html(
             l_dbid => 2316837477,
             l_inst_num => 1,
             l_btime =>  TIMESTAMP'2016-11-14 14:36:00' ,
             l_etime =>  TIMESTAMP'2016-11-14 14:41:00' ,
             l_options => 0,
             l_slot_width => 0,
             l_sid => null,
            l_sql_id => null,
            l_wait_class => null,
            l_service_hash => null,
            l_module => null,
            l_action => null,
            l_client_id => null,
            l_plsql_entry => null))
   ;

Primary Sidebar

Яндекс.Метрика