Disclaimer

Thursday 2 September 2021

How to find out the TOTAL/USED/AVAILABLE memory in AIX?

 How to find out the total/used/available memory in AIX?


Sometime we are in the situation to find out the used memroy and available memory of aix server. Using the below script we can find out the total/free/used memory in aix.


#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {'print $3'}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {'print $2'}`
tm=`expr $tm / 1000`
fm=`expr $tm - $um`
echo "\n\n-----------------------";
echo "System : (`hostname`)";
echo "-----------------------\n\n";
echo "Memory Information\n\n";
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $um MB"
echo "\n\n-----------------------\n";


Save the above script in a file and execute it.

#vi mem_calci     ---> paste the above script and save it
#chmod +x mem_calci   ---> provide the execute permission
#./mem_calci     ---> run the script

Sample output:

System : (Hostname)
-----------------------
Memory Information

total memory = 8126 MB
free memory = 6328 MB
used memory = 1798 MB
-----------------------

No comments:

Post a Comment

100 Oracle DBA Interview Questions and Answers

  Here are 100 tricky interview questions tailored for a Senior Oracle DBA role. These questions span a wide range of topics, including perf...