Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I've solaris server running many applications, using Oracle. I want to know how many different databases are running within Oracle, and how much memory and cpu each of them is consuming

share|improve this question

migrated from serverfault.com Apr 3 '13 at 14:13

This question came from our site for professional system and network administrators.

2 Answers 2

up vote 1 down vote accepted

Use pstree -p do display process tree with pids of individual nodes. And then use the particular pid you want, and grep it from ps aux to see the CPU and memory consumption.

So the overall process will be:

$ pstree -p

init(1)─┬─apache2(6532)─┬─apache2(6575)
        │               ├─apache2(6576)
        │               ├─apache2(6716)
        │               ├─apache2(6803)
        │               └─apache2(6860)
        ├─cron(7474)
        ├─events/0(4)
        ├─getty(7507)
        ├─khelper(5)
        ├─klogd(7243)
        ├─ksoftirqd/0(3)
        ├─kthread(6)─┬─aio/0(64)
        │            ├─kblockd/0(19)
        │            ├─kjournald(693)
        │            ├─kjournald(7081)
        │            ├─kjournald(7082)
        │            ├─kjournald(7083)
        │            ├─kjournald(7084)
        │            ├─kjournald(7085)
        │            ├─kseriod(21)
        │            ├─kswapd0(63)
        │            ├─pdflush(61)
        │            ├─pdflush(62)
        │            ├─xenbus(8)
        │            └─xenwatch(7)
        ├─master(7414)─┬─pickup(6847)
        │              └─qmgr(7416)
        ├─migration/0(2)
        ├─mysqld_safe(7260)─┬─logger(7281)
        │                   └─mysqld(7280)───mysqld(7282)─┬─mysqld(7283)
        │                                                 ├─mysqld(7284)
        │                                                 ├─mysqld(7285)
        │                                                 ├─mysqld(7286)
        │                                                 ├─mysqld(7287)
        │                                                 ├─mysqld(7288)
        │                                                 ├─mysqld(7289)
        │                                                 ├─mysqld(7290)
        │                                                 └─mysqld(7291)

And then say you want to see the mysqld instance of pid 7285 's memory and cpu usage details:

$ ps aux | grep 7285
mysql     7285  0.0  2.9 58720 6016 ?        S    Feb04   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/blah.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
metin     6935  0.0  0.3  3300  724 ttyp0    R+   11:57   0:00 grep 7285

The third and fourh columns are CPU and memory respectively.

share|improve this answer
    
That will only give you information about the separate instance of the process. If there's one oracle instance with several databases in it, it still won't show the different databases. –  Jenny D Apr 3 '13 at 14:59

You need to know what database you're looking for. Once you do know that, you can use ps and/or top to see the memory and CPU usage of the processes.

share|improve this answer
    
I'm running Oracle database top and ps giving the cpu consumption as a whole application, i want to know how many instances of a particular databases are created and what amount of cpu/mem they are consuming –  Nagesh Apr 3 '13 at 8:12
    
In that case, the question should better be asked of the database administrator site. I'll try to redirect it there. –  Jenny D Apr 3 '13 at 8:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.