forked from docs/doc-exports
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>
80 lines
19 KiB
HTML
80 lines
19 KiB
HTML
<a name="EN-US_TOPIC_0000001145830623"></a><a name="EN-US_TOPIC_0000001145830623"></a>
|
|
|
|
<h1 class="topictitle1">ALTER SERVER</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145830623__sdaa70d77cde1429bbf4090cfb4003d11"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001145830623__a633998e22cee4b73b8d291a66f8fa3ac"><strong id="EN-US_TOPIC_0000001145830623__en-us_topic_0058966073_b1709878692215031">ALTER SERVER</strong> adds, modifies, or deletes the parameters of an existing server. You can query existing servers from the <strong id="EN-US_TOPIC_0000001145830623__b842352706211517">pg_foreign_server</strong> system catalog.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145830623__s6c715ecfa1fe4c3bb2a8a763c72b304e"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001145830623__p125531940113920">Only the owner of a server or a system administrator can run this statement.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145830623__s40da3dccf89d4bc6880a232426dd74f7"><h4 class="sectiontitle">Syntax</h4><ul id="EN-US_TOPIC_0000001145830623__u78f7b49531364301bfff1dc3e46878aa"><li id="EN-US_TOPIC_0000001145830623__l74b7826de2ce42669dcb4c64a3f9a431">Change the parameters of an external server.</li></ul>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145830623__se132f4f07e354c5bbcd1360cf246b226"><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">SERVER</span><span class="w"> </span><span class="k">server_name</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">VERSION</span><span class="w"> </span><span class="s1">'new_version'</span><span class="w"> </span><span class="p">]</span><span class="w"></span>
|
|
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="p">[</span><span class="w"> </span><span class="k">ADD</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">DROP</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[</span><span class="s1">'value'</span><span class="p">]</span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">];</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001145830623__p18399183164917">In <strong id="EN-US_TOPIC_0000001145830623__b842352706164531">OPTIONS</strong>, <strong id="EN-US_TOPIC_0000001145830623__b1939011184330">ADD</strong>, <strong id="EN-US_TOPIC_0000001145830623__b1576171912332">SET</strong>, and <strong id="EN-US_TOPIC_0000001145830623__b4532152216332">DROP</strong> are operations to be executed. If these operations are not specified, the <strong id="EN-US_TOPIC_0000001145830623__b12218336331">ADD</strong> operation will be performed by default. <strong id="EN-US_TOPIC_0000001145830623__b842352706165739">option</strong> and <strong id="EN-US_TOPIC_0000001145830623__b842352706165742">value</strong> are corresponding operation parameters.</p>
|
|
<p id="EN-US_TOPIC_0000001145830623__p172521486503">Currently, only <strong id="EN-US_TOPIC_0000001145830623__b1511362073613">SET</strong> is supported on an HDFS server. <strong id="EN-US_TOPIC_0000001145830623__b1811319208368">ADD</strong> and <strong id="EN-US_TOPIC_0000001145830623__b12115102023612">DROP</strong> are not supported. The syntax for <strong id="EN-US_TOPIC_0000001145830623__b1132173115212">SET</strong> and <strong id="EN-US_TOPIC_0000001145830623__b165610350210">DROP</strong> operations is retained for later use.</p>
|
|
<ul id="EN-US_TOPIC_0000001145830623__u2ef47bfdf6f543b8a60cf548f091b858"><li id="EN-US_TOPIC_0000001145830623__le52d417fb28d4f12957e22bc1068ede0">Change the owner of an external server.</li></ul>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145830623__sa893e8c3e2374af18586fa3bba6c5ff3"><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">SERVER</span><span class="w"> </span><span class="k">server_name</span><span class="w"> </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><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001145830623__u9c94062a6c6745278717330fb88e4c2a"><li id="EN-US_TOPIC_0000001145830623__l2a43f3a4dbee4129a8c23b834afcdf51">Change the name of an external server.</li></ul>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145830623__screen36021438102815"><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">SERVER</span><span class="w"> </span><span class="k">server_name</span><span class="w"> </span>
|
|
<span class="w"> </span><span class="k">RENAME</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="n">new_name</span><span class="p">;</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001145830623__ul676294745017"><li id="EN-US_TOPIC_0000001145830623__li3762184745016">Refresh the HDFS configuration file. Only 8.0.0.10 and later versions (except 8.1.0) support this function.</li></ul>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145830623__sc37a8f9a4f70432d9de295f7390b1065"><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">SERVER</span><span class="w"> </span><span class="k">server_name</span><span class="w"> </span><span class="n">REFRESH</span><span class="w"> </span><span class="k">OPTIONS</span><span class="p">;</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145830623__s1b8152f180bd4017887a4144e5627a55"><h4 class="sectiontitle">Parameter Description</h4><p id="EN-US_TOPIC_0000001145830623__a34e65a0a37fd4bd7b7542151cd2717fe">The server parameters to be modified are as follows:</p>
|
|
<ul id="EN-US_TOPIC_0000001145830623__u7d156a1b2ed64f3090a90979db63878e"><li id="EN-US_TOPIC_0000001145830623__ldfeb3e6b07ad44048814c08cd972ceee"><strong id="EN-US_TOPIC_0000001145830623__a55326a1b934a44fb8de8879c7998a745">server_name</strong><p id="EN-US_TOPIC_0000001145830623__ad9c0c4ddfd9e4b3aac9d139dfffaa523">Specifies the name of the server to be modified.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__ld0357592e80549399033c88b68fdd6ee"><strong id="EN-US_TOPIC_0000001145830623__ad4593321425b4cb4ab881d28ce7b229b">new_version</strong><p id="EN-US_TOPIC_0000001145830623__a697b7f0829524a97bb40e6128c424edf">Specifies the new version of the server.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__lcfbcd71cab834731817b9d253acbdc84">The server parameters in <strong id="EN-US_TOPIC_0000001145830623__b3857907693316">OPTIONS</strong> are as follows:<ul id="EN-US_TOPIC_0000001145830623__u783735c1504e45b0ac1376a58843c652"><li id="EN-US_TOPIC_0000001145830623__lc43d379435d34041b58b38928e8c6f9d">address<p id="EN-US_TOPIC_0000001145830623__p186181017165115"><a name="EN-US_TOPIC_0000001145830623__lc43d379435d34041b58b38928e8c6f9d"></a><a name="lc43d379435d34041b58b38928e8c6f9d"></a>Specifies the endpoint of the OBS service.</p>
|
|
<p id="EN-US_TOPIC_0000001145830623__a3645c5e0810a4e1ab3392175d2f24980">Specifies the IP address and port number of the primary and standby nodes of the HDFS cluster.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001145830623__n103b48ea77494d88b71444923ff0f1ec"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001145830623__u187b5c6e07604803899272480284da27"><li id="EN-US_TOPIC_0000001145830623__l090a6b4e989944118698f32878d537d1"><strong id="EN-US_TOPIC_0000001145830623__b10123133512310">address</strong> is mandatory for HDFS servers. Therefore, <strong id="EN-US_TOPIC_0000001145830623__b31795010327">ADD</strong> and <strong id="EN-US_TOPIC_0000001145830623__b748835113214">DROP</strong> operations are not supported.</li><li id="EN-US_TOPIC_0000001145830623__le2a6e1ea74f74c4abc037e50e09a829c"><strong id="EN-US_TOPIC_0000001145830623__b12999163817319">address</strong> only supports IPv4 addresses in dot-decimal notation, and an address string cannot contain spaces. Groups of addresses are separated by commas (,). An IP address and a port number are separated by a colon (:). You are advised to configure two IP address and port pairs in an HDFS cluster. One is used as the socket address of the primary HDFS NameNode and the other is used as that of the secondary HDFS NameNode.</li><li id="EN-US_TOPIC_0000001145830623__li4118450105114">If the server type is DLI, the address is the OBS address stored on DLI.</li></ul>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__l9be0383a7184423caaac7d380c34d785">hdfscfgpath<p id="EN-US_TOPIC_0000001145830623__af0219076b8b949d19b90024dd561c137"><a name="EN-US_TOPIC_0000001145830623__l9be0383a7184423caaac7d380c34d785"></a><a name="l9be0383a7184423caaac7d380c34d785"></a>Specifies the HDFS cluster configuration file.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001145830623__n177965a448654e17903bdba29ac44b4c"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001145830623__u6e76b4b979f04093bbbf5c1f32421905"><li id="EN-US_TOPIC_0000001145830623__l43f34266817543ee86044578b8a49827">If HDFS is in security mode, <strong id="EN-US_TOPIC_0000001145830623__b842352706211942">hdfscfgpath</strong> is mandatory.</li><li id="EN-US_TOPIC_0000001145830623__l1c8afe238def4f42b145decee381f70c">If you set <strong id="EN-US_TOPIC_0000001145830623__b842352706211958">hdfscfgpath</strong>, you can only set one value for <strong id="EN-US_TOPIC_0000001145830623__b84235270621209">path</strong>.</li></ul>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__l33e7f685f0a34737845f588bd2f2cfbb">encrypt<p id="EN-US_TOPIC_0000001145830623__a121cea7ced384e8280f901b3bf64d2cc"><a name="EN-US_TOPIC_0000001145830623__l33e7f685f0a34737845f588bd2f2cfbb"></a><a name="l33e7f685f0a34737845f588bd2f2cfbb"></a>Specifies whether data is encrypted. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b768030577101022">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b880004859101022">OBS</strong>. The default value is <strong id="EN-US_TOPIC_0000001145830623__b20402142033115">off</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001145830623__a19b42b637b2d407682ddccfd47765519">Value range:</p>
|
|
<ul id="EN-US_TOPIC_0000001145830623__u974382f6abe24fc3871e4ce336e5ed4b"><li id="EN-US_TOPIC_0000001145830623__lf74746323fed452e8a529942ecf18518"><strong id="EN-US_TOPIC_0000001145830623__b842352706101041">on</strong> indicates that data is encrypted.</li><li id="EN-US_TOPIC_0000001145830623__l630127327ed7411f987c3732263ab06f"><strong id="EN-US_TOPIC_0000001145830623__b1378122922101054">off</strong> indicates that data is not encrypted.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__l7ae9bda1703147dfb7e44e9b9f8df66e">access_key<p id="EN-US_TOPIC_0000001145830623__a95954ff397d94b629d9769147fdd487b"><a name="EN-US_TOPIC_0000001145830623__l7ae9bda1703147dfb7e44e9b9f8df66e"></a><a name="l7ae9bda1703147dfb7e44e9b9f8df66e"></a>Indicates the access key (AK) (obtained by users from the OBS page) used for the OBS access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b84235270610957">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b84235270610100">OBS</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__l8170e3e223954869bbb3520bca9311ba">secret_access_key<p id="EN-US_TOPIC_0000001145830623__a5791fcd38caa429284254263100b931c"><a name="EN-US_TOPIC_0000001145830623__l8170e3e223954869bbb3520bca9311ba"></a><a name="l8170e3e223954869bbb3520bca9311ba"></a>Indicates the secret access key (SK) (obtained by users from the OBS page) used for the OBS access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b630426823">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b1060826628">OBS</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li42221130192714">dli_address<p id="EN-US_TOPIC_0000001145830623__p3453181672815"><a name="EN-US_TOPIC_0000001145830623__li42221130192714"></a><a name="li42221130192714"></a>Specifies the endpoint of the DLI service. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b1151216267214">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b1951919267211">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li7283184952718">dli_access_key<p id="EN-US_TOPIC_0000001145830623__p695605054612"><a name="EN-US_TOPIC_0000001145830623__li7283184952718"></a><a name="li7283184952718"></a>Specifies the AK (obtained by users from the DLI page) used for the DLI access protocol. When you create a foreign table, its AK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b4412548475">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b204135487712">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li203411759192713">dli_secret_access_key<p id="EN-US_TOPIC_0000001145830623__p91821055144612"><a name="EN-US_TOPIC_0000001145830623__li203411759192713"></a><a name="li203411759192713"></a>Specifies the SK (obtained by users from the DLI page) used for the DLI access protocol. When you create a foreign table, its SK value is encrypted and saved to the metadata table of the database. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b52777342087">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b1227811344815">DLI</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li3233218131814">region<p id="EN-US_TOPIC_0000001145830623__p1855512417182"><a name="EN-US_TOPIC_0000001145830623__li3233218131814"></a><a name="li3233218131814"></a>Indicates the IP address or domain name of the OBS server. This parameter is available only when <strong id="EN-US_TOPIC_0000001145830623__b604074516">type</strong> is <strong id="EN-US_TOPIC_0000001145830623__b592150611">OBS</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li9784195663110">dbname<p id="EN-US_TOPIC_0000001145830623__p1478635613113"><a name="EN-US_TOPIC_0000001145830623__li9784195663110"></a><a name="li9784195663110"></a>Specifies the database name of a remote cluster to be connected. This parameter is used for collaborative analysis.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li527995919316">username<p id="EN-US_TOPIC_0000001145830623__p1528045914315"><a name="EN-US_TOPIC_0000001145830623__li527995919316"></a><a name="li527995919316"></a>Specifies the username of a remote cluster to be connected. This parameter is used for collaborative analysis.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li36271617133215">password<p id="EN-US_TOPIC_0000001145830623__p7629141733216"><a name="EN-US_TOPIC_0000001145830623__li36271617133215"></a><a name="li36271617133215"></a>Specifies the user password of a remote cluster to be connected. This parameter is used for collaborative analysis.</p>
|
|
</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__l1710563070c944a29e71d5eb6fd3c0b7"><strong id="EN-US_TOPIC_0000001145830623__a521a585d67c44f4ca8ca07dfc2ff8414">new_owner</strong><p id="EN-US_TOPIC_0000001145830623__afaf944ddc3f840b79cdc3f57d0e71c4c">Specifies the new owner of the server. To change the owner, you must be the owner of the foreign server and a direct or indirect member of the new owner role, and must have the <strong id="EN-US_TOPIC_0000001145830623__b562661523915">USAGE</strong> permission on the encapsulator of the external server.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__lbc49eb73b17840bb900dd9389e5fdcb9"><strong id="EN-US_TOPIC_0000001145830623__aa7027d7ff368457aa7fde7f91a7bb292">new_name</strong><p id="EN-US_TOPIC_0000001145830623__p1612117414304">Specifies the new name of the server.</p>
|
|
</li><li id="EN-US_TOPIC_0000001145830623__li5606329173017"><strong id="EN-US_TOPIC_0000001145830623__b15888949161215">REFRESH OPTIONS</strong><p id="EN-US_TOPIC_0000001145830623__p9889152113149">Refreshes the HDFS configuration file. This command is executed when the configuration file is modified. If this command is not executed, an access error may be reported.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145830623__s003ca5cecdf641929d3d3bc402586b6d"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001145830623__p10591722171714">Change the current name to the IP address of the <strong id="EN-US_TOPIC_0000001145830623__b11132135112109">hdfs_server</strong> server.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001145830623__screen86061439131913">ALTER SERVER hdfs_server OPTIONS ( SET address '10.10.0.110:25000,10.10.0.120:25000');</pre>
|
|
<p id="EN-US_TOPIC_0000001145830623__p9591422151720">Change the current name to <strong id="EN-US_TOPIC_0000001145830623__b83291717161615">hdfscfgpath</strong> of the <strong id="EN-US_TOPIC_0000001145830623__b33301017161612">hdfs_server</strong> server.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001145830623__screen177981749121914">ALTER SERVER hdfs_server OPTIONS ( SET hdfscfgpath '/opt/bigdata/hadoop');</pre>
|
|
<p id="EN-US_TOPIC_0000001145830623__p115901122201714"></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145830623__s933fc7d4ffd04201b1fd7e01227f829b"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001145830623__p51914117451"><a href="dws_06_0175.html">CREATE SERVER</a> <a href="dws_06_0206.html">DROP SERVER</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>
|
|
|