forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
173 lines
74 KiB
HTML
173 lines
74 KiB
HTML
<a name="EN-US_TOPIC_0000001188521068"></a><a name="EN-US_TOPIC_0000001188521068"></a>
|
|
|
|
<h1 class="topictitle1">gs_restore</h1>
|
|
<div id="body32001227"><div class="section" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sd90f00f1bbf64671814c8dba90e43d0b"><h4 class="sectiontitle">Context</h4><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a8a505b1ce23e4f29bdf9ab45da07de1f"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b088612312169">gs_restore</strong> is a tool provided by GaussDB(DWS) to import data that was exported using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1789293161618">gs_dump</strong>. It can also be used to import files that were exported using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b128201868168">gs_dump</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_acde4349838b84bf8b4933074024b0a04">It has the following functions:</p>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ud0208b47411043b988721f55da844a7f"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l58a4a96da8cd49febd9a2510bfdb3adb">Imports data to the database.<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0059777561_p96119481350"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l58a4a96da8cd49febd9a2510bfdb3adb"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l58a4a96da8cd49febd9a2510bfdb3adb"></a>If a database is specified, data is imported in the database. For parallel import, the password for connecting to the database is required.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0059777561_li13611481355">Imports data to the script file.<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0059777561_p126104863513"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0059777561_li13611481355"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0059777561_li13611481355"></a>If the database storing imported data is not specified, a script containing the SQL statement to recreate the database is created and written to a file or standard output. This script output is equivalent to the plain text output format of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270611515">gs_dump</strong>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sae25ed87af1f410a832bec52ed0b1d72"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s09b0baae9e4c4766a3b6bfb067b8506f">gs_restore [<em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a4d370bd8a9854535b853aff81aa9c4d0">OPTION</em>]... FILE</pre>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n20003028d50d451d979c2616610f4369"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_u99b140ad84344b3cabc1f94d413180a3"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l747c29531a2e4a6abbaf6981a5281295">The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b109151620473">FILE</strong> does not have a short or long parameter. It is used to specify the location for the archive files.</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l78dd4d2624ed4d4da834902907e46ad0">The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b730132622917">dbname</strong> or <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b163052620296">-l</strong> parameter is required as prerequisites. Users cannot enter <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b18220162174915">dbname</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1822010219496">-l</strong> parameters at the same time.</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ld43300be41a742799884ec69214e86b9"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b2022311322229">gs_restore</strong> incrementally imports data by default. To prevent data exception caused by multiple import jobs, use the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b992143113814">-e</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b15186145133812">-c</strong> parameters during the jobs. In this way, existing database objects in a target database are deleted before import; and errors during import will be ignored to proceed the import and the error information will be displayed after the import.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s8faa2db884ae4c86965162612a23552a"><h4 class="sectiontitle">Parameter Description</h4><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_acbecc14983484f8a8a37a40b73ba34ed">Common parameters:</p>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_u9effecc8734348fb9acfe1da3879b771"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l5d961e4dfd0040bc88f4a15e247a3c4d">-d, --dbname=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ae712e1e0855f4a19a9c7c6cfeaf139a3"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l5d961e4dfd0040bc88f4a15e247a3c4d"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l5d961e4dfd0040bc88f4a15e247a3c4d"></a>Connects to the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b73009519241">dbname</strong> database and imports data to the database.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc455271d8a0441edba515351e5f27630">-f, --file=FILENAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6f285546dfbf431e9dcedc62148636c1"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc455271d8a0441edba515351e5f27630"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc455271d8a0441edba515351e5f27630"></a>Specifies the output file for the generated script, or uses the output file in the list specified using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b158092031135018">-l</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ae2f2a0db5d8447aa85dd4b904f8f6b5a">The default is the standard output.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n7df101926287465c8c85c7abc7c52643"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a18ec1de15179452c99d39686f3ebc4ab"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b194982632912">-f</strong> cannot be used in conjunction with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b949102617297">-d</strong>.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56723063679f466582cfcefd639a7b16">-F, --format=c|d|t<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6aa31f5ced144842a1e19964db2b0ed9"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56723063679f466582cfcefd639a7b16"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56723063679f466582cfcefd639a7b16"></a>Specifies the format of the archive. The format does not need to be specified because the <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i4156500619114">gs_restore</em> determines the format automatically.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a0aa9d422d61f482f97f00db9b3d4054c">Value range:</p>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_u97fd55299966476dbc84033c6bd42500"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l3f8c3b158f3a4a32970b71b034438925"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706111514">c/custom</strong>: The archive form is the customized format in section 4.21-gs_dump.</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l64649ebb04a14413871709f1b1dc6a7f"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706111517">d/directory</strong>: The archive form is a directory archive format.</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l89fa193d2e7d440da9d0ffd2de1dda8c">t/tar: The archive form is a tar archive format.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6f24a58748334e79b5af28862cc24fd8">-l, --list<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aaba7013edd7447b88687b2c8b58c897a"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6f24a58748334e79b5af28862cc24fd8"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6f24a58748334e79b5af28862cc24fd8"></a>Lists the forms of the archive. The operation output can be used for the input of the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270611165">-L</strong> parameter. If filtering parameters, such as <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b195821141155015">-n</strong> or <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b0583184145011">-t</strong>, are used together with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b9583194175018">-l</strong>, they will restrict the listed items.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf5ca5bcbf71542e690fe73d8d8d05a6c">-v, --verbose<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a39d1a622450742548635cf5178fb35f3"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf5ca5bcbf71542e690fe73d8d8d05a6c"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf5ca5bcbf71542e690fe73d8d8d05a6c"></a>Specifies the verbose mode.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9c7ee7a2ac6544c2a3be8112e314e96a">-V, --version<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_affc477f130934121bee644f7f3b47c12"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9c7ee7a2ac6544c2a3be8112e314e96a"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9c7ee7a2ac6544c2a3be8112e314e96a"></a>Prints the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706111852">gs_restore</strong> version and exits.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc7dce2cee0f04dbfbe3d841d2c19f16d">-?, --help<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ad4d2431cf443424a8e43035333776bdb"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc7dce2cee0f04dbfbe3d841d2c19f16d"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lc7dce2cee0f04dbfbe3d841d2c19f16d"></a>Shows help information about the parameters of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270611191">gs_restore</strong> and exits.</p>
|
|
</li></ul>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab57d17f76b354c5793a262d54e1c352a">Import parameters</p>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_uc02e7a290997401cbfadbb1e42375fb3"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lefba1ce413dd420ca70921f4f41686fc">-a, -data-only<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a1677ca6b51684e1ab200f509af02965c"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lefba1ce413dd420ca70921f4f41686fc"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lefba1ce413dd420ca70921f4f41686fc"></a>Imports only the data, not the schema (data definition). <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1348712420174">gs_restore</strong> incrementally imports data.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8c3af9d2378f438dae6009277374686f">-c, --clean<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a10da9af940194fa5aaa16a12fdc6f8ec"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8c3af9d2378f438dae6009277374686f"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8c3af9d2378f438dae6009277374686f"></a>Cleans (deletes) existing database objects in the database to be restored before recreating them.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf47d5c7cfc1e4014b31e0ab0c8c0e1e1">-C, --create<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_acbaa51b852f74d0596c978d107276c28"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf47d5c7cfc1e4014b31e0ab0c8c0e1e1"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf47d5c7cfc1e4014b31e0ab0c8c0e1e1"></a>Creates the database before importing data to it. (When this parameter is used, the database named with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b418163184916">-d</strong> is used to issue the initial <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b218103164911">CREATE DATABASE</strong> command. All data is imported to the database that appears in the archive files.)</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lda86cccbc64349ad82f1f4bcd14982ec">-e, --exit-on-error<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a189c69f4822e46d4a0682a949ff9d5cf"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lda86cccbc64349ad82f1f4bcd14982ec"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lda86cccbc64349ad82f1f4bcd14982ec"></a>Exits if an error occurs when you send the SQL statement to the database. If you do not exit, the commands will still be sent and error information will be displayed when the import ends.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l11e00659199c431c84b98bd5c9ea2ae3">-I, --index=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a9973884f689a4f3fb64e5541c1743523"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l11e00659199c431c84b98bd5c9ea2ae3"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l11e00659199c431c84b98bd5c9ea2ae3"></a>Imports only the definition of the specified index. Multiple indexes can be imported. Enter <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i56586032181646">-I index</em> multiple times to import multiple indexes.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6fbea48c7b8742d0a83746a9a918245a">For example:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sa4409c6375624626af511d8b2c3663ea">gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a76a9e092e393418dbc45348458af0667">host_name</em> -p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a97d78183e5d94c38b689e990d88cafcb">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text11219179617">gaussdb</span> -I <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a8f3f84c17b954189833a4ff8e49a9153">Index1 </em>-I <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a94e9a9c6506e4f68b5d2a90ee38e0b19">Index2 backup/MPPDB_backup.tar</em></pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a59898fe856bf4ded9354beabfa11389c">In this example, <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i842352697195839">Index1</em> and <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i842352697195845">Index2</em> will be imported.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf698e865126a4b24b11267f10449a111">-j, --jobs=NUM<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a06fdbfadab76458ca5426f849a587b0f"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf698e865126a4b24b11267f10449a111"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf698e865126a4b24b11267f10449a111"></a>Specifies the number of concurrent, the most time-consuming jobs of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b36843604217">gs_restore</strong> (such as loading data, creating indexes, or creating constraints). This parameter can greatly reduce the time to import a large database to a server running on a multiprocessor machine.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a7386afbf4b3f475f86a8b6af0f732467">Each job is one process or one thread, depending on the OS; and uses a separate connection to the server.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a64eadf2f47cf4679b859040bd729cad2">The optimal value of this option depends on the hardware settings of the server, the client, the network, the number of CPU cores, and hard disk settings. It is recommended that the parameter be set to the number of CPU cores on the server. In addition, a larger value can also lead to faster import in many cases. However, an overly large value will lead to decreased performance because of thrashing.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a3c4c95127a704be7b51578aabc7ce691">This parameter supports custom-format archives only. The input file must be a regular file (not the pipe file). This parameter can be ignored when you select the script method rather than connect to a database server. In addition, multiple jobs cannot be used in conjunction with the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b559210011332">--single-transaction</strong> parameter.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l09a82905239e4b478f28894be79be0e2">-L, --use-list=FILENAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab1304d6dbd99436aa55f567d812aa776"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l09a82905239e4b478f28894be79be0e2"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l09a82905239e4b478f28894be79be0e2"></a>Imports only archive elements that are listed in <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b12627112317521">list-file</strong> and imports them in the order that they appear in the file. If filtering parameters, such as <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b53573645412">-n</strong> or <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b17357462541">-t</strong>, are used in conjunction with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b83571562542">-L</strong>, they will further limit the items to be imported.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a031f5811792e4b50b4bf97e87a3731b6"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270614021">list-file</strong> is normally created by editing the output of a previous <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1218574825414">-l</strong> parameter. File lines can be moved or removed, and can also be commented out by placing a semicolon (;) at the beginning of the row. An example is provided in this document.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_la06f8abcee1e49d59e793323ad47659b">-n, --schema=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_af19b46873d2544b384d65557c366c158"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_la06f8abcee1e49d59e793323ad47659b"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_la06f8abcee1e49d59e793323ad47659b"></a>Restores only objects that are listed in schemas.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a24268d31a6ca4cefa09c12febbd1e110">This parameter can be used in conjunction with the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b15475182210106">-t</strong> parameter to import a specific table.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ac767aa0a388d4f3496f71e74397a1352">Entering <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b8212122115347">-n </strong><em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i17743249346">schemaname</em> multiple times can import multiple schemas.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a12bcb9e610f14c069437b6c0c64c251c">For example:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sd13f7935547d4834afcff1064f6af7c6">gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a212571482378419fb4d45dab523f8edc">host_name </em>-p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_adec406cf33ff4a57be02257ec18be5f7">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text956715207312">gaussdb</span> -n <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a1be03ad2c6084cc3add8cf7271fde1fc">sch1 </em>-n <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_acd7a56d19a684964a54735e272c76172">sch2</em> <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a09c53637a94e4defb2ae689d8e7862da">backup/MPPDB_backup.tar</em></pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a165be66ad6ca4cfbbea88de7875dc58d">In this example, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b98831151171316">sch1</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b112114490136">sch2</strong> will be imported.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l3f5f96a158a4492cb9520c234b46aeca">-O, --no-owner<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a06936651b1a84b6a9b8f22d5d8da7d57"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l3f5f96a158a4492cb9520c234b46aeca"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l3f5f96a158a4492cb9520c234b46aeca"></a>Do not output commands to set ownership of objects to match the original database. By default, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706141020">gs_restore</strong> issues the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b7879047101713">ALTER OWNER</strong> or <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b188791947111720">SET SESSION AUTHORIZATION</strong> statement to set ownership of created schema elements. Unless the system administrator or the user who has all the objects in the script initially accesses the database. Otherwise, the statement will fail. Any user name can be used for the initial connection using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b012811263295">-O</strong>, and this user will own all the created objects.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l85947f9e12cf47299978bfb8a2f242b2">-P, --function=NAME(args)<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aa0ffa7cd577e40b685677bd485d04364"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l85947f9e12cf47299978bfb8a2f242b2"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l85947f9e12cf47299978bfb8a2f242b2"></a>Imports only listed functions. You need to correctly spell the function name and the parameter based on the contents of the dump file in which the function exists.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a625d49e2127e4466a8572e9352e709db">Entering <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b156571201529">-P</strong> alone means importing all function-name(args) functions in a file. Entering <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b76571207213">-P</strong> with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b565714020212">-n</strong> means importing the function-name(args) functions in a specified schema. Entering <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1165713012214">-P</strong> multiple times and using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b6657301523">-n</strong> once means that all imported functions are in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b7657901225">-n</strong> schema by default.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_af93886d3051c4e3396b428ba2f529f64">You can enter <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b41571164203">-n schema-name -P 'function-name(args)'</strong> multiple times to import functions in specified schemas.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aaaef1014597b44b298c4756bc0a65413">For example:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sa9fa3d9538a8476584e8e3bb81bb1ab1">./gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a735d48d5f1494aeaa5970b8e0fa442f7">host_name</em> -p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a89f81c96720d4450b126bb09d4257f4f">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text19031452143119">gaussdb</span> -n <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ac671feffec6a4223a9b283c9fbe31c74">test1</em> -P '<em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ace31e281afe14fb882ab0fd8b22db372">Func1(integer)</em>' -n <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a7f6cf94b54e94e1ab0158d4d2211fc5b">test2 </em>-P '<em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a7db57d8eb3244131918f11ff3014f21f">Func2(integer)</em>' <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a53f38df31ce940049fa37eabfe9989d0">backup/MPPDB_backup.tar</em></pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab3cc71b789594d6bb40cd482c83f12ee">In this example, both <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b152301648133117">Func1 (i integer)</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b133877369228">test1</strong> schema and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1940295217314">Func2 (j integer)</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1568384832214">test2</strong> schema will be imported.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9d4cc3bee6aa4024be2ee589b7275cd7">-s, --schema-only<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aafb5e6ec058b416c9860bf411811bbf4"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9d4cc3bee6aa4024be2ee589b7275cd7"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l9d4cc3bee6aa4024be2ee589b7275cd7"></a>Imports only schemas (data definitions), instead of data (table content). The current sequence value will not be imported.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lbee575e5862c4f3d9a8ee81d8c9b97bf">-S, --sysadmin=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aa9c54a7c7bf74e5885970eac312be799"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lbee575e5862c4f3d9a8ee81d8c9b97bf"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lbee575e5862c4f3d9a8ee81d8c9b97bf"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l45142154f9804e218d7bfc8619133849">-t, --table=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a3d1efcb545e84250a51259a4003f4e58"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l45142154f9804e218d7bfc8619133849"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l45142154f9804e218d7bfc8619133849"></a>Imports only listed table definitions or data, or both. This parameter can be used in conjunction with the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b626086163312">-n</strong> parameter to specify a table object in a schema. When <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270614296">-n</strong> is not entered, the default schema is PUBLIC. Entering <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b7987117143812">-n </strong><em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i12987111716380">schemaname</em><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b16221324173815"> -t </strong><em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_i192213243381">tablename</em> multiple times can import multiple tables in a specified schema.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_afa32df468dac4475824bcadeeb17d0ec">For example:</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab8ed4db25df84ebebf7f9e24f0875a2c">Import <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1434551410393">table1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b91662383920">PUBLIC</strong> schema.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s65389ea161d9402b8a920f1993b55042">gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6bb552d64fc740198f187f1962526b1f">host_name </em>-p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aa5c733cb98924872b4cedf7576b4a722">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text11742143883016">gaussdb</span> -t <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a8ecd814b317a4055975f13c36811c88b">table1 backup/MPPDB_backup.tar</em></pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a48fcdb4078d64e1cb626b26aff3904c3">Import <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706143237">test1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706143248">test1</strong> schema and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706143256">test2</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706154544">test2</strong> schema.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_safcff09703d34cb697b0b608a03ec193">gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a336cfbce97ae4b92a2fc67505982d6d2">host_name </em>-p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab43300e2b1a14b4dbca57bf7f0d6dffc">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text1347310307301">gaussdb</span> -n test1 -t test1 <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a88796f06f8e54468beb907e88c7034e2">-n test2 </em>-t test2 <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ad9d54d8be2c946af84476c3bc7a6543c">backup/MPPDB_backup.tar</em></pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a44fb7b0f3e0f4ce5ba1171478ac3945f">Import <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b146460211">table1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1654286668">PUBLIC</strong> schema and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b813715164">test1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706154552">test1</strong> schema.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s42958ebaca3c4b438e8b7f6d2faac1f1">gs_restore -h <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a7c1bbd451d364d3799e8060dfb8a08c5">host_name </em>-p <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a3edad00b1a1b46c399a00dcdd7dda478">port_number </em>-d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text866595517296">gaussdb</span> -n PUBLIC -t <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a2384d3f13e014eddb9daf002c56b43a5">table1 -n test1 </em>-t <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a8d2a93d6eb1b4536ac1f27bfa63f1a17">table1 backup/MPPDB_backup.tar</em></pre>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n9ec36c3698244f32aa2856b14499953d"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a2b07bd306f064d8a904f2b1c8d57f904"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706143449">-t</strong> does not support the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270614355">schema_name.table_name</strong> input format.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7365ecc25dcc44f9a65e9f643d967487">-T, --trigger=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_af1a643db6dcf4c9abdbfb8cb484bc6d0"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7365ecc25dcc44f9a65e9f643d967487"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7365ecc25dcc44f9a65e9f643d967487"></a>This parameter is reserved for extension.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l904e146c4a954d359ef87e16bd4bd456">-x, --no-privileges/--no-acl<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a8aa36e0db6774d3f915ab25f88b81348"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l904e146c4a954d359ef87e16bd4bd456"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l904e146c4a954d359ef87e16bd4bd456"></a>Prevents the import of access permissions (<strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1039018474246">GRANT</strong>/<strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1998334919248">REVOKE</strong> commands).</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf1db2b0d6c074a36900547093bac586e">-1, --single-transaction<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6f7566218e354c4a927fd649f12bbbe1"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf1db2b0d6c074a36900547093bac586e"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lf1db2b0d6c074a36900547093bac586e"></a>Executes import as a single transaction (that is, commands are wrapped in <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1474220616174">BEGIN</strong>/<strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1279018891713">COMMIT</strong>).</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab24776620bd540af8a3d699b401ae341">This parameter ensures that either all the commands are completed successfully or no application is changed. This parameter means <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706104858">--exit-on-error</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ld293e8c22e394d7a804a98fd6b3998ec">--disable-triggers<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a48259111d49f486092fa629c5bcb9c52"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ld293e8c22e394d7a804a98fd6b3998ec"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_ld293e8c22e394d7a804a98fd6b3998ec"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lfe0c9ff4c0304cd590382679531fda7f">--no-data-for-failed-tables<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_af5048beb76234adfaf82a8826a037f13"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lfe0c9ff4c0304cd590382679531fda7f"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lfe0c9ff4c0304cd590382679531fda7f"></a>By default, table data will be imported even if the statement to create a table fails (for example, the table already exists). Data in such table is skipped using this parameter. This operation is useful if the target database already contains the desired table contents.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a561da819357d49eb97c02186750cb483">This parameter takes effect only when you import data directly into a database, not when you output SQL scripts.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lb7aa0f1244bb42b19a113199bcccba57">--no-security-labels<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a0732a7e906144937aab4f764107d9a62"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_lb7aa0f1244bb42b19a113199bcccba57"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_lb7aa0f1244bb42b19a113199bcccba57"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2d76bd5149eb4d24a6ba80318df7ee1a">--no-tablespaces<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a5f1250c800ed472995e9f10fed547c61"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2d76bd5149eb4d24a6ba80318df7ee1a"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2d76bd5149eb4d24a6ba80318df7ee1a"></a>Does not issue commands to select tablespaces. If this parameter is used, all objects will be created during the import process no matter which tablespace is selected.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56ed5838ee76487dbfd86e93a08c6fa2">--section=SECTION<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a1b46ef14451041978d4f658f12b2ee9c"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56ed5838ee76487dbfd86e93a08c6fa2"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l56ed5838ee76487dbfd86e93a08c6fa2"></a>Imports the listed sections (such as pre-data, data, or post-data).</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2e50b5e25c8f4d379d3846a46ace0f64">--use-set-session-authorization<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a42007baf7e8e4025a61c7870efafa70d"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2e50b5e25c8f4d379d3846a46ace0f64"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l2e50b5e25c8f4d379d3846a46ace0f64"></a>Is used for plain-text backup.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a3557bbc4c2ef4b518dcea824b520175c">Outputs the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b152406267296">SET SESSION AUTHORIZATION</strong> statement instead of the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b20240526202919">ALTER OWNER</strong> statement to determine object ownership. This parameter makes dump more standards-compatible. If the records of objects in exported files are referenced, import may fail. Only administrators can use the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b24121956527">SET SESSION AUTHORIZATION</strong> statement to dump data, and the administrators must manually change and verify the passwords of exported files by referencing the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1241255610216">SET SESSION AUTHORIZATION</strong> statement before import. The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b2412756524">ALTER OWNER</strong> statement requires lower permissions.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l845296163d1d46c6b4d5a248461445cd">--with-key=KEY<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a5dfbd19425f84b48b2459ea322c8ecbe"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l845296163d1d46c6b4d5a248461445cd"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l845296163d1d46c6b4d5a248461445cd"></a>Specifies that the key length of AES128 must be 16 bytes.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n5439aee9c9be4f00bb7a5d829bd15311"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a1b85b1debabe47d1a8a5b71b7d2c6659">If the dump is encrypted, enter the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1724822613298">--with-key <keyname></strong> parameter in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706145135">gs_restore</strong> command. If it is not entered, you will receive an error message.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a5acb2e0be3b348f1b09978276994c0da">Enter the same key while entering the dump.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n9f652fa11c1e4bc2a6a03794e3a0b0a9"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_u6868c1b5e8864b76b0d33e78bf635aae"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6aa22941f12547eebdf1bd5fd16c7c0f">If any local additions need to be added to the template1 database during the installation, restore the output of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706145450">gs_restore</strong> into an empty database with caution. Otherwise, you are likely to obtain errors due to duplicate definitions of the added objects. To create an empty database without any local additions, copy data from template0 rather than template1. Example:</li></ul>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sfe43b6f4214c4d15a95d5c7ea487ba35">CREATE DATABASE foo WITH TEMPLATE template0;</pre>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_u7edcfe6ba2e347de8fc844606dbfb963"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l1bb2e3c91f1b49ec8779b17ceff1bdf0"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706145716">gs_restore</strong> cannot import large objects selectively. For example, it can only import the objects of a specified table. If an archive contains large objects, all large objects will be imported, or none of them will be restored if they are excluded by using <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1449451013719">-L</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1509121023719">-t</strong>, or other parameters.</li></ul>
|
|
</div></div>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_n5b0fa771560a462c87dad3d82f06221c"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ac40803e7857e418caf5171406d67f064">1. The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270615115">-d/--dbname</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270615132">-f/--file</strong> parameters do not coexist.</p>
|
|
<p class="text" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a38d26f765e114fd8bea5f15ea2793609">2. The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706114846">-s/--schema-only</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706114855">-a/--data-only</strong> parameters do not coexist.</p>
|
|
<p class="text" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a66cda8836def4de0a95c95df9249869a">3. The <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b446172599">-c/--clean</strong> and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b247929406">-a/--data-only</strong> parameters do not coexist.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a13d691c66cfe48f89e9827c5896acbf3">4. When <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270615410">--single-transaction</strong> is used, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270615355">-j/--jobs</strong> must be a single job.</p>
|
|
<p class="text" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_acf732fb49ac643b9a7ec1ec394b5a0d6">5. <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b84235270611541">--role</strong> must be used in conjunction with <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706115417">--rolepassword</strong>.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a5be314bd17604bf18525a6093a563a73">Connection parameters:</p>
|
|
<ul id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ub6b25f208a0c4e48be09ceb64743812b"><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8864cb07e5d84e089702cb0858431920">-h, --host=HOSTNAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a6e652d714d974100b56e1ce64b17d8ab"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8864cb07e5d84e089702cb0858431920"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8864cb07e5d84e089702cb0858431920"></a>Specifies the host name. If the value begins with a slash (/), it is used as the directory for the UNIX domain socket. The default value is taken from the <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_i19282726172918">PGHOST</em> environment variable. If it is not set, a UNIX domain socket connection is attempted.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a5d65d5f56827449181478f965450b884">This parameter is used only for defining names of the hosts outside a cluster. The names of the hosts inside the cluster must be 127.0.0.1.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8159eb1d19204c84a69eb4e1f3aa06a7">-p, --port=PORT<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab81b4b26e27946389e4157517a4b79a7"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8159eb1d19204c84a69eb4e1f3aa06a7"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l8159eb1d19204c84a69eb4e1f3aa06a7"></a>Specifies the TCP port listened to by the server or the local UNIX domain socket file name extension to ensure a correct connection. The default value is the <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_i11285162662915">PGPORT</em> environment variable.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4b011f2f36ec4ec08c8d743c6fa83f36">-U, --username=NAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ac2b0422b56a24f3593ceb7a475f5e26a"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4b011f2f36ec4ec08c8d743c6fa83f36"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4b011f2f36ec4ec08c8d743c6fa83f36"></a>Specifies the user name to connect to.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6a5cc35577b0472b9e0865533205a53a">-w, --no-password<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a63390132cb234118bf29b4c9cc6c457a"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6a5cc35577b0472b9e0865533205a53a"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l6a5cc35577b0472b9e0865533205a53a"></a>Never issue a password prompt. The connection attempt fails if the host requires password verification and the password is not provided in other ways. This parameter is useful in batch jobs and scripts in which no user password is required.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l19bc2ab1935b4786a9a9d239cc166189">-W, --password=PASSWORD<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a889eac79f21a49dbbc0a9a1c8ccf663e"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l19bc2ab1935b4786a9a9d239cc166189"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l19bc2ab1935b4786a9a9d239cc166189"></a>Specifies the user password to connect to. If the host uses the trust authentication policy, the administrator does not need to enter the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b8215144015546">-W</strong> parameter. If the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b10215124015542">-W</strong> parameter is not provided and you are not a system administrator, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706151913">gs_restore</strong> will ask you to enter a password.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4bfe7e4113a54f359ae09933cdbe9825">--role=ROLENAME<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a11c1bfa7aa6b4cb1a92c4be04fee9d66"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4bfe7e4113a54f359ae09933cdbe9825"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l4bfe7e4113a54f359ae09933cdbe9825"></a>Specifies a role name for the import operation. If this parameter is selected, the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b129333314554">SET ROLE</strong> statement will be issued after <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1723307134171117">gs_restore</strong> connects to the database. It is useful when the authenticated user (specified by <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b2793142312558">-U</strong>) lacks the permissions required by <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b842352706152159">gs_restore</strong>. This parameter allows the user to switch to a role with the required permissions. Some installations have a policy against logging in directly as the initial user. This parameter allows data to be imported without violating the policy.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7c9b58e988244880913dde20a047fa2e">--rolepassword=ROLEPASSWORD<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_abf537fe9889847b3b7b1b54da6a6ecfd"><a name="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7c9b58e988244880913dde20a047fa2e"></a><a name="en-us_topic_0000001233800645_en-us_topic_0000001098650542_l7c9b58e988244880913dde20a047fa2e"></a>Specifies the password of the specific role.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s2424bb7bb707409189663ccd41177e84"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a80fc3e8e9d5f4d0caaf4814db1441dcd">Special case: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b944114242434">gsql</strong> tool. Run the following commands to import the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b88126378115340">MPPDB_backup.sql</strong> file in the exported folder (in plain-text format) generated by <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b16714121617441">gs_dump/gs_dumpall</strong> to the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b132369281156"><span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text6314175713217">gaussdb</span></strong> database:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s76054715ebcb4addbee785b36e471e4f">gsql -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text1721455043215">gaussdb</span> -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text870614409318">8000</span> -W <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_i167111444172612">{password}</em> -f /home/omm/test/MPPDB_backup.sql
|
|
SET
|
|
SET
|
|
SET
|
|
SET
|
|
SET
|
|
ALTER TABLE
|
|
ALTER TABLE
|
|
ALTER TABLE
|
|
ALTER TABLE
|
|
ALTER TABLE
|
|
CREATE INDEX
|
|
CREATE INDEX
|
|
CREATE INDEX
|
|
SET
|
|
CREATE INDEX
|
|
REVOKE
|
|
REVOKE
|
|
GRANT
|
|
GRANT
|
|
total time: 30476 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a9ce50074009f4ec8ab979d20640f12ea"><strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b973515342568">gs_restore</strong> is used to import the files exported by <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1073593410563">gs_dump</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a3a8b33cc03654ea496ef05d269594d1d">Example 1: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b1189928048">gs_restore</strong> tool to import the exported <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b19731635247">MPPDB_backup.dmp</strong> file (in custom format) to the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1147195120159"><span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text8625194018339">gaussdb</span></strong> database.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s7a40ae42b5454248b88afc19bdfdbeb7">gs_restore -W <em id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_i192689011335">{password}</em> backup/MPPDB_backup.dmp -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text2220175716310">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text16981163373314">gaussdb</span>
|
|
gs_restore: restore operation successful
|
|
gs_restore: total time: 13053 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ab75f7615a4944a0c86a7564170d305cd">Example 2: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b124275121685">gs_restore</strong> tool to import the exported <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b164271212789">MPPDB_backup.tar</strong> file (in tar format) to the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1856341010166"><span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text13654162013346">gaussdb</span></strong> database.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s283cdcb4e9614c9da995f1c3e0959c8d">gs_restore backup/MPPDB_backup.tar -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text36056447438">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text1281350173312">gaussdb</span>
|
|
gs_restore[2017-07-21 19:16:26]: restore operation successful
|
|
gs_restore[2017-07-21 19:16:26]: total time: 21203 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_afc3bedbe9aae45b787fa3b5c329a931d">Example 3: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b19474123016813">gs_restore</strong> tool to import the exported <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b11474173010819">MPPDB_backup</strong> file (in directory format) to the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b9827172911612"><span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text1821316560337">gaussdb</span></strong> database.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s71ddfe423af54979b97b4fde5bec6c98">gs_restore backup/MPPDB_backup -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text157010158389">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text106943233415">gaussdb</span>
|
|
gs_restore[2017-07-21 19:16:26]: restore operation successful
|
|
gs_restore[2017-07-21 19:16:26]: total time: 21003 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ae882ab37095947b487dd9ea3846d643b">Example 4: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b135821829718">gs_restore</strong> tool and run the following commands to import the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b145823295117">MPPDB_backup.dmp</strong> file (in custom format). Specifically, import all the object definitions and data in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b3864195319112">PUBLIC</strong> schema. Existing objects are deleted from the target database before the import. If an existing object references to an object in another schema, you need to manually delete the referenced object first.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sf17331a5418643b781d2859ce3a0aac8">gs_restore backup/MPPDB_backup.dmp -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text13338366470">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text12646155010348">gaussdb</span> -e -c -n PUBLIC
|
|
gs_restore: [archiver (db)] Error while PROCESSING TOC:
|
|
gs_restore: [archiver (db)] Error from TOC entry 313; 1259 337399 TABLE table1 gaussdba
|
|
gs_restore: [archiver (db)] could not execute query: ERROR: cannot drop table table1 because other objects depend on it
|
|
DETAIL: view t1.v1 depends on table table1
|
|
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
|
Command was: DROP TABLE public.table1;</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a05735fcfadca4a23b21574759e6b80df">Manually delete the referenced object and create it again after the import is complete.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sb23d6f76378448bc942a072b4e6e6d7a">gs_restore backup/MPPDB_backup.dmp -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text7484144110478">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text189813364819">gaussdb</span> -e -c -n PUBLIC
|
|
gs_restore[2017-07-21 19:16:26]: restore operation successful
|
|
gs_restore[2017-07-21 19:16:26]: total time: 2203 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_a65f26eefd8d74d77bc262a38e42e346d">Example 5: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b441913511558">gs_restore</strong> tool and run the following commands to import the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b1041965111519">MPPDB_backup.dmp</strong> file (in custom format). Specifically, import only the definition of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b15856175765">table1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b7856195768">PUBLIC</strong> schema.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_s76647d9ee2fa47509521ec8d54d8499e">gs_restore backup/MPPDB_backup.dmp -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text16767648184717">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text139401144154810">gaussdb</span> -e -c -s -n PUBLIC -t table1
|
|
gs_restore[2017-07-21 19:16:26]: restore operation successful
|
|
gs_restore[2017-07-21 19:16:26]: total time: 21000 ms</pre>
|
|
<p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_ae695ad1feaf8486491ad1bb82719127f">Example 6: Execute the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b523510226611">gs_restore</strong> tool and run the following commands to import the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_b16235152210619">MPPDB_backup.dmp</strong> file (in custom format). Specifically, import only the data of <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b332163013610">table1</strong> in the <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_en-us_topic_0085032924_b13253018612">PUBLIC</strong> schema.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_seabd9a2a3ae344ca9acdfb906d54a0f0">gs_restore backup/MPPDB_backup.dmp -p <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text1885815537479">8000</span> -d <span id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_text41212039134814">gaussdb</span> -e -a -n PUBLIC -t table1
|
|
gs_restore[2017-07-21 19:16:26]: restore operation successful
|
|
gs_restore[2017-07-21 19:16:26]: total time: 20203 ms</pre>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_note1073616134160"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_p673691391610">When a cluster is created, the scheduler is started and some resources of the scheduler are created, including the schema scheduler where the tables of the scheduler are located, and the tables created when the scheduler is running, such as <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b11901194344410">bandwidth_history_table</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b199071643134416">cpu_template_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b890714312445">io_template_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b290774310449">mem_template_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b990794315442">scheduler_config</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b8907124384415">scheduler_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b89081943104419">task_history_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b59081438447">task_storage</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b6908243164410">vacuum_full_rslt</strong>, <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b189082043204415">function scheduler_workload_query_func</strong>, and <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1689691115010">pg_task</strong>. When <strong id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_b1883117710474">gs_restore</strong> is executed, the tables, schemas, and indexes of the scheduler are also restored. The scheduler is a resident process, and the new cluster automatically creates these objects. Therefore, an error message is displayed when gs_restore is executed, indicating that the objects of the scheduler exist. This error has no impact on normal cluster operations and can be ignored.</p>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_sd95ba4d324b34503a2b69193564e81a6"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188521068__en-us_topic_0000001233800645_en-us_topic_0000001098650542_aa0bea2c8054e4dff80e16b330ce9b944"><a href="dws_07_0101.html#EN-US_TOPIC_0000001188362608">gs_dump</a> and <a href="dws_07_0102.html#EN-US_TOPIC_0000001233922249">gs_dumpall</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_07_0100.html">Server Tool</a></div>
|
|
</div>
|
|
</div>
|
|
|