{
  "date": "2016-03-10T15:15:40",
  "slug": "resource-manager-plan-from-oem-vs-command-line",
  "link": "https://www.dbi-services.com/blog/resource-manager-plan-from-oem-vs-command-line/",
  "title": {
    "rendered": "Resource Manager plan from OEM vs. command line"
  },
  "content": {
    "rendered": "<h2>By Franck Pachot</h2>\n<p>.<br />\nYou are rather GUI or command line? Let&#8217;s compare what you can do with them when you want to create a Resource Manager plan, and what is missing in the GUI.<br />\n<!--more--><br />\nI&#8217;m using EM13<em>c</em> here on a 12<em>c</em> database. Doc for command line API is <a href=\"https://docs.oracle.com/database/121/ARPLS/d_resmgr.htm#ARPLS67609\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.</p>\n<p>I&#8217;ll explain what you can set in the GUI and the matching arguments generated by OEM:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.36.19.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.36.19.png\" alt=\"Screenshot 2016-03-10 13.36.19\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-7385\" /></a></p>\n<p>Here we have the name and description (comment):</p>\n<pre><code>DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (\n   plan                      IN VARCHAR2, \n   comment                   IN VARCHAR2 DEFAULT NULL, </code></pre>\n<p>When the &#8216;Activate this plan&#8217; is checked, it calls the dbms_resource_manager.switch_plan, with the allow_scheduler_plan_switches=&gt;false if you uncheck &#8216;Automatic Plan Switching Enabled&#8217;</p>\n<p>The CREATE_PLAN_DIRECTIVE is called for each group or sub plan:</p>\n<pre><code>   group_or_subplan          IN VARCHAR2, \n</code></pre>\n<p>The &#8216;Utilization limit %&#8217; defines the max_utilization_limit wich is now utilization_limit:</p>\n<pre><code>   max_utilization_limit        IN NUMBER   DEFAULT NULL,  -- deprecated\n   utilization_limit            IN NUMBER   DEFAULT NULL,</code></pre>\n<p>The number or shares that we set are converted to percentage of total shares in order to define the cpu_p1 which is now mgmt_p1.</p>\n<pre><code>\n   cpu_p1                    IN NUMBER   DEFAULT NULL, -- deprecated\n   mgmt_p1                   IN NUMBER   DEFAULT NULL,</code></pre>\n<p>Actually, OEM put the share number and not the percentage when generating the SQL, but that&#8217;s ok.</p>\n<h3>Parallel Query DOP and queuing</h3>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.36.56.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.36.56.png\" alt=\"Screenshot 2016-03-10 13.36.56\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-7384\" /></a></p>\n<p>Here are the parallel settings. &#8216;bypass queue&#8217; sets parallel_stmt_critical to &#8216;bypass_queue&#8217; to avoid statement queuing for this consumer group.</p>\n<pre><code>   parallel_stmt_critical       IN VARCHAR2 DEFAULT NULL);\n</code></pre>\n<p>and the settings (using the deprecated parallel_target_percentage instead of parallel_sever_limit )</p>\n<pre><code>   parallel_degree_limit_p1  IN NUMBER   DEFAULT NULL,\n   parallel_target_percentage   IN NUMBER   DEFAULT NULL,  -- deprecated \n   parallel_queue_timeout       IN NUMBER   DEFAULT NULL,</code></pre>\n<p>The timeout is the number of seconds the statement can remain queued.</p>\n<h3>Per session or per-call limits</h3>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.37.03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.37.03.png\" alt=\"Screenshot 2016-03-10 13.37.03\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-7383\" /></a></p>\n<p>The limits set the following arguments (in respective order):</p>\n<pre><code>   switch_elapsed_time          IN NUMBER   DEFAULT NULL,\n   switch_time                  IN NUMBER   DEFAULT NULL,\n   switch_io_megabytes          IN NUMBER   DEFAULT NULL,\n   switch_io_logical            IN NUMBER   DEFAULT NULL,\n   switch_io_reqs               IN NUMBER   DEFAULT NULL,</code></pre>\n<p>The actions sets a consumer group to switch to, or KILL_SESSION or CANCEL_SQL:</p>\n<pre><code>   switch_group              IN VARCHAR2 DEFAULT NULL,\n</code></pre>\n<p>The &#8216;track by statement&#8217; sets to true the switch_for_call (it switches to group only until the end of the call) and the &#8216;use estimate&#8217; sets switch_estimate to true:</p>\n<pre><code>   switch_for_call           IN BOOLEAN  DEFAULT NULL,\n   switch_estimate           IN BOOLEAN  DEFAULT FALSE,</code></pre>\n<h3>Idle time limits</h3>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.37.11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Screenshot-2016-03-10-13.37.11.png\" alt=\"Screenshot 2016-03-10 13.37.11\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-7382\" /></a></p>\n<p>This sets the following time in seconds:</p>\n<pre><code>   max_idle_time                IN NUMBER   DEFAULT NULL,\n   max_idle_blocker_time        IN NUMBER   DEFAULT NULL,</code></pre>\n<h3>What is missing?</h3>\n<p>It seems that we cannot set here the limit based on CBO estimation:</p>\n<pre><code>   max_est_exec_time         IN NUMBER   DEFAULT NULL,</code></pre>\n<p>Same for the maximum number of active sessions limit</p>\n<pre><code>   active_sess_pool_p1       IN NUMBER   DEFAULT NULL,\n</code></pre>\n<p>And the transaction undo size limit:</p>\n<pre><code>   undo_pool                 IN NUMBER   DEFAULT NULL,\n</code></pre>\n",
    "protected": false
  }
}
