虽然,有spauto.sql可以用,但是我还是喜欢用这个脚本来收集信息,比较直观
#!/bin/bash
ORACLE_HOME=/u01/app/oracle/11.2
if [ $@ -gt 1 ] then echo "bad usage"
eliff [ $@ -eq 1 ] then
case "$0" in
-help|-h|--help|-h|?)
echo "execute scripts with no parameter"
;;
--version|-version|--v|-v)
echo "program 1.0"
;;
esac
else
echo "please enter total time:"
read total
echo "please enter interval time:"
read interval
echo "The log file is /tmp/snap.log"
tmp=$interval
while [ $interval -lt $total ]
do
$ORACLE_HOME/bin/sqlplus > /tmp/snap.log /nolog < conn perfstat/perfstat;
execute statspack.snap;
exit;
EOF ##这个EOF要在一行的顶端,前面不能有空格
interval=$interval+$tmp
sleep $tmp
done
阅读(1383) | 评论(0) | 转发(0) |