# Database Discussions > Oracle >  How can I find out the number of cpu processors in the machine

## cleegt

Dear All,

Is there any way I can find out the number of cpu processors I have in the database server machine from the database meta-tables? I would like to use it to do some calculations.

Thanks,

-- Chris

----------


## jkoopmann

depending on the version of oracle you may be able to issue the 'SHOW PARAMETER" command.

SQL> show parameter cpu_count

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cpu_count                            integer     2

or you can just select the value from v$parameter

select name,value from v$parameter where name = 'cpu_count';

NAME       VALUE
---------- ----------
cpu_count  2

----------


## cleegt

It works! Thanks a lot.

----------


## d73freeman

I'd be careful about relying on the parameter info for this. I'm thinking this info comes right out of the pfile where somebody had to enter it. I am exploring this right now. The invoice for the server says 2 processors, the pfile says 4, the Windows 2000 Hardware view shows 4.  I'm pretty sure there are four CPU slots on this box but I'm also pretty sure there are only 2 processors. We are planning to look. I'm not sure what the effect is on Oracle if you have only half the number of processors that are described in the ora.init file.

----------


## jkoopmann

yes, while oracle will do it's best to detect the number of cpus on the box, someone can override this by putting the parameter into the pfile or spfile and cause problems. oracle does not require this parameter to be set in order for it to "know" how many you have. i have seen past versions of oracle (version 7's) that oracle did not detect properly the number of cpus and it was always understated.

i haven't had oracle "problems" with understated cpus, except id didn't use the extra ones.

thanks for the post.
please keep us posted on the problems if any. i would be most interested in the  parallel executions and wonder if oracle would just suck the cpus,never seen oracle do this before  :Smilie:

----------


## d73freeman

If the value wasn't set the Administrators Guide for Windows says for the value , "CPU_COUNT Oracle9i automatically sets value to number of processors available for your Oracle instance."

I don't know who/why it was set that way. It was that way when I got here.

----------


## jkoopmann

be carefull, automatic detection / setting in this context is the oracle just recognizing it, not putting it in the pfile. 

while i say this i haven't looked on every type of oracle installation but i have never seen oracle put this entry in a pfile or spfile. currently i have 9i on W2k and linux and oracle didn't put the entry in and i do have more than one cpu.

more than likely the person before you put the entry in.

----------


## d73freeman

Oh no, I know somebody put it in there. I'm agreeing that it's not a required entry.  If it's not there Oracle will detect the number of processors. I'm wondering where/how Oracle will do that. The Windows Manager is also reporting four processors. 

~ First Data alumni also :Smilie:

----------


## jkoopmann

gotcha, keep us posted.

----------

