Files
doc-exports/docs/dws/dev/dws_06_0252.html
luhuayi 177cd61a57 DWS DEVG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-05-05 07:44:03 +00:00

29 lines
4.8 KiB
HTML

<a name="EN-US_TOPIC_0000001764675438"></a><a name="EN-US_TOPIC_0000001764675438"></a>
<h1 class="topictitle1">REASSIGN OWNED</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001764675438__sb57a234176e0412fb36d03c51812a41e"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001764675438__en-us_topic_0059779106_p89891140821"><strong id="EN-US_TOPIC_0000001764675438__b23426215733519">REASSIGN OWNED</strong> changes the owner of a database.</p>
<p id="EN-US_TOPIC_0000001764675438__a9c3316702b014db5a3e324e23ef4a260"><strong id="EN-US_TOPIC_0000001764675438__b5708452104111">REASSIGN OWNED</strong> requires that the system change owners of all the database objects owned by <strong id="EN-US_TOPIC_0000001764675438__b970965216419">old_role</strong> to <strong id="EN-US_TOPIC_0000001764675438__b57091252134111">new_role</strong>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001764675438__s7857dce882194dac9b7bfd1b08b02fb5"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001764675438__uf2f61cbb4418418db972f1a20027fb1e"><li id="EN-US_TOPIC_0000001764675438__l4087ff4b23a94a9aa3b658fdaa0af5bc"><strong id="EN-US_TOPIC_0000001764675438__b842352706153145">REASSIGN OWNED</strong> is often executed before deleting a rule. Because objects in other databases are not affected, you usually need to run this command in each database that contains the objects owned by the role to be deleted.</li><li id="EN-US_TOPIC_0000001764675438__lfbbff1d23f0f4ca9ae7be7c0291dcc6b">You must have the permissions on the original and target roles to execute it.</li><li id="EN-US_TOPIC_0000001764675438__li1290973111718">The resource management module does not monitor the data switch of the syntax. You need to call <strong id="EN-US_TOPIC_0000001764675438__b89002572411">select gs_wlm_readjust_user_space(0)</strong> to manually calibrate the monitoring data.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001764675438__s83507d927cda4d9e95e91b51d3d42360"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001764675438__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>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001764675438__sf1398035b57c4ababe5491c31fda9db2"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001764675438__ubb5ce7d0e02844d282aac608d91966bf"><li id="EN-US_TOPIC_0000001764675438__lb8592a56e82341eba90d9ab9a805940a"><strong id="EN-US_TOPIC_0000001764675438__acdb681f3572740d7bc0c684cbc539740">old_role</strong><p id="EN-US_TOPIC_0000001764675438__ada4e875467d9497cb18a2154d6871d1c">Specifies the role name of the old owner.</p>
</li><li id="EN-US_TOPIC_0000001764675438__l1850c4d376b748c583643e250bf454f6"><strong id="EN-US_TOPIC_0000001764675438__ab50e0211a460406e975c13270969b7f2">new_role</strong><p id="EN-US_TOPIC_0000001764675438__a20aff09d472d49bdab40a7f630e5cf6d">Specifies the role name of the new owner.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001764675438__section1485355131814"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001764675438__p205421813483">Reassign all database objects owned by the <strong id="EN-US_TOPIC_0000001764675438__b166954972733519">joe</strong> and <strong id="EN-US_TOPIC_0000001764675438__b191091955633519">jack</strong> roles to <strong id="EN-US_TOPIC_0000001764675438__b16555203633519">admin</strong>:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001764675438__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>
</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>