<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="alter-resource-group">
      </a>
      15.7.2.1 ALTER RESOURCE GROUP Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045172845712">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa60824122"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">ALTER</span> <span class="token keyword">RESOURCE</span> <span class="token keyword">GROUP</span> <em class="replaceable">group_name</em>
    <span class="token punctuation">[</span><span class="token keyword">VCPU</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> <em class="replaceable">vcpu_spec</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">vcpu_spec</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">]</span>
    <span class="token punctuation">[</span><span class="token keyword">THREAD_PRIORITY</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> <em class="replaceable">N</em><span class="token punctuation">]</span>
    <span class="token punctuation">[</span><span class="token keyword">ENABLE</span><span class="token operator">|</span><span class="token keyword">DISABLE</span> <span class="token punctuation">[</span><span class="token keyword">FORCE</span><span class="token punctuation">]</span><span class="token punctuation">]</span>

<em class="replaceable">vcpu_spec</em>: {<em class="replaceable">N</em> <span class="token operator">|</span> <em class="replaceable">M</em> <span class="token operator">-</span> <em class="replaceable">N</em>}</code></pre>
  </div>
  <p>
   <a class="link" href="alter-resource-group.html" title="15.7.2.1 ALTER RESOURCE GROUP Statement">
    <code class="literal">
     ALTER RESOURCE GROUP
    </code>
   </a>
   is used for
        resource group management (see
   <a class="xref" href="resource-groups.html" title="7.1.16 Resource Groups">
    Section 7.1.16, “Resource Groups”
   </a>
   ). This statement alters
        modifiable attributes of an existing resource group. It requires
        the
   <a class="link" href="privileges-provided.html#priv_resource-group-admin">
    <code class="literal">
     RESOURCE_GROUP_ADMIN
    </code>
   </a>
   privilege.
  </p>
  <p>
   <em class="replaceable">
    <code>
     group_name
    </code>
   </em>
   identifies which resource
        group to alter. If the group does not exist, an error occurs.
  </p>
  <p>
   The attributes for CPU affinity, priority, and whether the group
        is enabled can be modified with
   <a class="link" href="alter-resource-group.html" title="15.7.2.1 ALTER RESOURCE GROUP Statement">
    <code class="literal">
     ALTER
        RESOURCE GROUP
    </code>
   </a>
   . These attributes are specified the
        same way as described for
   <a class="link" href="create-resource-group.html" title="15.7.2.2 CREATE RESOURCE GROUP Statement">
    <code class="literal">
     CREATE RESOURCE
        GROUP
    </code>
   </a>
   (see
   <a class="xref" href="create-resource-group.html" title="15.7.2.2 CREATE RESOURCE GROUP Statement">
    Section 15.7.2.2, “CREATE RESOURCE GROUP Statement”
   </a>
   ).
        Only the attributes specified are altered. Unspecified
        attributes retain their current values.
  </p>
  <p>
   The
   <code class="literal">
    FORCE
   </code>
   modifier is used with
   <code class="literal">
    DISABLE
   </code>
   . It determines statement behavior if
        the resource group has any threads assigned to it:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      If
      <code class="literal">
       FORCE
      </code>
      is not given, existing threads
            in the group continue to run until they terminate, but new
            threads cannot be assigned to the group.
     </p>
    </li>
    <li class="listitem">
     <p>
      If
      <code class="literal">
       FORCE
      </code>
      is given, existing threads in
            the group are moved to their respective default group
            (system threads to
      <code class="literal">
       SYS_default
      </code>
      , user
            threads to
      <code class="literal">
       USR_default
      </code>
      ).
     </p>
    </li>
   </ul>
  </div>
  <p>
   The name and type attributes are set at group creation time and
        cannot be modified thereafter with
   <a class="link" href="alter-resource-group.html" title="15.7.2.1 ALTER RESOURCE GROUP Statement">
    <code class="literal">
     ALTER
        RESOURCE GROUP
    </code>
   </a>
   .
  </p>
  <p>
   Examples:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Alter a group CPU affinity:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28986253"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">ALTER</span> <span class="token keyword">RESOURCE</span> <span class="token keyword">GROUP</span> rg1 <span class="token keyword">VCPU</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token operator">-</span><span class="token number">63</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Alter a group thread priority:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa32295961"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">ALTER</span> <span class="token keyword">RESOURCE</span> <span class="token keyword">GROUP</span> rg2 <span class="token keyword">THREAD_PRIORITY</span> <span class="token operator">=</span> <span class="token number">5</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Disable a group, moving any threads assigned to it to the
            default groups:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa30097167"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">ALTER</span> <span class="token keyword">RESOURCE</span> <span class="token keyword">GROUP</span> rg3 <span class="token keyword">DISABLE</span> <span class="token keyword">FORCE</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
   </ul>
  </div>
  <p>
   Resource group management is local to the server on which it
        occurs.
   <a class="link" href="alter-resource-group.html" title="15.7.2.1 ALTER RESOURCE GROUP Statement">
    <code class="literal">
     ALTER RESOURCE GROUP
    </code>
   </a>
   statements are not written to the binary log and are not
        replicated.
  </p>
 </div>
 <br/>
</div>
