Showing posts with label ResourcePool. Show all posts
Showing posts with label ResourcePool. Show all posts

Monday, September 12, 2011

Run Oracle Database in distinct resource pools in global container

Suppose you have created three resource pools namely:
  • rac1Pool
  • rac2Pool
  • rac3Pool
You want to run four Oracle database instances in each of these three pools and in the global pset.
You can do so by creating 3 additional oracle users namely oracle_2, oracle_3 and oracle_4. All these users should have the same group as oracle user  and different (distinct)  home directory . Also, ensure that Oracle user home directory has group write permission. The command to create additional users is as under:
  • useradd -g oinstall -G dba -u 202 oracle_2
  •  useradd -g oinstall -G dba -u 203 oracle_3
  • useradd -g oinstall -G dba -u 204 oracle_4
Next, create three projects with following pool and user association:
rac1Project ---> rac1Pool---->oracle
rac2Project---->rac2Pool----->oracle_2
rac3Project---->rac3Pool----->oracle_3
You can create the above mentioned associated by issuing the following command:
1)Create a project , associate it with right user and pool:
  • projadd -U oracle -p 400  -K project.pool=rac1Pool rac1Project 
  • projadd -U oracle_2 -p 402  -K project.pool=rac2Pool rac2Project 
  • projadd -U oracle_3 -p 403 -K project.pool=rac3Pool rac3Project
Additonal info : http://docs.oracle.com/cd/E26502_01/html/E29024/rmpool.task-41.html#rmpool.task-46

2)Associate the user with right project  


edit /etc/user_attr and add the following line
  • oracle::::project=rac1project  (add four colons after oracle)
  • orace_2::::project=rac2Project
  • oracle_3::::project=rac3Project
3) Re-login as the use and verify that it is associated with right project
  •  id -p

Tuesday, March 8, 2011

How to create a resource pool and bind a project to that pool

Create Resource Pool
  • Enable the resource pool service
    • svcadm enable system/pools:default
  • Enable dynamic resource pool
    • svcadm enable system/pools/dynamic:default
  • Check if both are enabled
    • svcs \*pool\*
  • Create a processor set named oracle_set with 32 processors
    • poolcfg -c 'create pset oracle_set( uint pset.min=32; uint pset.max=32)'
  • Create a pool named oraclePool
    • poolcfg -c ' create pool oraclePool
  • Associate the pool with processor set
    • poolcfg -c 'associate pool oraclePool (pset oracle_set)'
  •  Display the info
    • poolcfg -c info
  • Commit the changes to /etc/pooladm.cfg
    •  pooladm -c
  • Alternatively, you can save the configuration in a file and invoke pooladm with that file
Here is an example of configuration file that creates a pool with 8 CPUs in it

cat sPool:
create pset rac1_set(uint pset.min=8;uint pset.max=8)
create pool rac1Pool
associate pool rac1Pool(pset rac1_set)
transfer to pset rac1_set(cpu 0;cpu 1 ; cpu 2; cpu 3; cpu 4 ; cpu 5 ; cpu 6; cpu 7)

Invoke the following command to save current configuration in /etc/pooladm.conf file.

 if that file does not exist
  • pooladm -s
Execute the following command to execute commands from sPool file
  • poolcfg -f sPool
  • poolcfg -c info
  • pooladm -c
The following commands can be used to delete the pool:

cat delPool
destroy pset rac1_set
destroy pool rac1Pool
poolcfg -f delPool

If poolcfg -c info is not taking the right changes, you may want to flush out current in-memory config and start afresh ...

pooladm -x # flush current in-memory config
pooladm -s # blank /etc/pooladm.conf config

For more info : http://www.brendangregg.com/zones.html


    Bind the oracle project to this pool

    • Set project.pool attribute for oracle project to oraclePool so that oracle project gets binded to oraclePool by default. This implies that all processes starting in this project are bound to the pool automatically
      •  projmod -a -K project.pool=poolname project

    Destroy the processor set and pool set

    • poolcfg -c 'destroy pset oracle_set' /etc/pooladm.conf
    • poolcfg -c 'destroy pool oraclePool'
    • poolcfg -c info
    • pooladm -c
    Bind a process to the resource pool

    The following procedure uses poolbind with the -p option to manually bind a process  to a pool named oraclePool
    • Bind the process named ohare to the resource pool oraclePool
      • # poolbind -p oraclePool <procesid of process to be binded>
    • verify which pool a particular process is binded to
      • $ poolbind -q <process id of binded process)
    Monitor pool and processor set:
    • Execute the following commands
      • poolstat 5
      • poolstat -r pset 5 
    If you cannot find dynamic-resource SMF service (system/pools/dynamic:default ), download dynamic-resource-pools pkg.



    Verify if dynamic-resource-pools package exist on your system or not.
    •  pkg info dynamic-resource-pools
    pkg: info: no packages matching the following patterns you specified are
    installed on the system.  Try specifying -r to query remotely:

            dynamic-resource-pools


    • pkg info resource-pools
              Name: system/resource-mgmt/resource-pools
           Summary: Resource Pools
       Description: core software for resource pools
          Category: System/Core
             State: Installed
         Publisher: solaris
           Version: 0.5.11
     Build Release: 5.11
            Branch: 0.175.1.0.0.9.0
    Packaging Date: Mon Feb 06 23:51:31 2012
              Size: 811.45 kB
              FMRI: pkg://solaris/system/resource-mgmt/resource-pools@0.5.11,5.11-0.                             175.1.0.0.9.0:20120206T235131Z


    • # pkg search dynamic-resource-pools
    INDEX      ACTION VALUE                                               PACKAGE
    pkg.fmri   set    solaris/system/resource-mgmt/dynamic-resource-pools pkg:/syste                             m/resource-mgmt/dynamic-resource-pools@0.5.11-0.175.1.0.0.9.0


    • # pkg install dynamic-resource-pools
               Packages to install:  3
           Create boot environment: No
    Create backup boot environment: No
                Services to change:  5

    DOWNLOAD                                  PKGS       FILES    XFER (MB)
    Completed                                  3/3   1015/1015    52.5/52.5

    PHASE                                        ACTIONS
    Install Phase                              1374/1374

    PHASE                                          ITEMS
    Package State Update Phase                       3/3
    Image State Update Phase                         2/2


     
    Additional info:
    ttp://www.brendangregg.com/zones.html#resource_cpu0