产生快照的shell脚本:
$more statpack.sh
#!/bin/ksh
# creator: piner
# function: produce statpack snapshot
date
#设置环境变量
export ORACLE_SID=test
export ORACLE_HOME=/u01/oracle/product/9.2
export NLS_LANG=american_america.zhs16gbk
#收集快照点
$ORACLE_HOME/bin/sqlplus /nolog <connect perfstat/perfstat
exec statspack.snap
exit
EOF
$more statpack.sh
#!/bin/ksh
# creator: piner
# function: produce statpack snapshot
date
#设置环境变量
export ORACLE_SID=test
export ORACLE_HOME=/u01/oracle/product/9.2
export NLS_LANG=american_america.zhs16gbk
#收集快照点
$ORACLE_HOME/bin/sqlplus /nolog <connect perfstat/perfstat
exec statspack.snap
exit
EOF
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11411056/viewspace-734298/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11411056/viewspace-734298/