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>
316 lines
39 KiB
HTML
316 lines
39 KiB
HTML
<a name="EN-US_TOPIC_0000001510400897"></a><a name="EN-US_TOPIC_0000001510400897"></a>
|
|
|
|
<h1 class="topictitle1">Backup Control Functions</h1>
|
|
<div id="body32001227"><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a6fd05cf43b324559b1722eeacde9f810">Backup control functions help online backup.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section10289142324218"><h4 class="sectiontitle">pg_create_restore_point(name text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_aa42dd9aa1f5e4353861d28c6f1f8ad74">Description: Creates a named point for performing the restore operation (restricted to system administrators).</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_afdd125b250304cef8399cc89bbb1ad0c">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_acb73f60ea1794570bdedb3d560bea9c4">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b107026681994316">pg_create_restore_point</strong> creates a named transaction log record that can be used as a restoration target, and returns the corresponding transaction log location. The given name can then be used with <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b210360239694316">recovery_target_name</strong> to specify the point up to which restoration will proceed. Avoid creating multiple restoration points with the same name, since restoration will stop at the first one whose name matches the restoration target.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section20380193094318"><h4 class="sectiontitle">pg_current_xlog_location()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a43331ed17c3d4a4b8d4fea04457c58d9">Description: Obtains the write position of the current transaction log.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a2ec56da05b6f494f8b0ff5a32b704482">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_abdb54a148b734bc69268e68f91ee7e09">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b160765115694316">pg_current_xlog_location</strong> displays the write position of the current transaction log in the same format as those of the previous functions. Read-only operations do not require rights of the system administrator.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p197892449403">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen1160345713418"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_current_xlog_location</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_current_xlog_location</span>
|
|
<span class="c1">--------------------------</span>
|
|
<span class="w"> </span><span class="mi">0</span><span class="o">/</span><span class="mi">4310</span><span class="n">D5D8</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section195274815435"><h4 class="sectiontitle">pg_current_xlog_insert_location()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a43e39113e176446786574e520ffb39cb">Description: Obtains the insert position of the current transaction log.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a75e0e009222d439391db369c6fcea610">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a3e4a79118fa946ee84934de67c22cc43">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b183984508494316">pg_current_xlog_insert_location</strong> displays the insert position of the current transaction log. The insertion point is the logical end of the transaction log at any instant, while the write location is the end of what has been written out from the server's internal buffers. The write position is the end that can be detected externally from the server. This operation can be performed to archive only some of completed transaction log files. The insert position is mainly used for commissioning the server. Read-only operations do not require rights of the system administrator.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p859215516501">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen912091617514"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_current_xlog_insert_location</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_current_xlog_insert_location</span>
|
|
<span class="c1">---------------------------------</span>
|
|
<span class="w"> </span><span class="mi">0</span><span class="o">/</span><span class="mi">4316</span><span class="n">AD50</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section16157183564410"><h4 class="sectiontitle">pg_start_backup(label text [, fast boolean ])</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_afbf5e69f32164b0a849e77092cb1bcb3">Description: Starts executing online backup (restricted to system administrators or replication roles).</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a547609e1fe45437d9891fa6e3fca0c83">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_adc1560808c7d41b68fc33e4d8f51dd4a">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b128101217394316">pg_start_backup</strong> receives a user-defined backup label (usually the name of the position where the backup dump file is stored). This function writes a backup label file to the data directory of the database cluster and then returns the starting position of backed up transaction logs in text mode.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_s50eae18c25e04412a2083860b7f6dadb"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_start_backup</span><span class="p">(</span><span class="s1">'label_goes_here'</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">pg_start_backup</span>
|
|
<span class="c1">-----------------</span>
|
|
<span class="w"> </span><span class="mi">0</span><span class="o">/</span><span class="mi">3000020</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section1718585534414"><h4 class="sectiontitle">pg_stop_backup()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a3fa6a239d70e4864a3b347dd9d59bc95">Description: Completes online backup (restricted to system administrators or replication roles).</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a5762498ed4b7444dbdd56c343210fde9">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a44839471a1294fcf932fbdd1a4f5954b">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b88295056194316">pg_stop_backup</strong> deletes the label file created by <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b164327867094316">pg_start_backup</strong> and creates a backup history file in the transaction log archive area. The history file includes the label given to <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b102970057694316">pg_start_backup</strong>, the starting and ending transaction log locations for the backup, and the starting and ending times of the backup. The return value is the backup's ending transaction log location. After the ending position is calculated, the insert position of the current transaction log automatically goes ahead to the next transaction log file. This way, the ended transaction log file can be immediately archived so that backup is complete.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1370212125415">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen4888831135411"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_stop_backup</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_stop_backup</span>
|
|
<span class="c1">----------------</span>
|
|
<span class="w"> </span><span class="mi">0</span><span class="o">/</span><span class="mi">4401</span><span class="n">E610</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section6216535454"><h4 class="sectiontitle">pg_switch_xlog()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a5c16c2e3e6d04890882bcda4aa502b08">Description: Switches to a new transaction log file (restricted to system administrators).</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a319ee323815e40d99b5bc21fc0113d2e">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_ada2a9a1e5ec34933bbaeca6314205b81">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b141401407194316">pg_switch_xlog</strong> moves to the next transaction log file so that the current log file can be archived (if continuous archive is used). The return value is the ending transaction log location + 1 within the just-completed transaction log file. If there has been no transaction log activity since the last transaction log switchover, <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b53528948194316">pg_switch_xlog</strong> will do nothing but return the start location of the transaction log file currently in use.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p15872332185519">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen6867746185519"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_switch_xlog</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_switch_xlog</span>
|
|
<span class="c1">----------------</span>
|
|
<span class="w"> </span><span class="mi">0</span><span class="o">/</span><span class="mi">45017978</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section18457112984619"><h4 class="sectiontitle">pg_xlogfile_name(location text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_aafdebe38aa6544349177e70a85791762">Description: Converts the position string in a transaction log to a file name.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a9dc0e92f48a245aa868cd84b65f1072f">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a3231297a16e3499e9643da08704af6d9">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b160460372394316">pg_xlogfile_name</strong> extracts only the transaction log file name. If the given transaction log position is the transaction log file border, a transaction log file name will be returned for both the two functions. This is usually the desired behavior for managing transaction log archiving, since the preceding file is the last one that currently needs to be archived.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section58321457184613"><h4 class="sectiontitle">pg_xlogfile_name_offset(location text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a55ddabb032434706b9f68ceeba2153a5">Description: Converts the position string in a transaction log to a file name and returns the byte offset in the file.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a9c9e770e881c476a982d376163b7f535">Return type: text, integer</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a99c667f0e9a64641983dbcbf87bdb544">Note: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b89145290794316">pg_xlogfile_name_offset</strong> can extract transaction log file names and byte offsets from the returned results of the preceding functions. Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_sdff39299c2d142b79de3dbe6a3ec9a0c"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_xlogfile_name_offset</span><span class="p">(</span><span class="n">pg_stop_backup</span><span class="p">());</span>
|
|
<span class="n">NOTICE</span><span class="p">:</span><span class="w"> </span><span class="n">pg_stop_backup</span><span class="w"> </span><span class="n">cleanup</span><span class="w"> </span><span class="n">done</span><span class="p">,</span><span class="w"> </span><span class="n">waiting</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">required</span><span class="w"> </span><span class="n">WAL</span><span class="w"> </span><span class="n">segments</span><span class="w"> </span><span class="k">to</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">archived</span>
|
|
<span class="n">NOTICE</span><span class="p">:</span><span class="w"> </span><span class="n">pg_stop_backup</span><span class="w"> </span><span class="n">complete</span><span class="p">,</span><span class="w"> </span><span class="k">all</span><span class="w"> </span><span class="n">required</span><span class="w"> </span><span class="n">WAL</span><span class="w"> </span><span class="n">segments</span><span class="w"> </span><span class="n">have</span><span class="w"> </span><span class="n">been</span><span class="w"> </span><span class="n">archived</span>
|
|
<span class="w"> </span><span class="n">file_name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">file_offset</span><span class="w"> </span>
|
|
<span class="c1">--------------------------+-------------</span>
|
|
<span class="mi">000000010000000000000003</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">272</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section145801014104713"><h4 class="sectiontitle">pg_xlog_location_diff(location text, location text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_a5e59d8a450d84b26a741df11afe9a673">Description: <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b156665344994316">pg_xlog_location_diff</strong> calculates the difference in bytes between two transaction log locations.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_abf03b4aacfcb4299982e469ebafee3c6">Return type: numeric</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p19673950428">pg_cbm_tracked_location()</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1877918364817">Description: Queries for the LSN location parsed by CBM.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p35471354184817">Return type: text</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section153661549134712"><h4 class="sectiontitle">pg_cbm_get_merged_file(startLSNArg text, endLSNArg text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p07861161512">Description: Combines CBM files within the specified LSN range into one and returns the name of the combined file.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p14621105945018">Return type: text</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section121991556486"><h4 class="sectiontitle">pg_cbm_get_changed_block(startLSNArg text, endLSNArg text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p4766921449">Description: Combines CBM files within the specified LSN range into a table and return records of this table.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p595311233181">Return type: record</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p12957823121819">Note: The table columns include the start LSN, end LSN, tablespace OID, database OID, table relfilenode, table fork number, whether the table is deleted, whether the table is created, whether the table is truncated, number of pages in the truncated table, number of modified pages, and list of No. of modified pages.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section576192044819"><h4 class="sectiontitle">pg_cbm_recycle_file(slotName name, targetLSNArg text)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p5401348105512">Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. If <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b41821920594316">slotName</strong> is empty, <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b38741322694316">targetLSNArg</strong> is used as the recycling point. During backup and DR, you need to specify a slot name due to parallelism. Record the <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b164877107894316">targetLSNArg</strong> value of the task to the slot, traverse all backup slots, and find the smallest LSN as the recycling point.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1410112820551">Return type: text</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section132018328489"><h4 class="sectiontitle">pg_cbm_force_track(targetLSNArg text,timeOut int)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p2040213547229">Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p43092569222">Return type: text</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section9409164384817"><h4 class="sectiontitle">pg_enable_delay_ddl_recycle()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1455531364817">Description: Enables DDL delay and returns the Xlog position of the enabling point.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p35188195019">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p16511531548">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen845163511"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_enable_delay_ddl_recycle</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_enable_delay_ddl_recycle</span>
|
|
<span class="c1">-----------------------------</span>
|
|
<span class="w"> </span><span class="mi">00000000</span><span class="o">/</span><span class="mi">4607</span><span class="n">B250</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section52901155144819"><h4 class="sectiontitle">pg_disable_delay_ddl_recycle(barrierLSNArg text, isForce bool)</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p149285717483">Description: Disables DDL delay and returns the Xlog range where DDL delay takes effect.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p7443141114197">Return type: record</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section1888692314912"><h4 class="sectiontitle">pg_enable_delay_xlog_recycle()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p105951017151918">Description: Enables Xlog recycle delay.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1632451011505">Return type: void</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p77459271368">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen121511449769"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_enable_delay_xlog_recycle</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_enable_delay_xlog_recycle</span>
|
|
<span class="c1">------------------------------</span>
|
|
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section727493594915"><h4 class="sectiontitle">pg_disable_delay_xlog_recycle()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p131151650151919">Description: Disables Xlog recycle delay.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p11437164934920">Return type: void</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p14459174615222">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen736418588226"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_disable_delay_xlog_recycle</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pg_disable_delay_xlog_recycle</span>
|
|
<span class="c1">-------------------------------</span>
|
|
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section10289455019"><h4 class="sectiontitle">pgxc_get_senders_catchup_time()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p19949757133715">Description: Displays the catchup information of the currently active primary/standby instance sending thread on all DNs.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p119491357123720">Return type: record</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1094935717373">The following information is returned:</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_table594911571371" frame="border" border="1" rules="all"><caption><b>Table 1 </b>pgxc_get_senders_catchup_time() columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row5950175773715"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.19.5.2.4.1.1"><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p79501057153715">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.19.5.2.4.1.2"><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1095012576370">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.19.5.2.4.1.3"><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p295145783714">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row19511857193718"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p99516576379">node_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p10951125793714">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1795115783719">Node name</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row18951165710376"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p2095105714371">lwpid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p095185714378">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p12952135720379">Current sender lwpid</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row1595215578378"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p3952957103714">local_role</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1195275715373">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p195219571371">Local role</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row1295265719376"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p595275712378">peer_role</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p7952057163712">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p995245703714">Peer role</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row1953857103717"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1095335719370">state</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p495375743713">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p8953757163718">Current sender's replication status</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row4953157133717"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p18953857183714">sender</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p15953125743712">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p139531574379">Current sender type</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row995345753712"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p10953157173711">catchup_start</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p109541157123711">timestamp with time zone</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1495416570375">Startup time of a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row18954185733712"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1695465783718">catchup_end</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p895475713376">timestamp with time zone</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p895485713374">End time of a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row59541157153710"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p109541457113713">catchup_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p17954165763714">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p139551157113718">Catchup task type, full or incremental</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row189551757133715"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p10955165718379">catchup_bcm_filename</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p295565723710">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p39551657193714">BCM file executed by the current catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row1995518574376"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p129551857193715">catchup_bcm_finished</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p7955185711374">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p119577573377">Number of BCM files completed by a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row0957115773718"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1795715717376">catchup_bcm_total</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p13957125713378">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p8957135715379">Total number of BCM files to be operated by a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row6957195719375"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p16958657183714">catchup_percent</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p9958957183720">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1995813572376">Completion percentage of a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_row11958257193717"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p189588576372">catchup_remaining_time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p495819573373">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.19.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p19585574371">Estimated remaining time of a catchup task</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_section627775619215"><h4 class="sectiontitle">pgxc_lock_for_backup()</h4><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p07431739516">Description: Locks the cluster before backup. Backup is performed to restore data on new nodes.</p>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1874318391410">Return type: <span id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_text17885115472214">boolean</span></p>
|
|
<div class="note" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_note5743153914112"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p1774415391514"><strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b810262631112752">pgxc_lock_for_backup</strong> locks a cluster before <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b871134732112752">gs_dump</strong> or <strong id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_b1147731040112752">gs_dumpall</strong> is used to back up the cluster. After a cluster is locked, operations changing the system structure are not allowed. This function does not affect DML statements.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_p183631423133115">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510400897__en-us_topic_0000001495299517_screen7977142953415"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pgxc_lock_for_backup</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">pgxc_lock_for_backup</span>
|
|
<span class="c1">----------------------</span>
|
|
<span class="w"> </span><span class="n">t</span>
|
|
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0056.html">Backup and Restoration Control Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|