In today’s article, we will explain how we can learn the Processes Using Swap Space in Oracle.
Processes using swap space:
1 | [root@mwdb01 ~]# ./swap.sh | egrep -v "Swap used: 0" |sort -n -k 5 > /log_file/swap_sonuc_node1_27012015_1058.txt |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/bash # Get current swap usage for all running processes # Erik Ljungstrom 27/05/2011 SUM=0 OVERALL=0 for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do PID=`echo $DIR | cut -d / -f 3` PROGNAME=`ps -p $PID -o comm --no-headers` for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` do let SUM=$SUM+$SWAP done echo "PID=$PID - Swap used: $SUM - ($PROGNAME )" let OVERALL=$OVERALL+$SUM SUM=0 done echo "Overall swap used: $OVERALL" |
1 | [root@mwdb01 ~]# vi /log_file/swap_sonuc_node1_27012015_1058.txt |
We can see which processes use the swap space from the query below.
1 | [root@mwdb01 ~]# ./swap.sh | egrep -v "Swap used: 0" |sort -n -k 5 > /log_file/swap_sonuc.txt |
We can also see the usage of the swap space with the following query.
-Top –c –M
-Then press the character “f” and then the character “p”
-Then “Enter”