oracle 監控表空間腳本:
自增表空間不在監控范圍
每月10號0點至06點不報警
f_check_oracle_tablespaces(){
A='tablespace used exceeding the threshold value!!!'
result=`$con_user << EOF
set colsep' ';
set feedback off;
set heading off;
set pagesize 0;
set termout off;
set trimout on;
set trimspool on;
select tablespace_name from (
(select distinct tablespace_name from dba_data_files where autoextensible='NO' )
MINUS
(select distinct tablespace_name from dba_data_files where autoextensible='YES')
);
exit
EOF`
tablespace_names=`echo $result`
if [ "$tablespace_names" != 'no rows selected' ] ; then
for i in `echo $tablespace_names`
do
result=`$con_user<< EOF
set colsep' ';
set feedback off;
set heading off;
set pagesize 0;
set termout off;
set trimout on;
set trimspool on;
set numf '9999999.99'
select 100 - trunc(NVL(b.free, 0.0) / a.total * 1000) / 10 prc
from (select tablespace_name, sum(bytes) / 1024 / 1024 total
from dba_data_files
group by tablespace_name) A
LEFT OUTER JOIN (select tablespace_name, sum(bytes) / 1024 / 1024 free
from dba_free_space
group by tablespace_name) B
ON a.tablespace_name = b.tablespace_name
WHERE a.tablespace_name = '$i';
exit
EOF`
temp=$(echo $result)
ifExceed=`echo "$temp > $1" | bc`
#eval ${tablespace_name}_USED=$temp
if [ $ifExceed = 1 ] ; then
A="$i-$A"
fi
done
else
A=$A
fi
if [ "$A" = 'tablespace used exceeding the threshold value!!!' ] ; then
echo "all tablespaces are ok! "
exit $STATE_OK
else
#每月10號 0點至6點 表空間監控不報警
day=`date +%F | awk -F'-' '{print $3}'`
hour=`date +%T | awk -F':' '{print $1}'`
if [ $day -eq 10 -a $hour -gt 0 -a $hour -lt 6 ];then
echo "all tablespaces are ok! "
exit $STATE_OK
else
echo "$A"
exit $STATE_CRITICAL
fi
fi
}
oracle數據監控腳本:http://www.sunline.cc/download/329752
監控項包含:
單實例監控項:
check_oracle base_module --listener --tns 主機名或IP --SINGLE
check_oracle base_module --db 數據名 --SINGLE
check_oracle support_module --session 800 1000
check_oracle base_module --standby
check_oracle base_module --standby_time
RAC集群監控補充項:
check_oracle base_module --asm -n 主機名或IP -a
check_oracle base_module --listener -n 主機名或IP -l --RAC
check_oracle base_module --vip -n 主機名或IP -v
check_oracle base_module --db -n 主機名或IP -d --RAC
check_oracle base_module --scan_listener -n 主機名或IP -L
check_oracle support_module --asm_free --RAC
check_oracle base_module --scan_vip -n 主機名或IP -V
check_oracle rac_server 主機名或IP
OGG 監控項 (略)
?????????????????????????文章推薦
| PostgreSQL | URL |
|---|---|
| 《課程筆記:PostgreSQL深入淺出》之 初識PostgreSQL(一) | http://www.sunline.cc/db/475817 |
| 《課程筆記:PostgreSQL深入淺出》之 PostgreSQL源碼安裝(二) | http://www.sunline.cc/db/475933 |
| 《課程筆記:PostgreSQL深入淺出》之初始化PostgreSQL(三) | http://www.sunline.cc/db/479524 |
| 《課程筆記:PostgreSQL深入淺出》之PSQL管理工具-常用(四) | http://www.sunline.cc/db/479560 |
| 《課程筆記:PostgreSQL深入淺出》之PSQL管理工具-高級命令(四) | http://www.sunline.cc/db/479559 |
| 《課程筆記:PostgreSQL深入淺出》之內存與進程(五) | http://www.sunline.cc/db/489936 |
| 《課程筆記:PostgreSQL深入淺出》之外存&永久存儲(六) | http://www.sunline.cc/db/502267 |
| Oracle: | URL |
| 《Oracle 自動收集統計信息機制》 | http://www.sunline.cc/db/403670 |
| 《Oracle_索引重建—優化索引碎片》 | http://www.sunline.cc/db/399543 |
| 《DBA_TAB_MODIFICATIONS表的刷新策略測試》 | http://www.sunline.cc/db/414692 |
| 《FY_Recover_Data.dbf》 | http://www.sunline.cc/doc/74682 |
| 《Oracle RAC 集群遷移文件操作.pdf》 | http://www.sunline.cc/doc/72985 |
| 《Oracle Date 字段索引使用測試.dbf》 | http://www.sunline.cc/doc/72521 |
| 《Oracle 診斷案例 :因應用死循環導致的CPU過高》 | http://www.sunline.cc/db/483047 |
| 《Oracle 慢SQL監控腳本》 | http://www.sunline.cc/db/479620 |
| 《Oracle 慢SQL監控測試及監控腳本.pdf》 | http://www.sunline.cc/doc/76068 |
| 《Oracle 腳本實現簡單的審計功能》 | http://www.sunline.cc/db/450052 |
| 《記錄一起索引rebuild與收集統計信息的事故》 | http://www.sunline.cc/db/408934 |
| Greenplum: | URL |
| 《PL/Java.pdf》 | http://www.sunline.cc/doc/70867 |
| 《GP的資源隊列.pdf》 | http://www.sunline.cc/doc/67644 |
| 《Greenplum psql客戶端免交互執行SQL.pdf》 | http://www.sunline.cc/doc/69806 |
最后修改時間:2024-02-04 17:00:51
「喜歡這篇文章,您的關注和贊賞是給作者最好的鼓勵」
關注作者
【版權聲明】本文為墨天輪用戶原創內容,轉載時必須標注文章的來源(墨天輪),文章鏈接,文章作者等基本信息,否則作者和墨天輪有權追究責任。如果您發現墨天輪中有涉嫌抄襲或者侵權的內容,歡迎發送郵件至:contact@modb.pro進行舉報,并提供相關證據,一經查實,墨天輪將立刻刪除相關內容。




