Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Find out how many CPUs ?

Re: Find out how many CPUs ?

From: <fitzjarrell_at_cox.net>
Date: 29 Sep 2006 13:25:23 -0700
Message-ID: <1159561523.490882.44000@m7g2000cwm.googlegroups.com>


Comments embedded.
Charles Hooper wrote:
> Sybrand Bakker wrote:
> > On 29 Sep 2006 10:41:49 -0700, "Charles Hooper"
> > <hooperc2000_at_yahoo.com> wrote:
> >
> > >My memory is a bit fuzzy. Isn't there
> > >another layer of views that the database needs to drill through to
> > >reach the data when accessing through V$OSSTAT, rather than GV$OSSTAT?
> >
> >
> > Apart from that this is a 10g specific answer.
> > 9i and 8i customers need to check the init.ora parameter cpu_count.
> >
> > --
> > Sybrand Bakker, Senior Oracle DBA
>
> Thanks for the additional input. So, in 9i and 8i Oracle believes the
> DBA, while in 10g Oracle believes the OS?

No. Oracle still retrieves this information from the O/S, however in 10g it retrieves more of it as the CPUs are more complex than they were at the time 8i and 9i were written. The DBA should never set the CPU_COUNT in the init.ora parameters, and the associated documentation states this.

> Would it be possible to
> determine the number of CPUs in an 8i or 9i database based on some of
> the other statistics recorded in the database? For example: 2 CPUs = 2
> CPU seconds for every 1 clock second, 4 CPUs = 4 CPU seconds for every
> 1 clock second.

That isn't necessary as Oracle does query the O/S for the cpu count, even in 8i.

>
> 10g: Would it be more efficient, although more difficult to read, to
> select directly from SYS.X$KSUCPUSTAT? This would eliminate a couple
> synonym look ups, view definition look ups, and a UNION:
> SELECT
> MAX(DECODE(KSUCPUSTATNAME,'NUM_CPUS',KSUCPUSTATVALUE,1)) CPUS,
> MAX(DECODE(KSUCPUSTATNAME,'NUM_CPU_CORES',KSUCPUSTATVALUE,1))
> CPU_CORES,
> MAX(DECODE(KSUCPUSTATNAME,'BUSY_TIME',KSUCPUSTATVALUE,0)) BUSY_TIME,
> MAX(DECODE(KSUCPUSTATNAME,'IDLE_TIME',KSUCPUSTATVALUE,0)) IDLE_TIME,
>
> (MAX(DECODE(KSUCPUSTATNAME,'BUSY_TIME',KSUCPUSTATVALUE,0))/MAX(DECODE(KSUCPUSTATNAME,'NUM_CPUS',KSUCPUSTATVALUE,1)))/24/
> 3600/100 BUSY_DAYS,
>
> (MAX(DECODE(KSUCPUSTATNAME,'IDLE_TIME',KSUCPUSTATVALUE,0))/MAX(DECODE(KSUCPUSTATNAME,'NUM_CPUS',KSUCPUSTATVALUE,1)))/24/
> 3600/100 IDLE_DAYS
> FROM
> SYS.X$KSUCPUSTAT;
>

I believe Oracle would prefer you use the views supplied for that purpose.

> Charles Hooper
> PC Support Specialist
> K&M Machine-Fabricating, Inc.

David Fitzjarrell Received on Fri Sep 29 2006 - 15:25:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US