Capture the total CPU consumptions for an Instance

 
Create a file as bellow named cpu.sh
--------------------
:/u01/app/oracle=>cat cpu.sh
for para1 in $*
do
tcpu=`ps -afe -o user -o pcpu -o comm -o args | grep $ORACLE_SID|cut -c10-14 |awk '{ounces += $1} END {print ounces} ' `
echo "Total % of Cpu consumed by $para1 = $tcpu"
done
--------------------
make while loop always true to capture the data sleeping for every 6 minuts.

:/u01/app/oracle=>while (true)
do
sh cpu.sh $ORACLE_SID
sleep 6
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章