doc-exports/docs/dws/dev/dws_04_0272.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
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>
2024-05-16 07:24:04 +00:00

116 lines
22 KiB
HTML

<a name="EN-US_TOPIC_0000001233761733"></a><a name="EN-US_TOPIC_0000001233761733"></a>
<h1 class="topictitle1">Exporting a Database</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p1931051294215">You can use gs_dump to export data and all object definitions of a database from <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text442585224">GaussDB(DWS)</span>. You can specify the information to be exported as follows:</p>
<ul id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ul15714195354211"><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li740619570296">Export full information of a database, including its data and all object definitions.<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p15610558112913"><a name="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li740619570296"></a><a name="en-us_topic_0000001145895053_li740619570296"></a>You can use the exported information to create a same database containing the same data as the current one.</p>
</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1465415368307">Export all object definitions of a database, including the definitions of the database, functions, schemas, tables, indexes, and stored procedures.<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p1740319375307"><a name="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1465415368307"></a><a name="en-us_topic_0000001145895053_li1465415368307"></a>You can use the exported object definitions to quickly create a same database as the current one, without data.</p>
</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1529317220333">Export data of a database.</li></ul>
<div class="section" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_s92dde18bfe374ae28e35a3c03e5b76db"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ol13282237570"><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li105843985219"><span>Prepare an ECS as the gsql client host. For details, see "Preparing an ECS as the gsql Client Host" in the Data Warehouse Service (DWS) User Guide.</span></li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li57820116171210"><span>Download the gsql client and use an SSH transfer tool (such as WinSCP) to upload it to the Linux server where gsql is to be installed. For details, see "Downloading the Client" in <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i2086742622120">Data Warehouse Service User Guide</em>.</span><p><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_adf760149a35140c48cf09071207cd279">The user who uploads the client must have the full control permission on the target directory on the host to which the client is uploaded.</p>
</p></li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li28159407171547"><span>Run the following commands to decompress the client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_screen173918175523"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b2025583889759">cd &lt;</strong><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i18005909159759">Path_for_storing_the_client</em><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b9103889179759">&gt;</strong>
unzip <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i10517201512535">dws_client_8.x.x_redhat_x64.zip</em></pre>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p14308192714355">Where,</p>
<ul id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ul18555114323517"><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li155410439357">&lt;<em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i20191440039759">Path_for_storing_the_client</em>&gt;: Replace it with the actual path.</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li9555114313356"><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i15053567519759">dws_client_8.1.x_redhat_x86.zip</em>: This is the client tool package of <span class="parmvalue" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_parmvalue1355249759759"><b>RedHat x86</b></span>. Replace it with the actual one.</li></ul>
</p></li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li15256751171613"><span>Run the following command to configure the GaussDB(DWS) client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_screen39549318531">source gsql_env.sh</pre>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_acba60d877148432faf5ecdf94dd7b73e">If the following information is displayed, the GaussDB(DWS) client is successfully configured:</p>
<pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_s8fd77cb5c040479baaab9ae3f2ea8fa5">All things done.</pre>
</p></li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li52026572575"><span>Use gs_dump to export data of the database <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b20533151491719"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text1392551118542">gaussdb</span></strong>.</span><p><pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_screen17872792583"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b1087317945814">gs_dump -W</strong> <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i8226911215">password</em> <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b62951262912">-U</strong> <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i2891135451513">jack</em> <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b1887519955819">-f</strong> <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i118761096588">/home//backup/<em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i1380354113212">postgres</em>_backup.tar</em> <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b18877139185814">-p 8000</strong> <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text3576204517920">gaussdb</span> <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i10117317556"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text1663617501313"> -h 10.10.10.100</span></em> <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b98811590585">-F</strong> <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i188191255162">t</em><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i1988139175813"> </em></pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_table1781122816253" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Common parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row10837281257"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.5.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p48382816258">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.33%" id="mcps1.3.3.2.5.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p18332812257">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.669999999999998%" id="mcps1.3.3.2.5.2.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p583122816257">Example Value</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row1483528152520"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p3830287252">-U</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p8232111218592">Username for connecting to the database. If this parameter is not configured, the username of the connected database is used.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p1583152842510">-U jack</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row199295855317"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p89920588539">-W</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p69431335210">User password for database connection.</p>
<ul id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ul194074341627"><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1888214014819">This parameter is not required for database administrators if the trust policy is used for authentication.</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1884150888">If you connect to the database without specifying this parameter and you are not a database administrator, you will be prompted to enter the password.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p1898043113581">-W <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i1568374210564">Password</em></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row1823810139566"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p11238171316560">-f</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p323861311565">Folder to store exported files. If this parameter is not specified, the exported files are stored in the standard output.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p11238513175619">-f /home//backup/<em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i522734715214">postgres</em>_backup.tar</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row9411195215519"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p84119521250">-p</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p14838631464">Name extension of the TCP port on which the server is listening or the local Unix domain socket. This parameter is configured to ensure connections.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p341117521853">-p 8000</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row138462754518"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p338520273452">-h</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p12385172734513"><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i637612016163">Cluster address</em>: If a public network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b153837011619">Public Network Address</strong> or <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b13843019161">Public Network Domain Name</strong>. If a private network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b53856013166">Private Network Address</strong> or <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b18386609163">Private Network Domain Name</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p133852271452">-h 10.10.10.100</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row1362511481379"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p8782872280">dbname</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p1278211752814">Name of the database to be exported.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p12782147122820"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text10512122134811">gaussdb</span></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_row1885993510341"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p141711116303">-F</p>
</td>
<td class="cellrowborder" valign="top" width="43.33%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p9417511183018">Format of exported files. The values of <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b115211549921">-F</strong> are as follows:</p>
<ul id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ul4489102813339"><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li19489102814336"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b729155912219">p</strong>: plain text</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1048922883311"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b4892090312">c</strong>: custom</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li4489428173313"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b62823271331">d</strong>: directory</li><li id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_li1248912863319"><strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b1879419575313">t</strong>: .tar</li></ul>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p4417181118302">-F t</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p158951329152915">For details about other parameters, see "gs_dump" in the <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i62669161411">Tool </em><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i20264918145"></em><em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i326693148">Guide</em>.</p>
</p></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_s57c0883a3628476f9664e81b377891a2"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_ac96fd55118a448499b13a953cbe0546c">Example 1: Use gs_dump to run the following command to export full information of the database <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b29081739121812"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text9882205124219">gaussdb</span></strong> and compress the exported files in SQL format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_s4d215209bbae497792a36ab4582784a0">gs_dump -W <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i1051716401124">password</em> -U jack -f /home//backup/postgres_backup.sql -p 8000 <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i1349612451454"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text4496174519514"> -h 10.10.10.100</span></em> <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text116841211425">gaussdb</span> -Z 8 -F p
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text2723263810">gaussdb</span>][2017-07-21 15:36:13]: dump database <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text1444117119914">gaussdb</span> successfully
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text1323110201289">gaussdb</span>][2017-07-21 15:36:13]: total time: 3793 ms</pre>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_p198769119436">Example 2: Use gs_dump to run the following command to export data of the database <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b918117102195"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text664065634112">gaussdb</span></strong>, excluding object definitions. The exported files are in a custom format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_screen687671124317">gs_dump -W <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i13479220035">Password</em> -U jack -f /home//backup/postgres_data_backup.dmp -p 8000<em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i159161051716"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text39161551474"> -h 10.10.10.100</span></em> <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text3452215184218">gaussdb</span> -a -F c
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text173841319816">gaussdb</span>][2017-07-21 15:36:13]: dump database <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text96341019191">gaussdb</span> successfully
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text28402814813">gaussdb</span>][2017-07-21 15:36:13]: total time: 3793 ms</pre>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_aeddb69d8290043b0be4b22ef4bc99c82">Example 3: Use gs_dump to run the following command to export object definitions of the database <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b12444536171916"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text13117021134210">gaussdb</span></strong>. The exported files are in SQL format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_s5c86d09a65bd49bda147db44dfdf2efe">--Before the export, the <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b42161241795">nation</strong> table contains data.
<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text538200164617"></span>select n_nationkey,n_name,n_regionkey from nation limit 3;
n_nationkey | n_name | n_regionkey
-------------+---------------------------+-------------
0 | ALGERIA | 0
3 | CANADA | 1
11 | IRAQ | 4
(3 rows)
gs_dump -W <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i347320429214">password</em> -U jack -f /home//backup/postgres_def_backup.sql -p 8000<em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i179133115815"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text11913711387"> -h 10.10.10.100</span></em> <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text19228153111424">gaussdb</span> -s -F p
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text91831321465">gaussdb</span>][2017-07-20 15:04:14]: dump database <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text1743119581287">gaussdb</span> successfully
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text269019441718">gaussdb</span>][2017-07-20 15:04:14]: total time: 472 ms</pre>
<p id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_aa1826fa22f294d81978def324cdf982d">Example 4: Use gs_dump to run the following command to export object definitions of the database <strong id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_b187246125201"><span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text4631125713548">gaussdb</span></strong>. The exported files are in text format and are encrypted.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_screen6788112242">gs_dump -W <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i37261741507">password</em> -U jack -f /home//backup/postgres_def_backup.sql -p 8000 <em id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_i594952693316">-h 10.10.10.100</em> <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text773211376422">gaussdb</span> --with-encryption AES128 --with-key 1234567812345678 -s -F p
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text649445120719">gaussdb</span>][2018-11-14 11:25:18]: dump database <span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text205001504815">gaussdb</span> successfully
gs_dump[port=''][<span id="EN-US_TOPIC_0000001233761733__en-us_topic_0000001145895053_text14188591171">gaussdb</span>][2018-11-14 11:25:18]: total time: 1161 ms</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0271.html">Exporting a Single Database</a></div>
</div>
</div>