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>
60 lines
12 KiB
HTML
60 lines
12 KiB
HTML
<a name="EN-US_TOPIC_0000001460561340"></a><a name="EN-US_TOPIC_0000001460561340"></a>
|
|
|
|
<h1 class="topictitle1">ALTER PUBLICATION</h1>
|
|
<div id="body0000001492593373"><div class="section" id="EN-US_TOPIC_0000001460561340__se300da7053554cb58cc5988526228ed0"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001460561340__ace403db5736840f08d3e8a83b362a1a0">Modifies the publication attributes.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460561340__s9264977dc26a4c7f8993cc31dd59c965"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001460561340__u376c43d0bff54635af4347cf838af540"><li id="EN-US_TOPIC_0000001460561340__li9232131220710">This statement is supported by clusters of version 8.2.0.100 or later.</li><li id="EN-US_TOPIC_0000001460561340__lea26b84d3a20447db1aacf011618c25d">This statement can be used by the owner of a publication and the system administrator only.</li><li id="EN-US_TOPIC_0000001460561340__li873035012187">To alter the publication owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the database.</li><li id="EN-US_TOPIC_0000001460561340__li10812313172315">In a publication with <strong id="EN-US_TOPIC_0000001460561340__b1423416494351">FOR ALL TABLES</strong>, the new publication owner must be the system administrator. </li><li id="EN-US_TOPIC_0000001460561340__lf37c72c968cb4a3ba5447daab11d3f76">An administrator can change the owner relationship of any publication.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460561340__sba7861b1289b443a9ce4f3f5c63c3b75"><h4 class="sectiontitle">Syntax</h4><ul id="EN-US_TOPIC_0000001460561340__u63e03f7051194d6b9b24114f6bfd0e47"><li id="EN-US_TOPIC_0000001460561340__l7019d52a46aa40e1b3a31c5d9df0e5f6">Adds objects to a publication.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__sa5e6878264054aee81e7ef940725639c"><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">PUBLICATION</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="k">ADD</span><span class="w"> </span><span class="n">publication_object</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__l902ad79032f1473387936d1fce0d5dcf">Deletes objects from a publication.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__sdff0b53455b348eeb414529c6a2fd172"><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">PUBLICATION</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="k">DROP</span><span class="w"> </span><span class="n">publication_object</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__l2328b9a023324c99b1527d5a98fbc657"><p id="EN-US_TOPIC_0000001460561340__p188561449142516"><a name="EN-US_TOPIC_0000001460561340__l2328b9a023324c99b1527d5a98fbc657"></a><a name="l2328b9a023324c99b1527d5a98fbc657"></a>Replaces the current object with a specified object.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__s5c5a8f5ff1464915bb8672748b9f2289"><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">PUBLICATION</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">publication_object</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__l22abade4313c4daf83f3e4f761ce0fbd">Sets publication parameters. Retains the previous values of the parameters that are not mentioned.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__s7eba3cc08b8b418286729d633112367b"><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">PUBLICATION</span><span class="w"> </span><span class="n">name</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">publication_parameter</span><span class="w"> </span><span class="p">[</span><span class="o">=</span><span class="w"> </span><span class="n">value</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>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__lc1ad4a77c809441fa995be048343b24c">Changes the publication owner.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__sc1e494c759e149868dde3be30d0b2e96"><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">PUBLICATION</span><span class="w"> </span><span class="n">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>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001460561340__ul174377201539"><li id="EN-US_TOPIC_0000001460561340__li1437192045311">Renames the publication.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460561340__screen1629214428263"><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">PUBLICATION</span><span class="w"> </span><span class="n">name</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>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</li></ul>
|
|
<p id="EN-US_TOPIC_0000001460561340__p11662172719480">The syntax of using <strong id="EN-US_TOPIC_0000001460561340__b44105018294">publication_object</strong> is as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen370754012485">TABLE table_name [, ...]
|
|
| ALL TABLES IN SCHEMA schema_name [, ... ]</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460561340__s4dd504151fa34b0cb75ad8ff975e1d7f"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001460561340__uce6e8b3a80854100ac72c9f9f04f6a45"><li id="EN-US_TOPIC_0000001460561340__l0871fc3385d54be98452e84435aafc75"><strong id="EN-US_TOPIC_0000001460561340__b719454373014">name</strong><p id="EN-US_TOPIC_0000001460561340__afa6218e04cc94a2895b3509333098086">Specifies the publication name you want to modify.</p>
|
|
<p id="EN-US_TOPIC_0000001460561340__a8d8ceee9db584d5199c9755947a557dd">Value range: A string. It must comply with the naming convention.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__lbba72815a2724c6498dafa4bcd22d783"><strong id="EN-US_TOPIC_0000001460561340__b14590989334">table_name</strong><p id="EN-US_TOPIC_0000001460561340__a122fdcf973bd44529167c04a00df1182">Specifies the name of an existing table.</p>
|
|
<p id="EN-US_TOPIC_0000001460561340__a80fc1590e09140f4a4d876f94a851010">Value range: A string. It must comply with the naming convention.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li178401415125318"><strong id="EN-US_TOPIC_0000001460561340__b384011535311">schema_name</strong><p id="EN-US_TOPIC_0000001460561340__p13840815105319">Specifies the name of an existing schema.</p>
|
|
<p id="EN-US_TOPIC_0000001460561340__p148401115145310">Value range: A string. It must comply with the naming convention.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li67663113140"><strong id="EN-US_TOPIC_0000001460561340__ae77fb773f36e46779f43ed6d31de5f99">SET ( publication_parameter [= value] [, ... ] )</strong><p id="EN-US_TOPIC_0000001460561340__p14768310141">Modifies the publication parameters initially set by <strong id="EN-US_TOPIC_0000001460561340__b919817218440">CREATE PUBLICATION</strong>. For details about the parameters, see <a href="dws_06_0285.html#EN-US_TOPIC_0000001460561352__li11304141792615">Parameter description</a> of CREATE PUBLICATION.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__l3eb8abf1d8294654a04e38315314a074"><strong id="EN-US_TOPIC_0000001460561340__a84f174c78574490897108924376f07e4">new_owner</strong><p id="EN-US_TOPIC_0000001460561340__a8ae31462851343808c6fbb253b2d485e">Specifies the new publication owner.</p>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__l802fd9fadd614d468574f699b75ba825"><strong id="EN-US_TOPIC_0000001460561340__a298348d8ef084dd3bbe59eee56637fc7">new_name</strong><p id="EN-US_TOPIC_0000001460561340__a83a4e8fde85742b2868c2721e5ae6d22">Specifies the new name of a publication.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460561340__s7d7b3396e68c4011b95c1e02a254a932"><h4 class="sectiontitle">Examples</h4><ul id="EN-US_TOPIC_0000001460561340__ul1180154311440"><li id="EN-US_TOPIC_0000001460561340__li2018014438442">Add a table to a publication.<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen109329124468">ALTER PUBLICATION mypublication ADD TABLE mydata2;</pre>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li855071011461">Deletes a schema from a publication.<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen114638164912">ALTER PUBLICATION mypublication DROP ALL TABLES IN SCHEMA myschema1;</pre>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li179227519469">Reset a publication object.<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen089243634915">ALTER PUBLICATION mypublication SET TABLE mydata2, ALL TABLES IN SCHEMA myschema2;</pre>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li123321140194820">Change the publication owner.<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen199962535010">ALTER PUBLICATION mypublication OWNER TO user1;</pre>
|
|
</li><li id="EN-US_TOPIC_0000001460561340__li49081321489">Change the publication name.<pre class="screen" id="EN-US_TOPIC_0000001460561340__screen1779024214501">ALTER PUBLICATION mypublication RENAME TO mypublication1;</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001460561340__s727775a9b4004b4dbef41d0d3a428719"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001460561340__a88a3942f38cc47dbb84fd5eeefe6c115"><a href="dws_06_0285.html">CREATE PUBLICATION</a>, <a href="dws_06_0286.html">DROP PUBLICATION</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>
|
|
|