Results 1 to 9 of 9

Thread: How can I find out the number of cpu processors in the machine

  1. #1
    Join Date
    Mar 2003
    Location
    Hong Kong
    Posts
    8

    How can I find out the number of cpu processors in the machine

    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

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    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

  3. #3
    Join Date
    Mar 2003
    Location
    Hong Kong
    Posts
    8
    It works! Thanks a lot.

  4. #4
    Join Date
    May 2003
    Location
    Near Harrisburg, PA
    Posts
    6
    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.

  5. #5
    Join Date
    Mar 2003
    Posts
    468
    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

  6. #6
    Join Date
    May 2003
    Location
    Near Harrisburg, PA
    Posts
    6
    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.

  7. #7
    Join Date
    Mar 2003
    Posts
    468
    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.

  8. #8
    Join Date
    May 2003
    Location
    Near Harrisburg, PA
    Posts
    6
    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

  9. #9
    Join Date
    Mar 2003
    Posts
    468
    gotcha, keep us posted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •