-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathhugepage_usage_ins.sh
33 lines (24 loc) · 1.14 KB
/
hugepage_usage_ins.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
total_shmsize=0
total_hugepagesize=0
for pid in `ps -ef | grep ora_pmon_|egrep -v "grep|+ASM"| awk '{print $2}'`
do
echo
echo "-----------------------------------------------------------"
echo
ps -ef | grep $pid | grep -v grep
shmsize=`grep -A 1 'SYSV00000000' /proc/$pid/smaps | grep "^Size:" | awk 'BEGIN{sum=0}{sum+=$2}END{print sum/1024}' | awk -F"." '{print $1}'`
hugepagesize=`grep -B 11 'KernelPageSize: 2048 kB' /proc/$pid/smaps | grep "^Size:" | awk 'BEGIN{sum=0}{sum+=$2}END{print sum/1024}' | awk -F"." '{prin
t $1}'`
echo "INSTANCE SGA (SMALL/HUGE page)" : $shmsize "MB"
echo "INSTANCE SGA (HUGE PAGE)" $hugepagesize "MB"
echo "Percent Huge page :" $(( $hugepagesize *100 / $shmsize )) "%"
total_shmsize=$(( $shmsize + $total_shmsize ))
total_hugepagesize=$(( $total_hugepagesize + $hugepagesize ))
done
echo
echo "-----------------------------------------------------------"
echo "-----------------------------------------------------------"
echo
echo "SGA TOTAL (SMALL/HUGE page)" : $total_shmsize "MB"
echo "SGA TOTAL (HUGE PAGE)" $total_hugepagesize "MB"
echo "Percent Huge page :" $(( $total_hugepagesize *100 / $total_shmsize )) "%"