Created
October 26, 2010 03:43
-
-
Save joker1007/646271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# cd | |
cd /var/tmp | |
# 環境変数 | |
ORACLE_HOME=******* | |
ORACLE_SID=******** | |
NLS_LANG=******* | |
# PATH | |
PATH=$ORACLE_HOME/bin:PATH | |
sqlplus id/pass@connect_id @${ORACLE_HOME}/rdbms/admin/utlbstat.sql | |
if [ $? -ne 0 ]; then | |
# エラー発生時の処理 | |
echo "Error" | |
exit 0 | |
else | |
# 正常終了時の処理 | |
echo "Start Bstat" | |
fi | |
#1時間の30秒前で停止 | |
sleep 3570 | |
sqlplus id/pass@connect_id @${ORACLE_HOME}/rdbms/admin/utlestat.sql | |
if [ $? -ne 0 ]; then | |
# エラー発生時の処理 | |
echo "Error" | |
exit 0 | |
else | |
# 正常終了時の処理 | |
echo "End Bstat" | |
fi | |
# Rename to report_dd-hh.txt | |
mv report.txt report_`date +%d-%H`.txt | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment