forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
29 lines
4.7 KiB
HTML
29 lines
4.7 KiB
HTML
<a name="EN-US_TOPIC_0000001460880992"></a><a name="EN-US_TOPIC_0000001460880992"></a>
|
|
|
|
<h1 class="topictitle1">REASSIGN OWNED</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001460880992__sb57a234176e0412fb36d03c51812a41e"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001460880992__en-us_topic_0059779106_p89891140821">Changes the owner of a database.</p>
|
|
<p id="EN-US_TOPIC_0000001460880992__a9c3316702b014db5a3e324e23ef4a260"><strong id="EN-US_TOPIC_0000001460880992__b91010212213">REASSIGN OWNED</strong> requires that the system changes the owner of all the database objects owned by <strong id="EN-US_TOPIC_0000001460880992__b131011921142119">old_role</strong> to <strong id="EN-US_TOPIC_0000001460880992__b11013212210">new_role</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460880992__s7857dce882194dac9b7bfd1b08b02fb5"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001460880992__uf2f61cbb4418418db972f1a20027fb1e"><li id="EN-US_TOPIC_0000001460880992__l4087ff4b23a94a9aa3b658fdaa0af5bc"><strong id="EN-US_TOPIC_0000001460880992__b842352706153145">REASSIGN OWNED</strong> is often executed before deleting a role. 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_0000001460880992__lfbbff1d23f0f4ca9ae7be7c0291dcc6b">You must have the permissions on the original and target roles to execute it.</li><li id="EN-US_TOPIC_0000001460880992__li1290973111718">The resource management module does not monitor the data switch of the syntax. You need to call <strong id="EN-US_TOPIC_0000001460880992__b648475342212">select gs_wlm_readjust_user_space(0)</strong> to manually calibrate the monitoring data.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460880992__s83507d927cda4d9e95e91b51d3d42360"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460880992__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_0000001460880992__sf1398035b57c4ababe5491c31fda9db2"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001460880992__ubb5ce7d0e02844d282aac608d91966bf"><li id="EN-US_TOPIC_0000001460880992__lb8592a56e82341eba90d9ab9a805940a"><strong id="EN-US_TOPIC_0000001460880992__acdb681f3572740d7bc0c684cbc539740">old_role</strong><p id="EN-US_TOPIC_0000001460880992__ada4e875467d9497cb18a2154d6871d1c">Specifies the role name of the old owner.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460880992__l1850c4d376b748c583643e250bf454f6"><strong id="EN-US_TOPIC_0000001460880992__ab50e0211a460406e975c13270969b7f2">new_role</strong><p id="EN-US_TOPIC_0000001460880992__a20aff09d472d49bdab40a7f630e5cf6d">Specifies the role name of the new owner.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460880992__section1485355131814"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001460880992__p205421813483">Reassign all database objects owned by the <strong id="EN-US_TOPIC_0000001460880992__b166954972733519">joe</strong> and <strong id="EN-US_TOPIC_0000001460880992__b191091955633519">jack</strong> roles to <strong id="EN-US_TOPIC_0000001460880992__b16555203633519">admin</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460880992__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>
|
|
|