Memeriksa Jumlah CPU dari SQL*Plus

Saat bekerja dengan server Linux, cara untuk menentukan jumlah CPU yang terpasang pada sebuah server adalah dengan melihat berkas /proc/cpuinfo. Contohnya seperti tampilan berikut ini :

[oracle@uimdbsit01 ~]$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 0
siblings    : 5
core id     : 0
cpu cores   : 5
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 0
siblings    : 5
core id     : 1
cpu cores   : 5
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 0
siblings    : 5
core id     : 2
cpu cores   : 5
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 0
siblings    : 5
core id     : 3
cpu cores   : 5
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 4
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 0
siblings    : 5
core id     : 4
cpu cores   : 5
apicid      : 4
initial apicid  : 4
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 5
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 1
siblings    : 5
core id     : 0
cpu cores   : 5
apicid      : 8
initial apicid  : 8
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 6
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 1
siblings    : 5
core id     : 1
cpu cores   : 5
apicid      : 9
initial apicid  : 9
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 7
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 1
siblings    : 5
core id     : 2
cpu cores   : 5
apicid      : 10
initial apicid  : 10
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 8
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 1
siblings    : 5
core id     : 3
cpu cores   : 5
apicid      : 11
initial apicid  : 11
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 9
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
stepping    : 1
cpu MHz     : 2394.000
cache size  : 30720 KB
physical id : 1
siblings    : 5
core id     : 4
cpu cores   : 5
apicid      : 12
initial apicid  : 12
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat
bogomips    : 4788.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

[oracle@uimdbsit01 ~]$ 

Pada contoh ini server yang sedang saya akses memiliki 10 buah CPU Intel(R) Xeon(R). Penomoran CPUnya dimulai dari angka 0.

Server pada contoh ini dipakai untuk menjalankan Oracle Database 11g. Bila sedang mengakses database melalui SQL*Plus, kita bisa juga memeriksa jumlah CPU yang terpasang. Lihat contoh berikut ini :

SQL> select a.inst_id,a.instance_name,b.name,b.value
  2  from gv$instance a, gv$parameter b
  3  where a.inst_id=b.inst_id
  4  and
  5  b.name in ('cpu_count','parallel_threads_per_cpu')
  6  ;

   INST_ID INSTANCE_NAME    NAME                                     VALUE
---------- ---------------- ---------------------------------------- ------------
         1 uimdbsit1        parallel_threads_per_cpu                 2
         1 uimdbsit1        cpu_count                                10
         2 uimdbsit2        parallel_threads_per_cpu                 2
         2 uimdbsit2        cpu_count                                10

SQL>

Karena databasenya adalah cluster RAC, maka akan muncul informasi CPU yang dimiliki oleh masing-masing node RAC. Dalam contoh tadi, dari SQL*Plus kita bisa melihat bahwa masing-masing node RAC beroperasi pada server berkekuatan 10 CPU. Sebagai catatan, untuk bisa menggunakan perintah SQL di atas, user harus punya privilege untuk mengakses gv$parameter (atau jalankan saja lewat user sysdba)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.