doc-exports/docs/dws/dev/dws_06_0252.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

31 lines
4.7 KiB
HTML

<a name="EN-US_TOPIC_0000001145510813"></a><a name="EN-US_TOPIC_0000001145510813"></a>
<h1 class="topictitle1">REASSIGN OWNED</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145510813__sb57a234176e0412fb36d03c51812a41e"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001145510813__en-us_topic_0059779106_p89891140821"><strong id="EN-US_TOPIC_0000001145510813__b166895355935647">REASSIGN OWNED</strong> changes the owner of a database.</p>
<p id="EN-US_TOPIC_0000001145510813__a9c3316702b014db5a3e324e23ef4a260"><strong id="EN-US_TOPIC_0000001145510813__b842352706153120">REASSIGN OWNED</strong> requires that the system change owners of all the database objects owned by <strong id="EN-US_TOPIC_0000001145510813__b199087961735647">old_roles</strong> to <strong id="EN-US_TOPIC_0000001145510813__b49156061935647">new_role</strong>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510813__s7857dce882194dac9b7bfd1b08b02fb5"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001145510813__uf2f61cbb4418418db972f1a20027fb1e"><li id="EN-US_TOPIC_0000001145510813__l4087ff4b23a94a9aa3b658fdaa0af5bc"><strong id="EN-US_TOPIC_0000001145510813__b842352706153145">REASSIGN OWNED</strong> is often executed before deleting a rule.</li><li id="EN-US_TOPIC_0000001145510813__lfbbff1d23f0f4ca9ae7be7c0291dcc6b">You must have the permissions on the original and target roles to execute it.</li><li id="EN-US_TOPIC_0000001145510813__li1290973111718">The resource management module does not monitor the data switch of the syntax. You need to call <strong id="EN-US_TOPIC_0000001145510813__b6816154412015">select gs_wlm_readjust_user_space(0)</strong> to manually calibrate the monitoring data.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510813__s83507d927cda4d9e95e91b51d3d42360"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145510813__scddc4325e25c4af29a403141c680ace7"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">REASSIGN</span><span class="w"> </span><span class="n">OWNED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">old_role</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">new_role</span><span class="p">;</span><span class="w"></span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510813__sf1398035b57c4ababe5491c31fda9db2"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001145510813__ubb5ce7d0e02844d282aac608d91966bf"><li id="EN-US_TOPIC_0000001145510813__lb8592a56e82341eba90d9ab9a805940a"><strong id="EN-US_TOPIC_0000001145510813__acdb681f3572740d7bc0c684cbc539740">old_role</strong><p id="EN-US_TOPIC_0000001145510813__ada4e875467d9497cb18a2154d6871d1c">Specifies the role name of the old owner.</p>
</li><li id="EN-US_TOPIC_0000001145510813__l1850c4d376b748c583643e250bf454f6"><strong id="EN-US_TOPIC_0000001145510813__ab50e0211a460406e975c13270969b7f2">new_role</strong><p id="EN-US_TOPIC_0000001145510813__a20aff09d472d49bdab40a7f630e5cf6d">Specifies the role name of the new owner.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510813__s8d5e58db5b924350a8e8fb98406316f6"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001145510813__p205421813483">Reassign all database objects owned by the <strong id="EN-US_TOPIC_0000001145510813__b14226173919487">joe</strong> and <strong id="EN-US_TOPIC_0000001145510813__b828714174814">jack</strong> roles to <strong id="EN-US_TOPIC_0000001145510813__b650344216483">admin</strong>.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145510813__screen192996379811"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">REASSIGN</span><span class="w"> </span><span class="n">OWNED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">joe</span><span class="p">,</span><span class="w"> </span><span class="n">jack</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="k">admin</span><span class="p">;</span><span class="w"></span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0242.html">DCL Syntax</a></div>
</div>
</div>