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
Capture the total CPU consumptions for an Instance
最新推荐文章于 2024-09-20 11:12:39 发布