#!/bin/sh
source /home/oracle/.bash_profile
cd /bak/xunjian
export rq=198.244.42.143-`date -d"today" +"%Y%m%d"`
rm -f $rq.txt
echo "----------ip地址情况--------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
ip a|grep global|awk '{print $2}' >> $rq.txt
echo "----------磁盘使用情况------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
df -h >>$rq.txt
echo "----------内存使用情况------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
free -m >>$rq.txt
echo "----------cpu占用情况-------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
sar 1 10 >>$rq.txt
echo "----------系统I/O情况-------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
iostat 1 5 >>$rq.txt
echo "----------查看网卡流量------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
sar -n DEV 1 10 >> $rq.txt
echo "----------查看RAC情况-------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
crsctl stat res -t >> $rq.txt
echo "----------检查数据库表空间使用情况------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
sqlplus / as sysdba <<EOF >> $rq.txt
@/home/oracle/tbs.sql;
!echo "--------查看数据库连接数情况------------------------"
!echo "----------------------------------------------------" >>$rq.txt
select inst_id,SESSIONS_CURRENT,SESSIONS_HIGHWATER,CPU_COUNT_CURRENT from gv\$License;
!echo "--------查看asm磁盘组空间情况-------------------" >>$rq.txt
!echo "----------------------------------------------------" >>$rq.txt
col name for a20
col diskname for a20
col path for a40
set line 160
select name,state,type,total_mb,free_mb from v\$asm_diskgroup;
select b.name,a.name diskname,a.path,b.state,b.type,a.total_mb,a.free_mb from v\$asm_disk a,v\$asm_diskgroup b where a.group_number=b.group_number order by b.name,a.name;
exit;
EOF
echo "----------系统OGG情况-------------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
/ogg/12c/ggsci <<EOF >> /bak/xunjian/$rq.txt
info all
info all
exit;
EOF
echo "-----------系统操作记录-----------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
tail -50 /var/log/messages >> $rq.txt
echo "-----------查看oracle日志---------------------------" >>$rq.txt
echo "----------------------------------------------------" >>$rq.txt
tail -100 /oracle/app/oracle/diag/rdbms/gddb/gddb2/trace/alert* >>$rq.txt
巡检脚本
最新推荐文章于 2021-10-24 14:08:05 发布