Link to home
Start Free TrialLog in
Avatar of jeyjeyarajan
jeyjeyarajan

asked on

binding an oracle instance to a cpu

Is there a way to bind an oracle instance to a cpu in a multi processor w2k intel environment. The Oracle version is 8.1.7.3? Thx.
Avatar of Wadhwa
Wadhwa

Hi,

You can use a DBMS_RESOURCE_MANAGER package provided by oracle 8i. You can get instruction for how to use this from oracle document or technet.

Sam..

Hi there,

I think you are looking for information on processor affinity.  You can set this in Oracle for NT (2000) by setting a registry variable ORACLE_AFFINITY.


Here is an article which gives you detailed information on how to set this.


ORACLE_AFFINITY - How to Restrict Oracle on a Multi-CPU NT Machine:
===================================================================

In V8, you can set the ORACLE_AFFINITY registry value to tell Oracle which threads to run on which processors.  The format for ORACLE_AFFINITY is:

  ORACLE_AFFINITY=name1:cpumask1;name2:cpumask2;name3:cpumask3;...

where 'name' is one of:

  o MASK -- Sets the processor mask for the entire process/instance.  
     This is the set of processors that any of the threads are allowed to run.  The default, if not set, is all CPUs in the system.

  o DBWR, LGWR, SMON, PMON, etc... -- Sets processor mask for the particular named thread.  Any named thread that shows up in v$bgprocess can be set in this way.

  o USER -- Sets the processor mask for ALL shadow threads.

  o DEF -- Sets the processor mask for any threads not listed explicitly.  
     The default is for all CPUs on the system.

and 'cpumask' can have the following values:

  1 = binary 0001 - pinned to CPU #1
  2 = binary 0010 - pinned to CPU #2
  3 = binary 0011 - can use CPU 1 or CPU 2
  4 = binary 0100 - pinned to CPU #3
   .
   .
   .
 ...
  15 = binary 1111 - can use CPU 1, 2, 3, or 4
   .
   .
   .
  2^n - 1 ... where n == number of CPUs in the system

and 'DEF' and 'USER' can have the following values:

  o ROBIN -- For USER or DEF name, this uses a round-robin mechanism where the next thread gets pinned to the next CPU in the round-robin sequence.  
     
    If there are four CPUs in the system, the first USER or DEF case goes to CPU #1, the next to CPU #2, etc..., and then back around to CPU #1 for thread #5.

  o FLOAT -- For USER or DEF name, this is the same as round-robin except there is a floating group of threads that can run on any CPU specified in MASK.

    If you had four CPUs, then one-fifth of the USER and DEF threads would run on CPU #1, one-fifth on CPU #2, one-fifth on CPU #3, one-fifth on CPU #4, and then one-fifth on any of the CPUs.  (These are the FLOATing threads.)


Note:  Any of the values used for cpumask for the threads are bounded by the value used for MASK.  If MASK is set to use only CPU #1, then all other settings are ignored, and all threads are bound to CPU #1.  

       Therefore, MASK is the allowable CPUs that any of the threads can run on.


A typical ORACLE_AFFINITY setting might look like:

  ORACLE_AFFINITY=DBWR:1;LGWR:2;USER:12;DEF:ROBIN

This would mean that DBWR is always on CPU #1, LGWR is always on CPU #2, all shadow threads could run on either CPU #3 and CPU #4 (since 12 = binary 1100), and then all other backgrounds would be split evenly among all the CPUs in the system.

If you want to run Oracle on two processors, you could set:

  ORACLE_AFFINITY=MASK:3

  since 3 == 0x0011 for processors one and two.

The only caveat is that there is only one registry parameter and all instances use the same value.


Hope this helps...
- Ramesh
ASKER CERTIFIED SOLUTION
Avatar of ramkb
ramkb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great Answer Ramesh!
Cheers!
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
Zero response, finalized.
Moondancer - EE Moderator