You are on page 1of 17

Yahoo!

White Paper

Oracle Database Resource Manager

By Ritesh Chhajer Mukesh Burgupalli Arpan Kumar srivastahav

Yahoo! White Paper


Introdu tion Oracle Database resource manager is an oracle feature which allows oracle DBA to manage multiple facets of sessions behavior on a per workload basis, such as idle time limits, CP utili!ation, runawa" #ueries, degree$of$parallelism, etc% for e&ample Oracle resource manager manages the CP load so that all CP s are full" utili!ed "et there is no thrashing since Oracle processes are waiting in the operating s"stem run #ueue% 'n this white paper, we focus on using resource manager to manage degree$of$parallelism% (irst let)s walk through the steps needed to configure Oracle resource manager and e&ploit the different options in each of the steps we have% !" #$tain permission to administer Resour e Manager Administering Resource Manager re#uires the ADMINISTER_RESOURCE_MANAGER privilege% *his privilege is automaticall" granted to +,+% *he following P-.+/- command grants this privilege to the user DRM SQL> exec dbms_resource_manager_ r!"s#gran$_s%s$em_ r!"!&ege 'gran$ee_name (> )DRM*+ adm!n_o $!on (> $rue,%" Create a pending area Creating a pending area is the first step% *he pending area is a temporar" work area for Resource Management configuration% *he changes in the pending area are not visible until the pending area is submitted% SQL> exec dbms_resource_manager#crea$e_ end!ng_area ',At an" time "ou can abandon the changes in the pending area as follows0 SQL> exec dbms_resource_manager#c&ear_ end!ng_area',&" Create Consumer group Resource consumer groups are group of users, or sessions, that are grouped together based on their processing needs% sers can be assigned to more than one consumer group, but each user)s active session can onl" be assigned to one resource consumer group at a time% *he oracle

Yahoo! White Paper


database comes preconfigured with multiple consumer groups% Before creating "our own consumer group, "ou should consider if an" of the e&isting consumer groups meets our re#uirement% *he s"nta& for creating a consumer group0 D.MS_RESOURCE_MANAGER#CREATE_CONSUMER_GROU/ ' consumer_grou IN 0ARC1AR2+ commen$ IN 0ARC1AR2+ c u_m$3 IN 0ARC1AR2 DE4AULT 5ROUND6RO.IN5,1here consumer_grou Commen$ c u_m$3 2 is the name of the consumer group 2 is the user comments 2 is the resource allocation method for distributing CP among sessions in the consumer group% *he default is RO 3D$ROB'3, which uses a round$ robin scheduler to ensure sessions are fairl" e&ecuted% R 3$*O$ COMP-4*'O3 specifies that sessions with the largest active time are scheduled ahead of other sessions 4&ample0 SQL> exec dbms_resource_manager#crea$e_consumer_grou ')grou _7!$3_L!m!$ed_ ara&&e&!sm*+ )L!m!$s $3e degree o8 ara&&e&!sm*,'" Map sessions to onsumer groups ,ou can configure the Database Resource Manager to automaticall" assign consumer groups to sessions b" providing mappings between session attributes and consumer groups% (urther, "ou can prioriti!e the mappings so as to indicate which mapping has precedence in case of conflicts% *here are two t"pes of session attributes0 login attributes and runtime attributes% *he login attributes are meaningful onl" at session login time, when the Database Resource Manager determines the initial consumer group of the session% 'n contrast, a session that has alread" logged in can later be reassigned to another consumer group based on its run$time attributes% 1e can use the se$_consumer_grou _ma attributes. *he s"nta& for mapping sessions are0 D.MS_RESOURCE_MANAGER#SET_CONSUMER_GROU/_MA//ING' a$$r!bu$e IN 0ARC1AR2+ !ng or se$_consumer_grou _ma !ng_ r! procedures to add, delete, or

modify entries that map sessions to consumer groups, based on the session's login and runtime

Yahoo! White Paper


"a&ue IN 0ARC1AR2+ consumer_grou IN 0ARC1AR2 DE4AULT NULL,1here ATTRI.UTE is the mapping attribute to add.modif", 't can be an" one from the below list CLIENT_MAC1INE CLIENT_OS_USER CLIENT_/ROGRAM MODULE_NAME MODULE_NAME_ACTION ORACLE_USER SER0ICE_MODULE SER0ICE_MODULE_ACTION SER0ICE_NAME 0ALUE CONSUMER_GROU/ ( $3e name o8 $3e com u$er 8rom 73!c3 $3e c&!en$ !s ma9!ng $3e connec$!on ( $3e o era$!ng s%s$em user name o8 $3e c&!en$ ( $3e name o8 $3e c&!en$ rogram used $o &og on$o $3e ser"er ( $3e modu&e name on $3e curren$&% runn!ng a module_name.action_name ( $3e orac&e da$abase user name ( a comb!na$!on o8 ser"!ce and modu&es names !n $3!s 8orma$ service_name.module_name ( a comb!na$!on o8 ser"!ce name+ modu&e name and ac$!on name !n $3!s 8orma$ Service_name.module_name.action_name ( $3e ser"!ce name used b% $3e c&!en$ $o es$ab&!s3 connec$!on# ( !s $3e a$$r!bu$e "a&ue $o ma$c3 ( !s $3e name o8 $3e ma ed consumer grou or nu&& $o de&e$e a ma !ng &!ca$!on# ( a comb!na$!on o8 modu&e and ac$!on names !n $3e 8orma$

+essions can also be mapped to a consumer group using dbms_sess!on#s7!$c3_consumer_grou ',+essions can also be configured to automaticall" switch from one consumer group to another, based the amount of CP or '.O consumed or the e&pected e&ecution time, using the s7!$c3_$!me, s7!$c3_!o_megab%$es, s7!$c3_!o_re:s, or s7!$c3_es$!ma$e directives% 4&ample0 SQL> exec dbms_resource_manager#se$_consumer_grou _ma !ng'a$$r!bu$e (> D.MS_RESOURCE_MANAGER#ORACLE_USER+"a&ue (> 5DRM5+consumer_grou (> )grou _7!$3_L!m!$ed_ ara&&e&!sm*,(" Add permissions to onsumer groups 'n order to switch into a consumer group, a user or role must have permissions% *his procedure grants the privilege to switch to a resource consumer group%

Yahoo! White Paper


+"nta&0 D.MS_RESOURCE_MANAGER_/RI0S#GRANT_S;ITC1_CONSUMER_GROU/ ' gran$ee_name IN 0ARC1AR2+ consumer_grou IN 0ARC1AR2+ gran$_o $!on IN .OOLEAN,Gran$ee_name Consumer_Grou Gran$_O $!on 4&ample0 SQL> exec dbms_resource_manager_ r!"s#gran$_s7!$c3_consumer_grou 'gran$ee_name (> 5DRM5+ consumer_grou (> 5grou _7!$3_&!m!$ed_ ara&&e&!sm5+gran$_o $!on (> 4ALSE,)" Create a Resour e Plan Resource plans specif" the resource consumer groups belonging to the plan and contain directives for how resources are to be allocated among these groups% A resource plan can also have multiple subplans that specif" a finer grain of resource allocation detail% (or e&ample, ' can create two subplans for m" O-*P users, one for high$volume users and one for lower$volume users% 3ote that a subplan can have more than one parent plan, but Oracle will not permit a subplan to 5loop back5 upon itself% *he Oracle database comes preconfigured with multiple resource plans% Before creating "our own resource plan, "ou should consider if an" one of these resource plans meet "our re#uirements% +"nta&0 D.MS_RESOURCE_MANAGER#CREATE_/LAN ' &an IN 0ARC1AR2+ commen$ IN 0ARC1AR2+ c u_m$3 IN 0ARC1AR2 DE4AULT 5EM/1ASIS5+ ac$!"e_sess_ oo&_m$3 IN 0ARC1AR2 DE4AULT 5ACTI0E_SESS_/OOL_A.SOLUTE5+ ara&&e&_degree_&!m!$_m$3 IN 0ARC1AR2 DE4AULT 5/ARALLEL_DEGREE_LIMIT_A.SOLUTE5+ :ueue!ng_m$3 IN 0ARC1AR2 DE4AULT 54I4O_TIMEOUT5,( !s name o8 $3e user or ro&e $o 73om r!"!&ege !s $o be gran$ed+ ( !s $3e name o8 $3e consumer grou and ( !s TRUE !8 gran$ee s3ou&d be a&&o7ed $o gran$ access+ e&se 4ALSE

1here
/LAN COMMENT C/U_MT1 ( !s user commen$s+

( !s $3e name o8 $3e resource &an ( !s $3e resource a&&oca$!on me$3od 8or s ec!8%!ng 3o7 muc3 C/U eac3 consumer grou or sub &an ge$s# EMPHASIS, $3e de8au&$ me$3od+ !s 8or

Yahoo! White Paper


mu&$!&e"e& &ans $3a$ use ercen$ages $o s ec!8% 3o7 C/U !s d!s$r!bu$ed among consumer grou s# RATIO !s 8or s!ng&e6&e"e& &ans $3a$ use ra$!os $o s ec!8% 3o7 C/U !s d!s$r!bu$ed ACTI0E_SESS_/OOL_MT1 ( !s $3e ac$!"e sess!on oo& resource a&&oca$!on me$3od+ &!m!$s $3e number o8 ac$!"e sess!ons# A&& o$3er sess!ons are !nac$!"e and 7a!$ !n a :ueue $o be ac$!"a$ed# ACTIVE_SESS_POOL_ABSOLUTE !s $3e de8au&$ and on&% me$3od a"a!&ab&e /ARALLEL_DEGREE_LIMIT_MT1( !s $3e resource a&&oca$!on me$3od 8or s ec!8%!ng a &!m!$ on $3e degree o8 ara&&e&!sm o8 an% o era$!on# /ARALLEL_DEGREE_LIMIT_A.SOLUTE !s $3e de8au&$ and on&% me$3od a"a!&ab&e QUEUING_MT1 ( !s $3e Queu!ng resource a&&oca$!on me$3od# Con$ro&s order !n 73!c3 :ueued !nac$!"e sess!ons 7!&& execu$e# 4I4O_TIMEOUT !s $3e de8au&$ and on&% me$3od a"a!&ab&e# 4&ample0 SQL> exec dbms_resource_manager#crea$e_ &an '/LAN(> 5&!m!$_ ara&&e&!sm5+ COMMENT (> 5L!m!$s ara&&e&!sm $o <5,-

7. Add Resour e Plan *ire tive


Resource plan directives allocate resources among the resource consumer groups in the resource plan% 4ssentiall", directives connect resource consumer groups or subplans to their resource plans% *here is at least one resource plan directive for each entr" in the resource plan% Resource plan directives use resource allocation methods to determine how the DRM will allocate resources to a resource consumer group or resource plan% +"nta&0 D.MS_RESOURCE_MANAGER#CREATE_/LAN_DIRECTI0E ' &an IN 0ARC1AR2+ grou _or_sub &an IN 0ARC1AR2+ commen$ IN 0ARC1AR2+ c u_ = IN NUM.ER DE4AULT NULL+ c u_ 2 IN NUM.ER DE4AULT NULL+ c u_ > IN NUM.ER DE4AULT NULL+ c u_ < IN NUM.ER DE4AULT NULL+ c u_ ? IN NUM.ER DE4AULT NULL+ c u_ @ IN NUM.ER DE4AULT NULL+ c u_ A IN NUM.ER DE4AULT NULL+ c u_ B IN NUM.ER DE4AULT NULL+ ac$!"e_sess_ oo&_ = IN NUM.ER DE4AULT NULL+

Yahoo! White Paper


:ueue!ng_ = ra&&e&_degree_&!m!$_ = s7!$c3_grou s7!$c3_$!me s7!$c3_es$!ma$e max_es$_exec_$!me undo_ oo& max_!d&e_$!me max_!d&e_b&oc9er_$!me s7!$c3_$!me_!n_ca&& ;3ere /LAN GROU/_OR_SU./LAN COMMENT C/U_/= IN NUM.ER DE4AULT NULL+ IN NUM.ER DE4AULT NULL+ IN 0ARC1AR2 DE4AULT NULL+ IN NUM.ER DE4AULT NULL+ IN .OOLEAN DE4AULT 4ALSE+ IN NUM.ER DE4AULT NULL+ IN NUM.ER DE4AULT NULL+ IN NUM.ER DE4AULT NULL+ IN NUM.ER DE4AULT NULL+ IN NUM.ER DE4AULT NULL,-

( $3e name o8 $3e resource &an ( $3e name o8 $3e consumer grou or sub &an ( Commen$ 8or $3e &an d!rec$!"e+ ( 4or EM/1ASIS+ s ec!8!es $3e C/U ercen$age a$ $3e 8!rs$ &e"e&+ 4or RATIO+ s ec!8!es $3e 7e!g3$ o8 C/U usage# De8au&$ !s NULL 8or a&& C/U arame$ers# C/U_/2 ( 4or EM/1ASIS+ s ec!8!es $3e C/U ercen$age a$ $3e second &e"e&# No$ a &!cab&e 8or RATIO+ C/U_/B ( 4or EM/1ASIS+ s ec!8!es $3e C/U ercen$age a$ $3e e!g3$3 &e"e&# No$ a &!cab&e 8or RATIO+ ACTI0E_SESS_/OOL_/= ( S ec!8!es max!mum number o8 concurren$&% ac$!"e sess!ons 8or a consumer grou # De8au&$ !s NULL+ 73!c3 means un&!m!$ed# QUEUEING_/= ( S ec!8!ed $!me '!n seconds, a8$er 73!c3 a Cob !n $3e !nac$!"e sess!on :ueue '7a!$!ng 8or execu$!on, 7!&& $!me ou$# De8au&$ !s NULL+ 73!c3 means un&!m!$ed+ /ARALLEL_DEGREE_LIMIT_/= ( S ec!8!es a &!m!$ on $3e degree o8 ara&&e&!sm 8or an% o era$!on# De8au&$ !s NULL+ 73!c3 means un&!m!$ed#+ S;ITC1_GROU/ ( S ec!8!es consumer grou $o 73!c3 $3!s sess!on !s s7!$c3ed !8 o$3er s7!$c3 cr!$er!a !s me$# De8au&$ !s NULL# I8 $3e grou name !s 5CANCEL_SQL5+ $3e curren$ ca&& 7!&& be cance&ed 73en o$3er s7!$c3 cr!$er!a are me$# I8 $3e grou name !s 5DILL_SESSION5+ $3e sess!on 7!&& be 9!&&ed 73en o$3er s7!$c3 cr!$er!a are me$+ S;ITC1_TIME ( S ec!8!es $!me '!n seconds, $3a$ a sess!on can execu$e be8ore an ac$!on !s $a9en# De8au&$ !s NULL+ 73!c3 means un&!m!$ed+ S;ITC1_ESTIMAT (8 TRUE+ $e&&s Orac&e $o use !$s execu$!on $!me es$!ma$e $o au$oma$!ca&&% s7!$c3 $3e consumer grou o8 an o era$!on be8ore beg!nn!ng !$s execu$!on# De8au&$ !s 4ALSE+ MAE_EST_EEEC_TIME ( S ec!8!es $3e max!mum execu$!on $!me '!n seconds, a&&o7ed 8or a sess!on# I8 $3e o $!m!Fer es$!ma$es $3a$ an o era$!on 7!&& $a9e &onger $3an MAE_EST_EEEC_TIME+ $3e o era$!on !s no$ s$ar$ed and ORA6GA<?? !s !ssued# I8 $3e o $!m!Fer does no$ ro"!de an es$!ma$e+ $3!s d!rec$!"e 3as no e88ec$# De8au&$ !s NULL+ 73!c3 means un&!m!$ed+ UNDO_/OOL ( Se$s a max!mum !n 9!&ob%$es 'D, on $3e $o$a& amoun$ o8 undo genera$ed b% a consumer grou # De8au&$ !s NULL+ 73!c3 means un&!m!$ed+ MAE_IDLE_TIME ( Ind!ca$es $3e max!mum sess!on !d&e $!me# De8au&$ !s NULL+ 73!c3 means un&!m!$ed+

Yahoo! White Paper


MAE_IDLE_.LOCDER_TIME S;ITC1_TIME_IN_CALL ( $3e max!mum amoun$ o8 $!me !n seconds $3a$ a sess!on can be !d&e 73!&e b&oc9!ng ano$3er sess!on5s ac:u!s!$!on o8 a resource+ ( S ec!8!es $!me '!n seconds, $3a$ a sess!on can execu$e be8ore an ac$!on !s $a9en# A$ $3e end o8 $3e $o ca&&+ $3e consumer grou o8 $3e sess!on !s res$ored $o !$s or!g!na& consumer grou # De8au&$ !s NULL+ 73!c3 means un&!m!$ed# .o$3 S;ITC1_TIME_IN_CALL and S;ITC1_TIME canno$ be s ec!8!ed#

4&ample0 SQL> exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN (> 5&!m!$_ ara&&e&!sm5+GROU/_OR_SU./LAN (> 5grou _7!$3_&!m!$ed_ ara&&e&!sm5+commen$ (> 5&!m!$s $3e ara&&e&!sm5+ /ARALLEL_DEGREE_LIMIT_/=(> <,SQL>exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN(> 5&!m!$_ ara&&e&!sm5+GROU/_OR_SU./LAN (>5o$3er_grou s5+COMMENT(>5&ea"e o$3ers a&one5+C/U_/=(>=GG,+" ,u$mit pending area Once "ou have configured the resource plan "ou can use the following procedure to persist "our changes n the database% 'f "ou are editing a resource plan that is currentl" active "our changes will be immediatel" enabled% SQL> exec dbms_resource_manager#subm!$_ end!ng_area',-" .na$le Resour e Plan 3ow that "our resource plan is defined, "ou can enable it b" setting the resource_manager_ &an parameter with "our resource plan name% SQL> a&$er s%s$em se$ resource_manager_ &an ( 5&!m!$_ ara&&e&!sm* s!d(*H*3ote0 'n a RAC environment, Resource Manager manages each database instance independentl"% 4ach database instance can be configured with its own resource plan that reflects the applications it)s running% 6owever, most deplo"ments configure the same resource plan for all instances in the RAC database% Putting all the steps0 !" , enario /or implementing *#P at user level =# exec dbms_resource_manager#crea$e_ end!ng_area',2# exec dbms_resource_manager#crea$e_consumer_grou ')grou _7!$3_L!m!$ed_ ara&&e&!sm*+ )L!m!$s $3e degree o8 ara&&e&!sm*,># exec dbms_resource_manager#se$_consumer_grou _ma )grou _7!$3_L!m!$ed_ ara&&e&!sm*,!ng'a$$r!bu$e (> D.MS_RESOURCE_MANAGER#ORACLE_USER+"a&ue (> 5DRM5+consumer_grou (>

Yahoo! White Paper


<# exec dbms_resource_manager#subm!$_ end!ng_area',?# exec dbms_resource_manager#crea$e_ end!ng_area',6. exec dbms_resource_manager#crea$e_ &an '/LAN(> 5&!m!$_ ara&&e&!sm5+ COMMENT (> )L!m!$ DO/ $o

<*,A# exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN (> 5&!m!$_ ara&&e&!sm5+GROU/_OR_SU./LAN (> 5grou _7!$3_&!m!$ed_ ara&&e&!sm5+commen$ (> 5&!m!$s $3e ara&&e&!sm5+ /ARALLEL_DEGREE_LIMIT_/=(> <,B# exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN(> 5&!m!$_ ara&&e&!sm5+GROU/_OR_SU./LAN (>5o$3er_grou s5+COMMENT(>5&ea"e o$3ers a&one5+C/U_/=(>=GG,I# exec dbms_resource_manager#subm!$_ end!ng_area',SQL> s3o arame$er resource_manager_ &an NAME TJ/E 0ALUE 666666666666666666666666666666666666 66666666666 666666666666666666666666666666 resource_manager_ &an s$r!ng &!m!$_ ara&&e&!sm SQL> se&ec$ /LAN+ GROU/_OR_SU./LAN+ /ARALLEL_DEGREE_LIMIT_/=+ COMMENTS 8rom D.A_RSRC_/LAN_DIRECTI0ES 73ere /LAN( )LIMIT_/ARALLELISM5/LAN 66666666666666666666666 LIMIT_/ARALLELISM LIMIT_/ARALLELISM GROU/_OR_SU./LAN /ARALLEL_DEGREE_LIMIT_/= COMMENTS 666666666666666666666666666666666666 66666666666666666666666666666666666 666666666666666666 GROU/_;IT1_LIMITED_/ARALLELISM < L!m!$ DO/ $o < OT1ER_GROU/S &ea"e o$3ers a&one

SQL> se&ec$ ATTRI.UTE+ 0ALUE+ CONSUMER_GROU/ 8rom D.A_RSRC_GROU/_MA//INGS 73ere CONSUMER_GROU/(5JETL_LO;5ATTRI.UTE 0ALUE CONSUMER_GROU/ 6666666666666666666666666 66666666666666666666666666 666666666666666666666666666666 ORACLE_USER DRM GROU/_;IT1_LIMITED_/ARALLELISM 4rom abo"e %ou can sa% $3a$ user DRM 3as been ass!gned $o consumer grou GROU/_;IT1_LIMITED_/ARALLELISM SQL> se&ec$ username 8rom dba_users 73ere username( )DRM*USERNAME 66666666666666666666 DRM 3ow as DRM user e&ecute the +/- statement for testing the DOP

Yahoo! White Paper


DRM > se&ec$ KHL ara&&e&'dba_segmen$s+=2, HK H 8rom dba_segmen$s+dba_ex$en$s3ow monitor the DOP logging as s"s user SQL> Username 666666666666 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co 6 o#co QCKS&a"e 6666666666 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, S&a"e Se$ 6666666666 = = = 2 = 2 = = 2 2 QCSID Re:ues$ed DO/ 6666666666 6666666666666666666666 =G?B 2 =G?B 2 =G?@ =2 =G?@ =2 =G?@ =2 =G?@ =2 =G?@ =2 =G?@ =2 =G?@ =2 =G?@ =2 Ac$ua& DO/ INST_ID 66666666666666 66666666 2 = 2 2 < = < = < = < = < = < = < = < = SID 6666666666 =G@? =G?< =G?I =G?A =G?= =G@G =GAG =G@2 =G@< =G@@

1e can see from above output, the actual re#uested DOP was 78, but the +/- got was 9 Adding one more user to the plan: SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#se$_consumer_grou _ma !ng'a$$r!bu$e (> D.MS_RESOURCE_MANAGER#ORACLE_USER+"a&ue (> 5DRM25+consumer_grou (> 5grou _7!$3_L!m!$ed_ ara&&e&!sm5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> se&ec$ ATTRI.UTE+ 0ALUE+CONSUMER_GROU/ 8rom D.A_RSRC_GROU/_MA//INGS 73ere CONSUMER_GROU/(5GROU/_;IT1_LIMITED_/ARALLELISM5ATTRI.UTE 0ALUE CONSUMER_GROU/ 666666666666666666666666666666 666666666666666666666666666666 666666666666666666666666666666 ORACLE_USER DRM GROU/_;IT1_LIMITED_/ARALLELISM ORACLE_USER DRM2 GROU/_;IT1_LIMITED_/ARALLELISM

Yahoo! White Paper


%" , enario /or implementing *#P at servi e level
=# exec dbms_resource_manager#crea$e_ e!nd!ng_area',2# exec dbms_resource_manager#crea$e_consumer_grou '5&!m!$ed_ ara&&e&!sm_ser"!ce5+5&!m!$s $3e degree o8 ara&&e&!sm5,># exec dbms_resource_manager#se$_consumer_grou _ma 5&!m!$ed_ ara&&e&!sm_ser"!ce5,<# exec dbms_resource_manager#subm!$_ end!ng_area',?# exec dbms_resource_manager#crea$e_ end!ng_area',@# exec dbms_resource_manager#crea$e_ &an'/LAN(> 5LIMIT_/ARALLELISM_SER5+COMMENT (> 5L!m!$s ara&&e&!sm $o >5,A# exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN (> 5LIMIT_/ARALLELISM_SER5+ GROU/_OR_SU./LAN (> 5&!m!$ed_ ara&&e&!sm_ser"!ce5+commen$ (> 5&!m!$s $3e ara&&e&!sm5+ /ARALLEL_DEGREE_LIMIT_/=(> >,B# exec dbms_resource_manager#crea$e_ &an_d!rec$!"e'/LAN (> 5LIMIT_/ARALLELISM_SER5+ GROU/_OR_SU./LAN (> 5OT1ER_GROU/S5+COMMENT(>5&ea"e o$3ers a&one5+C/U_/=(>=GG,I# exec D.MS_RESOURCE_MANAGER#SU.MIT_/ENDING_AREA',SQL> s3o7 arame$er resource_manager_ &an NAME TJ/E 0ALUE 6666666666666666666666666666666 66666666666 666666666666666666666666666666 resource_manager_ &an s$r!ng LIMIT_/ARALLELISM_SER SQL> se&ec$ /LAN+ GROU/_OR_SU./LAN+ /ARALLEL_DEGREE_LIMIT_/=+COMMENTS 8rom D.A_RSRC_/LAN_DIRECTI0ES 73ere /LAN(5LIMIT_/ARALLELISM_SER5/LAN 666666666666666666666666 LIMIT_/ARALLELISM_SER LIMIT_/ARALLELISM_SER GROU/_OR_SU./LAN /ARALLEL_DEGREE_LIMIT_/= COMMENTS 66666666666666666666666666666 6666666666666666666666666666 666666666666666666 OT1ER_GROU/S &ea"e o$3ers a&one LIMITED_/ARALLELISM_SER0ICE > &!m!$s $3e ara&&e&!sm !ng'a$$r!bu$e (> dbms_resource_manager#ser"!ce_name+"a&ue (> 5TESTD._A/5+consumer_grou (>

SQL> se&ec$ ATTRI.UTE+ 0ALUE+ CONSUMER_GROU/ 8rom D.A_RSRC_GROU/_MA//INGS 73ere CONSUMER_GROU/(5LIMITED_/ARALLELISM_SER0ICE5ATTRI.UTE 666666666666666666666666666666 SER0ICE_NAME 0ALUE 6666666666666666666666 TESTD._A/ CONSUMER_GROU/ 6666666666666666666666666666 LIMITED_/ARALLELISM_SER0ICE

Yahoo! White Paper


SQL> se&ec$ name 8rom dba_ser"!ces 73ere name(5$es$db_a 5NAME 6666666666666666 $es$db_a -ogin as DRM user using service name TESTD._A/ and e&ecute the +/s:& &us DRMKHHHHHHHM$es$db_a DRM> se&ec$ KHL ara&&e&'dba_segmen$s+@, HK H 8rom dba_segmen$s+dba_ex$en$s3ow login as +,+ user and monitor the DOP# SJS> Username QC/Slave SlaveSet DRM= 6 GG= 6 GG2 6 GGG 6 GG< 6 GG? 6 GG> QC 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, 'S&a"e, = = = 2 2 2 SID =G@= =G?< =G@A =G@@ =G?@ =G?B =G@> Slave INS QC SID QC INS Re . D!" Actual D!" = = = = = = = =G@= =G@= =G@= =G@= =G@= =G@= =G@= = = = = = = @ @ @ @ @ @ > > > > > >

Conclusion0 Resource manager plan LIMIT_/ARALLELISM_SER is set for TESTD._A/ service to restrict it:s DOP to ; #odi$%ing the restricted D!" $rom & to ': SQL> s3o arame$er resource_manager_ &an NAME 6666666666666666666666666666666 resource_manager_ &an TJ/E 66666666666 s$r!ng 0ALUE 666666666666666666666666666666 LIMIT_/ARALLELISM_SER

SQL> se&ec$ /LAN+ GROU/_OR_SU./LAN+ /ARALLEL_DEGREE_LIMIT_/=+COMMENTS 8rom D.A_RSRC_/LAN_DIRECTI0ES 73ere /LAN(5LIMIT_/ARALLELISM_SER5/LAN 666666666666666666666666 LIMIT_/ARALLELISM_SER LIMIT_/ARALLELISM_SER GROU/_OR_SU./LAN /ARALLEL_DEGREE_LIMIT_/= COMMENTS 66666666666666666666666666666 6666666666666666666666666666 666666666666666666 OT1ER_GROU/S &ea"e o$3ers a&one LIMITED_/ARALLELISM_SER0ICE > &!m!$s $3e ara&&e&!sm

SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed#

Yahoo! White Paper


SQL> exec D.MS_RESOURCE_MANAGER#U/DATE_/LAN_DIRECTI0E' &an (> 5LIMIT_/ARALLELISM_SER5+ grou _or_sub &an (> )LIMITED_/ARALLELISM_SER0ICE 5+ ne7_commen$ (> 5L!m!$ DO/ $o B5+ ne7_ ara&&e&_degree_&!m!$_ = (> B,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> se&ec$ /LAN+ GROU/_OR_SU./LAN+ /ARALLEL_DEGREE_LIMIT_/=+ COMMENTS 8rom D.A_RSRC_/LAN_DIRECTI0ES 73ere /LAN(5LIMIT_/ARALLELISM5/LAN GROU/_OR_SU./LAN /ARALLEL_DEGREE_LIMIT_/= COMMENTS 666666666666666666666666666666 66666666666666666666666666666666666 66666666666666666666666666666666666 6666666666666666 LIMIT_/ARALLELISM_SER OT1ER_GROU/S &ea"e o$3ers a&one LIMIT_/ARALLELISM_SER LIMITED_/ARALLELISM_SER0ICE B L!m!$ DO/ $o B 1e can also update or delete the resource manager components with the following oracle Resource manager procedures0 *0..1.2P0A34 Deletes the specified plan as well as all the plan directives it refers to% Exam &eN SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#de&e$e_ &an'5LIMIT_/ARALLELISM5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# *.0.1.2P0A32CA,CA*.4 Deletes the specified plan as well as all its descendants <plan directives, subplans, consumer groups= *.0.1.2C#3,5M.R26R#5P4 Deletes entries which define resource consumer groups Exam &eN SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#de&e$e_consumer_grou '5GROU/_;IT1_LIMITED_EEEC_TIME5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed#

*.0.1.2P0A32*IR.C1I7.4 Deletes resource plan directives

Yahoo! White Paper


4&ample0 SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec bms_resource_manager#de&e$e_ &an_d!rec$!"e '5LIMIT_/ARALLELISM_SER5+ 5LIMITED_/ARALLELISM_SER0ICE5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# ,WI1C82C#3,5M.R26R#5P29#R2,.,,4 Changes the resource consumer group of a specific session 4&ample0 SQL> se&ec$ s!d+ser!a&O 8rom g"Psess!on 73ere username &!9e 5DRM5SID SERIALO 6666666 666666666 =G?A =G?B> SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#S;ITC1_CONSUMER_GROU/_4OR_SESS '=G?A+=G?B>+5DE4AULT_CONSUMER_GROU/5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# ,WI1C82C#3,5M.R26R#5P29#R25,.R4 Changes the resource consumer group for all sessions with a given user name Exam &eN SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#S;ITC1_CONSUMER_GROU/_4OR_USER '5DRM5+5GROU/_;IT1_LIMITED_/ARALLELISM5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed#

Yahoo! White Paper


,WI1C82P0A32PR#C.*5R.4 +ets the current resource manager plan SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#s7!$c3_ &an'5LIMIT_/ARALLELISM_SER5+5$es$db=5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# 5P*A1.2C#3,5M.R26R#5P4 4&ample0 SQL> se&ec$ CONSUMER_GROU/+COMMENTS 8rom dba_rsrc_consumer_grou s 73ere CONSUMER_GROU/(5LIMITED_/ARALLELISM_SER0ICE5CONSUMER_GROU/ COMMENTS 666666666666666666666666666666 6666666666666666666666666666666666666666666666666666666 LIMITED_/ARALLELISM_SER0ICE &!m!$s $3e de SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#u da$e_consumer_grou '5LIMITED_/ARALLELISM_SER0ICE5+ne7_commen$ (> 5L!m!$s DO/ $o >5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> se&ec$ CONSUMER_GROU/+ COMMENTS 8rom dba_rsrc_consumer_grou s 73ere CONSUMER_GROU/(5LIMITED_/ARALLELISM_SER0ICE5CONSUMER_GROU/ 6666666666666666666666666666666666666666666 LIMITED_/ARALLELISM_SER0ICE 5P*A1.2P0A34 COMMENTS 66666666666666666666666666666666666666666666666 L!m!$s DO/ $o > pdates entries which define resource consumer groups

pdates entries which define resource plans

SQL> se&ec$ &an+commen$s 8rom dba_rsrc_ &ans 73ere &an &!9e 5LIMIT_/ARALLELISM_SER5/LAN 666666666666666666666666666666 LIMIT_/ARALLELISM_SER COMMENTS 66666666666666666666666666666666666666666666 L!m!$s ara&&e&!sm $o >

SQL> exec dbms_resource_manager#crea$e_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed#

Yahoo! White Paper


SQL> exec dbms_resource_manager#u da$e_ &an'5LIMIT_/ARALLELISM_SER5+ ne7_commen$ (> 5L!m!$s DO/ $o >5,/LKSQL rocedure success8u&&% com &e$ed# SQL> exec dbms_resource_manager#subm!$_ end!ng_area',/LKSQL rocedure success8u&&% com &e$ed# SQL> se&ec$ &an+commen$s 8rom dba_rsrc_ &ans 73ere &an &!9e 5LIMIT_/ARALLELISM_SER5/LAN 666666666666666666666666666666 LIMIT_/ARALLELISM_SER COMMENTS 66666666666666666666666666666666666666666666 L!m!$s DO/ $o >

5se/ul di tionary vie:s to monitor resour e manager4 DBA>R+RC>P-A3+ DBA>R+RC>CO3+ M4R>?RO P+ DBA>R+RC>P-A3>D'R4C*'@4+ DBA>R+RC>CO3+ M4R>?RO P>PR'@+ DBA>R+RC>MA3A?4R>+,+*4M>PR'@+ DBA>R+RC>?RO P>MAPP'3?+ DBA>R+RC>MAPP'3?>PR'OR'*, ?@>AR+RC>CO3+ M4>?RO P>CP >M*6 ?@AR+RC>CO3+ M4R>?RO P>CP >M*6 ?@>AR+RC>P-A3>CP >M*6 ?@AR+RC>P-A3>CP >M*6 ?@>AR+RC>CO3+ M4R>?RO P ?@AR+RC>CO3+ M4R>?RO P ?@>AR+RC>+4++'O3>'3(O ?@AR+RC>+4++'O3>'3(O ?@>AR+RC>P-A3 ?@AR+RC>P-A3 ?@>AR+RC>CO3+>?RO P>6'+*OR, ?@AR+RC>CO3+>?RO P>6'+*OR, ?@>AR+RC>P-A3>6'+*OR, ?@AR+RC>P-A3>6'+*OR,

Con lusion

Yahoo! White Paper


B" using Oracle database resource manager to manage the database workload, "ou can keep the server running at a health" load, ensure that critical background do not starve, and ensure that "ou can alwa"s login and debug database issues%

You might also like