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>
128 lines
24 KiB
HTML
128 lines
24 KiB
HTML
<a name="EN-US_TOPIC_0000001233628587"></a><a name="EN-US_TOPIC_0000001233628587"></a>
|
|
|
|
<h1 class="topictitle1">ALTER DATABASE</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001233628587__s838d89a72a6f4d7d9c0f9e49f477329c"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001233628587__a64cec0174a7f4190a28d9ea601fabfc8">This command is used to modify the attributes of a database, including the database name, owner, maximum number of connections<span id="EN-US_TOPIC_0000001233628587__ph18473165319522">, and object isolation attribute</span>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233628587__sa23aa140f6fc4376b9d411fb5ddf5c19"><h4 class="sectiontitle">Important Notes</h4><ul id="EN-US_TOPIC_0000001233628587__ul887132913315"><li id="EN-US_TOPIC_0000001233628587__li104602311533">Only the owner of a database or a system administrator has the permission to run the <strong id="EN-US_TOPIC_0000001233628587__b67361845132817">ALTER DATABASE</strong> statement. Users other than system administrators may have the following permission constraints depending on the attributes to be modified:<ul id="EN-US_TOPIC_0000001233628587__ul014713351537"><li id="EN-US_TOPIC_0000001233628587__li188772914318">To modify the database name, you must have the CREATEDB permission.</li><li id="EN-US_TOPIC_0000001233628587__li68911291534">To modify a database owner, you must be a database owner and a member of the new owner, and have the <strong id="EN-US_TOPIC_0000001233628587__b2915103065418">CREATEDB</strong> permission.</li><li id="EN-US_TOPIC_0000001233628587__li15896291831">To change the default tablespace, you must be a database owner or a system administrator, and must have the <strong id="EN-US_TOPIC_0000001233628587__b08959487543">CREATE</strong> permission on the new tablespace. This syntax physically migrates tables and indexes in a default tablespace to a new tablespace. Note that tables and indexes outside the default tablespace are not affected.</li><li id="EN-US_TOPIC_0000001233628587__li2090129333">Only a database owner or a system administrator can modify GUC parameters for the database.</li><li id="EN-US_TOPIC_0000001233628587__li199018441317">Only database owners and system administrators can modify the object isolation attribute of a database.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__li959412388319">You are not allowed to rename a database in use. To rename it, connect to another database.</li><li id="EN-US_TOPIC_0000001233628587__li1836853934014">The compatibility mode of an existing database cannot be changed. It can only be specified during creation of the database. For details, see <a href="dws_06_0156.html">CREATE DATABASE</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233628587__s6c35b8923bb449a9a70a2abe4e4dff0a"><h4 class="sectiontitle">Syntax</h4><ul id="EN-US_TOPIC_0000001233628587__u7887814581494e7194af41b661fb32cd"><li id="EN-US_TOPIC_0000001233628587__lc88868471f494b04adfa724b799d8ac1">Modify the maximum number of connections of the database.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__s96352857e0e945e6a9e1ca25f70a8da2"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_name</span>
|
|
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">CONNECTION</span><span class="w"> </span><span class="k">LIMIT</span><span class="w"> </span><span class="n">connlimit</span><span class="w"> </span><span class="p">];</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lc0952a1a6688483f8aaa168525723bf2">Rename the database.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__sddb0fff79b064520bc93a920bd84ac28"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_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><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001233628587__note14577204919157"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233628587__p15577174919157">If the database contains OBS multi-temperature tables, the database name cannot be changed.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lda8cb0ca32654731b6b1fd9932e48d6b">Change the database owner.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__s1cf924f510a24ca5a539795a7e257643"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_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>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__l4c7791aa09fc4f11b8ed462136807123">Change the default tablespace of the database.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__s07373d7baefa44d785e3321d6fd60af6"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_name</span>
|
|
<span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">TABLESPACE</span><span class="w"> </span><span class="n">new_tablespace</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001233628587__note467417343812"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233628587__p667511323817">The current tablespaces cannot be changed to OBS tablespaces.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__l9d5e1ce7d62146f2a5a0adedde180773">Modify the session parameter value of the database.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__s1f881be614714462ab53d9ad797f7bcd"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_name</span>
|
|
<span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">configuration_parameter</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">DEFAULT</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="k">CURRENT</span><span class="w"> </span><span class="err">}</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lc4fe2d9b315e4b3bafee29e55ca68d9d">Reset the database configuration parameter.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__s4d52e42cdfb04f8d87107c8c93b35f95"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_name</span><span class="w"> </span><span class="k">RESET</span>
|
|
<span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">configuration_parameter</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">ALL</span><span class="w"> </span><span class="err">}</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001233628587__ul3682203511284"><li id="EN-US_TOPIC_0000001233628587__li142571039112815">Modify the object isolation attribute of a database.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen6258133919283"><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="k">DATABASE</span><span class="w"> </span><span class="n">database_name</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">ENABLE</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">DISABLE</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="n">PRIVATE</span><span class="w"> </span><span class="k">OBJECT</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001233628587__note1454715833215"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233628587__ul195511931922"><li id="EN-US_TOPIC_0000001233628587__li1255111311824">To modify the object isolation attribute of a database, the database must be connected. Otherwise, the modification will fail.</li><li id="EN-US_TOPIC_0000001233628587__li14551133111217">For a new database, the object isolation attribute is disabled by default. After this attribute is enabled, common users can view only the objects (such as tables, functions, views, and columns) that they have the permission to access. This attribute does not take effect for administrators. After this attribute is enabled, administrators can still view all database objects.</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0000001233628587__s4f953a5b708c40d6ba7643477e86c1af"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001233628587__u9a8ffe5ee34146a2b0c30dc785d383fb"><li id="EN-US_TOPIC_0000001233628587__le6fce7d14f044f9d87cdd4f294b95ffe"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a0b38a4a8d5724a5faf0063dfaf702bde">database_name</strong><p id="EN-US_TOPIC_0000001233628587__a196054efcea347288cebb27b7febd658">Specifies the name of the database whose attributes are to be modified.</p>
|
|
<p id="EN-US_TOPIC_0000001233628587__af5fa754be3f04e30b401c8ea17fe613f">Value range: a string. It must comply with the naming convention.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lfbc5546570464b74b12f535ccc6bfe28"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_ae694aee3ed974ee59ed0eccaa62e20af">connlimit</strong><p id="EN-US_TOPIC_0000001233628587__ae7985e1ee1784234990705ded038176b">Specifies the maximum number of concurrent connections that can be made to this database (excluding administrators' connections).</p>
|
|
<p id="EN-US_TOPIC_0000001233628587__a48f3d4b9ab204478961f2cd689142291">Value range: The value must be an integer, preferably between <strong id="EN-US_TOPIC_0000001233628587__b94416093793722">1</strong> and <strong id="EN-US_TOPIC_0000001233628587__b173696900593722">50</strong>. The default value <strong id="EN-US_TOPIC_0000001233628587__b3003958433642">-1</strong> indicates no restrictions.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__l62e488f89fa54a1ea22c358feb6e9820"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a92fdc429dc4b401fa06905881b461ccb">new_name</strong><p id="EN-US_TOPIC_0000001233628587__af3b7cff0f2294f4b8c69a5837b6c35e3">Specifies the new name of a database.</p>
|
|
<p id="EN-US_TOPIC_0000001233628587__ae2fa98fbf64a4b449b80dd211c1c3c17">Value range: a string. It must comply with the naming convention.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__l46a518098c2642cb8a3f09609b93f21c"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a562112f4891b45de8d430b1693ac7a43">new_owner</strong><p id="EN-US_TOPIC_0000001233628587__a35bc70d0d5424a4a8d36d57b149c95fc">Specifies the new owner of a database.</p>
|
|
<p id="EN-US_TOPIC_0000001233628587__a634fa77a048c435180553fd00c3efd0c">Value range: a string indicating a valid user name</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__l75b0332b8eec43d5af138c5e9f59b23d"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a187c9602051347fda59e72bab0356b42">configuration_parameter</strong><p id="EN-US_TOPIC_0000001233628587__aa1ef7e35bb92425e841ca7ec6e54f10c"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a920fa55cf6764b72a5e729e484aabacb">value</strong></p>
|
|
<p id="EN-US_TOPIC_0000001233628587__ab705c11fe9b548d2bc7ac5fd38e27e98">Sets a specified database session parameter. If the value is <strong id="EN-US_TOPIC_0000001233628587__b137183131233642">DEFAULT</strong> or <strong id="EN-US_TOPIC_0000001233628587__b209696552133642">RESET</strong>, the default setting is used in the new session. <strong id="EN-US_TOPIC_0000001233628587__b127943067733642">OFF</strong> closes the setting.</p>
|
|
<p id="EN-US_TOPIC_0000001233628587__a5777c8022de04a4dae680023296a9fd7">Value range: a string. It can be set to:</p>
|
|
<ul id="EN-US_TOPIC_0000001233628587__ua03acdbb60b54fe497e9c786b5859550"><li id="EN-US_TOPIC_0000001233628587__l9d5189145da44f4693cb505eb2cd1dc7">DEFAULT</li><li id="EN-US_TOPIC_0000001233628587__l0c769078ee4c46d8b6f7e8cd108e849d">OFF</li><li id="EN-US_TOPIC_0000001233628587__la884d0f020ed49ed8fd0759f952c8697">RESET</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lc1d9a12a20f447f1baac565055163b95"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a1cf4c642a3ac49d48fc92a299a85b634">FROM CURRENT</strong><p id="EN-US_TOPIC_0000001233628587__aa3cba12fe6404318a203c7688b8ab2d4">Sets the value based on the database connected to the current session.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__ld074fc7112ea4c8a9ef9f240fffffd2e"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a846a7bab96674628ba868752192431b3">RESET configuration_parameter</strong><p id="EN-US_TOPIC_0000001233628587__a1603cda6602e45f281f3fce63b6b6b92">Resets the specified database session parameter.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233628587__lf9ccc37c320a461c8d0e3ba31bc2358c"><strong id="EN-US_TOPIC_0000001233628587__en-us_topic_0059779247_a2ba0b409ab5640a493acb547dfbe1530">RESET ALL</strong><p id="EN-US_TOPIC_0000001233628587__af9e4d048fd86414d87715d1e9b8447ed">Resets all database session parameters.</p>
|
|
</li></ul>
|
|
<div class="note" id="EN-US_TOPIC_0000001233628587__nc186f6ca806541d7b99b13c94c5088b4"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233628587__u504aabff473f4d309847a07cbd02b055"><li id="EN-US_TOPIC_0000001233628587__l1eaf9d4f7e1348228cfd72bb597e4416">Modifies the default tablespace of a database by moving all the tables or indexes from the old tablespace to the new one. This operation does not affect the tables or indexes in other non-default tablespaces.</li><li id="EN-US_TOPIC_0000001233628587__la936ea9bf1c34ec6a20b6772976f5c49">The modified database session parameter values will take effect in the next session.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233628587__se78b7860c04f4abda702554fdd468666"><h4 class="sectiontitle">Example:</h4><p id="EN-US_TOPIC_0000001233628587__p207229476553">Create the example database <strong id="EN-US_TOPIC_0000001233628587__b116421627141518">testdb</strong> and user <strong id="EN-US_TOPIC_0000001233628587__b111111830131512">tom</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen108661611151616"><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">DATABASE</span><span class="w"> </span><span class="n">testdb</span><span class="w"> </span><span class="k">ENCODING</span><span class="w"> </span><span class="s1">'UTF8'</span><span class="w"> </span><span class="k">template</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">template0</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen2377133312315"><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">DROP</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="n">tom</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">tom</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_0000001233628587__p17161195617180">Set the maximum number of connections to database <strong id="EN-US_TOPIC_0000001233628587__b43316039533642">testdb</strong> to 10:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen171783510201"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb</span><span class="w"> </span><span class="k">CONNECTION</span><span class="w"> </span><span class="k">LIMIT</span><span class="o">=</span><span class="w"> </span><span class="mi">10</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233628587__p16163131714193">Change the database name from <strong id="EN-US_TOPIC_0000001233628587__b8639146101213">testdb</strong>to <strong id="EN-US_TOPIC_0000001233628587__b15334134381019">testdb_1</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen1946615720206"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb</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">testdb_1</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233628587__p3581103720194">Change the owner of database <strong id="EN-US_TOPIC_0000001233628587__b180168217033642">testdb_1</strong> to <strong id="EN-US_TOPIC_0000001233628587__b126659426433642">tom</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen1845142717213"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb_1</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">tom</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233628587__p872614413198">Set the tablespace of database <strong id="EN-US_TOPIC_0000001233628587__b27586622133642">music1</strong> to <strong id="EN-US_TOPIC_0000001233628587__b110637172533642">PG_DEFAULT</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen955244710211"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb_1</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">TABLESPACE</span><span class="w"> </span><span class="n">PG_DEFAULT</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233628587__p943917526193">Disable the default index scan on the <strong id="EN-US_TOPIC_0000001233628587__b169382982133642">testdb_1</strong> database.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen1772311052213"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb_1</span><span class="w"> </span><span class="k">SET</span><span class="w"> </span><span class="n">enable_indexscan</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="k">off</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233628587__p6815185920192">Reset parameter <strong id="EN-US_TOPIC_0000001233628587__b132866927233642">enable_indexscan</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233628587__screen143022041159"><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="k">DATABASE</span><span class="w"> </span><span class="n">testdb_1</span><span class="w"> </span><span class="k">RESET</span><span class="w"> </span><span class="n">enable_indexscan</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233628587__sd8ac9dafd2d643c0887457d080783501"><h4 class="sectiontitle">Links</h4><p id="EN-US_TOPIC_0000001233628587__afa580a5fb9e248148e23c72cc64e9d76"><a href="dws_06_0156.html">CREATE DATABASE</a>, <a href="dws_06_0189.html">DROP DATABASE</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>
|
|
|