Professional Documents
Culture Documents
White Paper
modify entries that map sessions to consumer groups, based on the session's login and runtime
+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&le0 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%
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
( $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+
4&le0 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 (>
<*,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
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
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
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> 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 >
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