forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
125 lines
28 KiB
HTML
125 lines
28 KiB
HTML
<a name="EN-US_TOPIC_0000001233883273"></a><a name="EN-US_TOPIC_0000001233883273"></a>
|
|
|
|
<h1 class="topictitle1">Exporting a Schema</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ad91f9ac05cc44255bf3e49ec7bca76d0">You can use gs_dump to export data and all object definitions of a schema from <span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text1427039232">GaussDB(DWS)</span>. You can export one or more specified schemas as needed. You can specify the information to be exported as follows:</p>
|
|
<ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ul15714195354211"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li14800333980">Export full information of a schema, including its data and object definitions.</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li197146539426">Export data of a schema, excluding its object definitions.</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li27141153114215">Export the object definitions of a schema, including the definitions of tables, stored procedures, and indexes.</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_s7f46096564a44806add6b57776d9ced5"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ol13282237570"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li13430193751416"><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_0000001233883273__en-us_topic_0000001145814737_li879775734918"><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_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_i2086742622120">Data Warehouse Service User Guide</em>.</span><p><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_li144081359105012"><span>Run the following commands to decompress the client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_screen173918175523"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_b2025583889759">cd <</strong><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_i18005909159759">Path_for_storing_the_client</em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_b9103889179759">></strong>
|
|
unzip <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_i10517201512535">dws_client_8.x.x_redhat_x64.zip</em></pre>
|
|
<p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_p14308192714355">Where,</p>
|
|
<ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_ul18555114323517"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_li155410439357"><<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_i20191440039759">Path_for_storing_the_client</em>>: Replace it with the actual path.</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_li9555114313356"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_li106321216523"><span>Run the following command to configure the GaussDB(DWS) client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_screen39549318531">source gsql_env.sh</pre>
|
|
<p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_en-us_topic_0000001145895053_s8fd77cb5c040479baaab9ae3f2ea8fa5">All things done.</pre>
|
|
</p></li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li52026572575"><span>Use gs_dump to run the following command to export the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b126822059152317">hr</strong> and <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b77405317241">public</strong> schemas.</span><p><pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_screen17872792583"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b4792184082714">gs_dump</strong><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i565165052710"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b365115501273"> </strong></em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b3653165012710">-W</strong><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i203391558276"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b143381455142715"> </strong>Password<strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b4339655122716"> </strong></em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b20345105572715"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b10345185516276">-U</strong></strong><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i15571132162812"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1657118282820"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b75715282816"> </strong></strong>jack </em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b05790252815">-f</strong> <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i144196742812"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1641914712816">/home//backup/MPPDB_schema_backup</em> </em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1422147102811">-p</strong><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1366941111284"> 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i7669101118283"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1349612451454"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text4496174519514"> -h 10.10.10.100</span></em> human_resource</em> </em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1567315117283">-n</strong> <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i041451512810"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1414101510288">hr</em></em><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b169151224112811"> -F</strong> <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i191312411282"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i191392412284">d</em> </em></pre>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_table1781122816253" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Common parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row10837281257"><th align="left" class="cellrowborder" valign="top" width="24.169999999999998%" id="mcps1.3.3.2.5.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p48382816258">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="44.16%" id="mcps1.3.3.2.5.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_p583122816257">Example Value</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row1483528152520"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p3830287252">-U</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p77891461586">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_0000001233883273__en-us_topic_0000001145814737_p1583152842510">-U jack</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row199295855317"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p89920588539">-W</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p69431335210">User password for database connection.</p>
|
|
<ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ul194074341627"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li640710341028">This parameter is not required for database administrators if the trust policy is used for authentication.</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li0407734425">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_0000001233883273__en-us_topic_0000001145814737_p1898043113581">-W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i71481735162012">Password</em></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row1823810139566"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p11238171316560">-f</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_p11238513175619">-f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i19874174519581"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i158581933132416">_</em>schema_backup</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row9411195215519"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p84119521250">-p</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_p341117521853">-p 8000</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row427719895012"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p338520273452">-h</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p12385172734513"><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1848400499855">Cluster address</em>: If a public network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b6875758029855">Public Network Address</strong> or <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b9010080539855">Public Network Domain Name</strong>. If a private network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b15185475369855">Private Network Address</strong> or <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b19181490149855">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_0000001233883273__en-us_topic_0000001145814737_p133852271452">-h 10.10.10.100</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row1362511481379"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p8782872280">dbname</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_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_0000001233883273__en-us_topic_0000001145814737_p12782147122820">human_resource</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row1280163131716"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p14801831178">-n</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p2391133813175">Names of schemas to be exported. Data of the specified schemas will also be exported.</p>
|
|
<ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ul11933635102416"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li16923182517191">Single schema: Enter <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b91657122274">-n</strong> <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i182341435112017">schemaname</em>.</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li1936143522412">Multiple schemas: Enter <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b18494124672720">-n</strong> <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i13494194622711">schemaname</em> for each schema.</li></ul>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.3 "><ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ul13923102591912"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li43221055172415">Single schema: <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b6969132518281">-n hr</strong></li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li23231055142419">Multiple schemas: <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b842964762813">-n hr -n public</strong></li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_row1885993510341"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.3.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p141711116303">-F</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.3.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p9417511183018">Format of exported files. The values of <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b39119144293">-F</strong> are as follows:</p>
|
|
<ul id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ul4489102813339"><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li19489102814336"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b5637717102912">p</strong>: plain text</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li1048922883311"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b84162012916">c</strong>: custom</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li4489428173313"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1559323122912">d</strong>: directory</li><li id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_li1248912863319"><strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1915762682911">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_0000001233883273__en-us_topic_0000001145814737_p4417181118302">-F d</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p158951329152915">For details about other parameters, see "gs_dump" in the <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i17313101952119">Tool </em><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i2321201992112"></em><em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i132211912215">Guide</em>.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_s3c7502b18ec940978b4d7170078f4b68"><h4 class="sectiontitle">Examples</h4><div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_aaac4b41686c54b32819257eb468ca987">Example 1: Use gs_dump to run the following command to export full information of the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b18678937142910">hr</strong> schema. The exported files are compressed and stored in text format.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_sd004e723338c40b5a1d32e71c4eb9b0f">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i18326195712013">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i550913543587"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i131871223259">_</em>schema_backup.sql -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i3909441161018"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text119091641161011"> -h 10.10.10.100</span></em> human_resource -n hr -Z 6 -F p
|
|
gs_dump[port=''][human_resource][2017-07-21 16:05:55]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2017-07-21 16:05:55]: total time: 2425 ms</pre>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p9576185517326">Example 2: Use gs_dump to run the following command to export data of the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b8851322173213">hr</strong> schema. The exported files are in .tar format.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_screen1357745583213">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i13207105918017">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i49609585584"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1788171792520">_</em>schema_data_backup.tar -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i5311523118"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text6311323118"> -h 10.10.10.100</span></em> human_resource -n hr -a -F t
|
|
gs_dump[port=''][human_resource][2018-11-14 15:07:16]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2018-11-14 15:07:16]: total time: 1865 ms</pre>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p1733124143319">Example 3: Use gs_dump to run the following command to export the definition of the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1867685223313">hr</strong> schema. The exported files are stored in a directory.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_screen1233649339">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i138923016114">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1623315105915"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i189761821142518">_</em>schema_def_backup -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i9194929145918"> -h 10.10.10.100 </em>human_resource -n hr -s -F d
|
|
gs_dump[port=''][human_resource][2018-11-14 15:11:34]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2018-11-14 15:11:34]: total time: 1652 ms</pre>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_a25146c8b919f47d7b3804089fbfe6c38">Example 4: Use gs_dump to run the following command to export the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b4128134312359">human_resource</strong> database excluding the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b322175812356">hr</strong> schema. The exported files are in a custom format.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_sec1b9ded2a8b442a8a501c43403f116d">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i11607172019">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i35731135593"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i187431266252">_</em>schema_backup.dmp -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i9847800121"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text68475081210"> -h 10.10.10.100</span></em> human_resource -N hr -F c
|
|
gs_dump[port=''][human_resource][2017-07-21 16:06:31]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2017-07-21 16:06:31]: total time: 2522 ms</pre>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_ad6c89ec17e474b67953dad49c814c316">Example 5: Use gs_dump to run the following command to export the object definitions of the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1495695519367">hr</strong> and <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1431259133620">public</strong> schemas, encrypt the exported files, and store them in .tar format.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_s179f559e72ca489ab013b7e41fd3ae4e">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i713919410115">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i558361812598"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i4357833142516">_</em>schema_backup1.tar -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i134459147128"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text11445121410126"> -h 10.10.10.100</span></em> human_resource -n hr -n public -s --with-encryption AES128 --with-key 1234567812345678 -F t
|
|
gs_dump[port=''][human_resource][2017-07-21 16:07:16]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2017-07-21 16:07:16]: total time: 2132 ms</pre>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_a07ce4c587b1745fe849758bdd350ae3a">Example 6: Use gs_dump to run the following command to export the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b169131749184017">human_resource</strong> database excluding the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1491434912401">hr</strong> and <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b18744181716416">public</strong> schemas. The exported files are in a custom format.<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_s0d68055250c84e739279384b265a7375">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i47265517118">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i21141625195920"></em>/backup/MPPDB<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i1594363818252">_</em>schema_backup2.dmp -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i18112436201218"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text91127366124"> -h 10.10.10.100</span></em> human_resource -N hr -N public -F c
|
|
gs_dump[port=''][human_resource][2017-07-21 16:07:55]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2017-07-21 16:07:55]: total time: 2296 ms</pre>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_p3669810193617">Example 7: Use gs_dump to run the following command to export all tables, including views, sequences, and foreign tables, in the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b1983155916415">public</strong> schema, and the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b167031765420">staffs</strong> table in the <strong id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_b970141813429">hr</strong> schema, including data and table definition. The exported files are in a custom format.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_screen78601524133613">gs_dump -W <em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i19327179113">password</em> -U jack -f /home/<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i3174183075914"></em>/backup/MPPDB_backup3.dmp -p 8000<em id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_i42720558126"><span id="EN-US_TOPIC_0000001233883273__en-us_topic_0000001145814737_text8272105510126"> -h 10.10.10.100</span></em> human_resource -t public.* -t hr.staffs -F c
|
|
gs_dump[port=''][human_resource][2018-12-13 09:40:24]: dump database human_resource successfully
|
|
gs_dump[port=''][human_resource][2018-12-13 09:40:24]: total time: 896 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>
|
|
|