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>
47 lines
5.9 KiB
HTML
47 lines
5.9 KiB
HTML
<a name="EN-US_TOPIC_0000001233510107"></a><a name="EN-US_TOPIC_0000001233510107"></a>
|
|
|
|
<h1 class="topictitle1">ALTER SYNONYM</h1>
|
|
<div id="body1578896975701"><div class="section" id="EN-US_TOPIC_0000001233510107__s26b72b1858a44a5984f0fa6d9a84a67c"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001233510107__ae0128647c2ba4636aa6dfcf1ca144d9a"><strong id="EN-US_TOPIC_0000001233510107__b813361610549">ALTER SYNONYM</strong> is used to modify the attribute of a synonym.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510107__sa59cc6cc8a984fd197fefdd1473b4d11"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001233510107__ul1841741521412"><li id="EN-US_TOPIC_0000001233510107__li1876417541166">Only the synonym owner can be changed.</li><li id="EN-US_TOPIC_0000001233510107__li2013520972819">Only the system administrator and the synonym owner have the permission to modify the synonym owner information.</li><li id="EN-US_TOPIC_0000001233510107__li1799212382375">The modifier must be a direct or indirect member of the new owner, and the new owner must have the CREATE permission on the schema to which the synonym belongs.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510107__section185432369210"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510107__s559f66636c2b404f9d0ca71ce44b8bb8"><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">ALTER</span><span class="w"> </span><span class="n">SYNONYM</span><span class="w"> </span><span class="n">synonym_name</span>
|
|
<span class="w"> </span><span class="k">OWNER</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">new_owner</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510107__section37023591411"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001233510107__ul849711245713"><li id="EN-US_TOPIC_0000001233510107__li11885054185912"><strong id="EN-US_TOPIC_0000001233510107__b614481895914">synonym</strong><p id="EN-US_TOPIC_0000001233510107__p836651861419">Name of a synonym to be modified (optionally with schema names)</p>
|
|
<p id="EN-US_TOPIC_0000001233510107__p188085166223">Value range: A string compliant with the identifier naming rules</p>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001233510107__ul36293317291"><li id="EN-US_TOPIC_0000001233510107__li20629833292"><strong id="EN-US_TOPIC_0000001233510107__b662912342910">new_owner</strong><p id="EN-US_TOPIC_0000001233510107__p15629173102915">New owner of a synonym object</p>
|
|
<p id="EN-US_TOPIC_0000001233510107__p18629163192912">Value range: A string. It must be a valid username.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510107__section162752045154311"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233510107__p1130650153913">Create synonym <strong id="EN-US_TOPIC_0000001233510107__b7216954161820">t1</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510107__screen14370411114011"><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="k">CREATE</span><span class="w"> </span><span class="k">OR</span><span class="w"> </span><span class="k">REPLACE</span><span class="w"> </span><span class="n">SYNONYM</span><span class="w"> </span><span class="n">t1</span><span class="w"> </span><span class="k">FOR</span><span class="w"> </span><span class="n">ot</span><span class="p">.</span><span class="n">t1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233510107__p930450133915">Create user <strong id="EN-US_TOPIC_0000001233510107__b131554252210">u1</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510107__screen456091764011"><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="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">u1</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_0000001233510107__p929550143913">Change the owner of the synonym <strong id="EN-US_TOPIC_0000001233510107__b38532031191">t1</strong> to <strong id="EN-US_TOPIC_0000001233510107__b744639151912">u1</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233510107__screen3337192354010"><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="k">ALTER</span><span class="w"> </span><span class="n">SYNONYM</span><span class="w"> </span><span class="n">t1</span><span class="w"> </span><span class="k">OWNER</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">u1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233510107__section613212620440"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001233510107__p1374711118447"><a href="dws_06_0176.html">CREATE SYNONYM</a> and <a href="dws_06_0207.html">DROP SYNONYM</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|