The following command gets the output of "ps aux"...
... takes only the lines regarding Oracle DB ("ora_") ...
... and sums up the RSS (resident set size, the non-swapped physical memory that a task has used (in kiloBytes)) ...
... grouped by DB SID
ps aux --sort -rss | awk '/USER +PID | ora_/{ split($11,a,"_"); db=a[3]; if(db!="" && db!="RSS"){ m[db]+=$6; } } END{for (db in m){ printf("DB:%9s uses %7.1f MB RAM\n",db,m[db]/1024); tot+=m[db]} printf("%12sTotal %7.1f GB RAM\n"," ",tot/(1024*1024))}'
Output Example
(DB "Dfug" is a temporary DB that has been automatically created by RMAN in order to make a TSPITR)
DB: Dfug uses 884.9 MB RAM
DB: C0201Z01 uses 4196.6 MB RAM
Total 5.0 GB RAM
No comments :
Post a Comment