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>
38 lines
5.8 KiB
HTML
38 lines
5.8 KiB
HTML
<a name="EN-US_TOPIC_0000001188110562"></a><a name="EN-US_TOPIC_0000001188110562"></a>
|
|
|
|
<h1 class="topictitle1">REASSIGN OWNED</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188110562__sb57a234176e0412fb36d03c51812a41e"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188110562__en-us_topic_0059779106_p89891140821"><strong id="EN-US_TOPIC_0000001188110562__b23426215733519">REASSIGN OWNED</strong> changes the owner of a database.</p>
|
|
<p id="EN-US_TOPIC_0000001188110562__a9c3316702b014db5a3e324e23ef4a260"><strong id="EN-US_TOPIC_0000001188110562__b842352706153120">REASSIGN OWNED</strong> requires that the system change owners of all the database objects owned by <strong id="EN-US_TOPIC_0000001188110562__b84017730333519">old_role</strong> to <strong id="EN-US_TOPIC_0000001188110562__b19181875833519">new_role</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110562__s7857dce882194dac9b7bfd1b08b02fb5"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188110562__uf2f61cbb4418418db972f1a20027fb1e"><li id="EN-US_TOPIC_0000001188110562__l4087ff4b23a94a9aa3b658fdaa0af5bc"><strong id="EN-US_TOPIC_0000001188110562__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_0000001188110562__lfbbff1d23f0f4ca9ae7be7c0291dcc6b">You must have the permissions on the original and target roles to execute it.</li><li id="EN-US_TOPIC_0000001188110562__li1290973111718">The resource management module does not monitor the data switch of the syntax. You need to call <strong id="EN-US_TOPIC_0000001188110562__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_0000001188110562__s83507d927cda4d9e95e91b51d3d42360"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188110562__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_0000001188110562__sf1398035b57c4ababe5491c31fda9db2"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188110562__ubb5ce7d0e02844d282aac608d91966bf"><li id="EN-US_TOPIC_0000001188110562__lb8592a56e82341eba90d9ab9a805940a"><strong id="EN-US_TOPIC_0000001188110562__acdb681f3572740d7bc0c684cbc539740">old_role</strong><p id="EN-US_TOPIC_0000001188110562__ada4e875467d9497cb18a2154d6871d1c">Specifies the role name of the old owner.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188110562__l1850c4d376b748c583643e250bf454f6"><strong id="EN-US_TOPIC_0000001188110562__ab50e0211a460406e975c13270969b7f2">new_role</strong><p id="EN-US_TOPIC_0000001188110562__a20aff09d472d49bdab40a7f630e5cf6d">Specifies the role name of the new owner.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188110562__section1485355131814"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188110562__p29921744133119">Create two users:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188110562__screen21996219322"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">joe</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{Password}'</span><span class="p">;</span>
|
|
<span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">jack</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{Password}'</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188110562__p205421813483">Reassign all database objects owned by the <strong id="EN-US_TOPIC_0000001188110562__b166954972733519">joe</strong> and <strong id="EN-US_TOPIC_0000001188110562__b191091955633519">jack</strong> roles to <strong id="EN-US_TOPIC_0000001188110562__b16555203633519">admin</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188110562__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="n">dbadmin</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>
|
|
|