forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
25 lines
4.9 KiB
HTML
25 lines
4.9 KiB
HTML
<a name="EN-US_TOPIC_0000001381889061"></a><a name="EN-US_TOPIC_0000001381889061"></a>
|
|
|
|
<h1 class="topictitle1">How Can I Clear and Reclaim the Storage Space?</h1>
|
|
<div id="body0000001381889061"><p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p49571797152259">After you delete data stored in GaussDB(DWS) data warehouses, dirty data may be generated possibly because the disk space is not released. This results in disk space waste and deteriorates snapshot creation and restoration performance. The following describes the impact on the system and subsequent operation to clear the disk space:</p>
|
|
<p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p1688913585448">Points worth mentioning during clearing and reclaiming storage space:</p>
|
|
<ul id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_ul54389787152820"><li id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li50583008152820">Unnecessary data needs to be deleted to release the storage space.</li><li id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li21773625152820">Frequent read and write operations may affect proper database use. Therefore, it is good practice to clear and reclaim the storage space when not in peak hours.</li><li id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li66326650155353">The data clearing time depends on the data stored in the database.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p179031664719">Perform the following steps to clear and reclaim the storage space:</p>
|
|
<ol id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_ol17359205144816"><li id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li183597516489">Connect to the database. For details, see section "Methods of Connecting to a Cluster" in the <em id="EN-US_TOPIC_0000001381889061__i5143129173216">Data Warehouse Service (DWS) User Guide</em>.</li><li id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li33599554815">Run the following command to clear and reclaim the storage space:<p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p23591258486"><a name="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_li33599554815"></a><a name="en-us_topic_0000001099136646_li33599554815"></a><b><span class="cmdname" id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_cmdname17483195513505">VACUUM FULL;</span></b></p>
|
|
<p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p935935124814">By default, tables the current user has the permission on are deleted. Other tables are skipped.</p>
|
|
<p id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_p1035985124819">The following information is displayed once the space is cleared:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_screen735920515480"><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">VACUUM</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_note153592554814"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001381889061__ul1852217814375"><li id="EN-US_TOPIC_0000001381889061__li7419151083716"><strong id="EN-US_TOPIC_0000001381889061__b2216048894132">VACUUM FULL</strong> reclaims all expired row space, however it requires an exclusive lock on each table being processed, and might take a long time to complete on large, distributed database tables. You are advised to do <strong id="EN-US_TOPIC_0000001381889061__b74199116794132">VACUUM FULL</strong> to specified tables. If you want to do <strong id="EN-US_TOPIC_0000001381889061__b141599405994132">VACUUM FULL</strong> to the entire database, you are advised to do it during database maintenance.</li><li id="EN-US_TOPIC_0000001381889061__li852214823720">The statistical information will be lost if you use the <strong id="EN-US_TOPIC_0000001381889061__b121522423594132">FULL</strong> parameter. To collect the statistics, add keyword <strong id="EN-US_TOPIC_0000001381889061__b10789732494132">ANALYZE</strong>, for example, <b><span class="cmdname" id="EN-US_TOPIC_0000001381889061__en-us_topic_0000001099136646_cmdname0689424135118">VACUUM FULL ANALYZE;</span></b>. For more information about <strong id="EN-US_TOPIC_0000001381889061__b81478155694132">VACUUM</strong>, see "SQL Reference > SQL Syntax > VACUUM" in the <i><cite id="EN-US_TOPIC_0000001381889061__cite39023222594132">Data Warehouse Service (DWS) Developer Guide</cite></i>.</li></ul>
|
|
</div></div>
|
|
</li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_03_0029.html">Cluster Management</a></div>
|
|
</div>
|
|
</div>
|
|
|