doc-exports/docs/dws/dev/dws_04_0278.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

121 lines
25 KiB
HTML

<a name="EN-US_TOPIC_0000001233681793"></a><a name="EN-US_TOPIC_0000001233681793"></a>
<h1 class="topictitle1">Data Export By a User Without Required Permissions</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_acd001ac06a1c46c0b93de4bccbf083a2">gs_dump and gs_dumpall use <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b132471439121820">-U</strong> to specify the user that performs the export. If the specified user does not have the required permission, data cannot be exported. In this case, you can set <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b85771741352">--role</strong> in the export command to the role that has the permission. Then, gs_dump or gs_dumpall uses the specified role to export data.</p>
<div class="section" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_sf65779fa4bc44c49a7f7382348571537"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_ol351612816711"><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li6104335165311"><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_0000001233681793__en-us_topic_0000001145894743_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_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_i2086742622120">Data Warehouse Service User Guide</em>.</span><p><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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_0000001233681793__en-us_topic_0000001145894743_li144081359105012"><span>Run the following commands to decompress the client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_screen173918175523"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_b2025583889759">cd &lt;</strong><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_i18005909159759">Path_for_storing_the_client</em><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_b9103889179759">&gt;</strong>
unzip <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_i10517201512535">dws_client_8.x.x_redhat_x64.zip</em></pre>
<p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_p14308192714355">Where,</p>
<ul id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_ul18555114323517"><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_li155410439357">&lt;<em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_i20191440039759">Path_for_storing_the_client</em>&gt;: Replace it with the actual path.</li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_li9555114313356"><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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_0000001233681793__en-us_topic_0000001145894743_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_0000001233681793__en-us_topic_0000001145894743_li106321216523"><span>Run the following command to configure the GaussDB(DWS) client:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_screen39549318531">source gsql_env.sh</pre>
<p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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_0000001233681793__en-us_topic_0000001145894743_en-us_topic_0000001145895053_s8fd77cb5c040479baaab9ae3f2ea8fa5">All things done.</pre>
</p></li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li209651354201918"><span>Use gs_dump to export data of the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b174161165190">human_resource</strong> database.</span><p><div class="p" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p996325414197">User <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b58071034141910">jack</strong> does not have the permission for exporting data of the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b17909152912017">human_resource</strong> database and the role <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b188081634181910">role1</strong> has this permission. To export data of the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b25611616182114">human_resource</strong> database, you can set <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b12810193420191">--role</strong> to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b7812634101918">role1</strong> in the export command. The exported files are in .tar format.<pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_screen17872792583"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b430611314815">gs_dump -U</strong> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i11654195662010">jack</em> <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b83065312810">-W</strong> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i8634118155612">password</em> <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b143081031816">-f</strong> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i173081733820">/home//backup/MPPDB_backup.tar</em> <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b33081131588">-p</strong> <span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text1784115011207">8000</span><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1366941111284"><span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text4496174519514"> -h 10.10.10.100</span></em> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i10308133580">human_resource</em> <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b03091835811">--role</strong> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i530923584">role1</em> <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b7309337813">--rolepassword</strong> <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i15511142018225">password </em><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b8309131886"><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i2031003487">-F</em></strong><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i183101537811"> t</em></pre>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_table1781122816253" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Common parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row10837281257"><th align="left" class="cellrowborder" valign="top" width="24.169999999999998%" id="mcps1.3.2.2.5.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p48382816258">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.16%" id="mcps1.3.2.2.5.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p18332812257">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.669999999999998%" id="mcps1.3.2.2.5.2.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p583122816257">Example Value (<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text1812844342020">dbadmin</span>)</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1483528152520"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p3830287252">-U</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p8232111218592">Username for database connection.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p1583152842510">-U jack</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row199295855317"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p89920588539">-W</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p69431335210">User password for database connection.</p>
<ul id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_ul194074341627"><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li640710341028">This parameter is not required for database administrators if the trust policy is used for authentication.</li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p735171411618">-W <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1530458173620">Password</em></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1823810139566"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p11238171316560">-f</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p11238513175619">-f /home//backup/MPPDB_backup.tar</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row9411195215519"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p84119521250">-p</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_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.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p341117521853">-p <span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text10242121922217">8000</span></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row19545132318261"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p338520273452">-h</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p12385172734513"><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i126470572891045">Cluster address</em>: If a public network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b195066318291045">Public Network Address</strong> or <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b161699062691045">Public Network Domain Name</strong>. If a private network address is used for connection, set this parameter to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b188912445291045">Private Network Address</strong> or <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b87623509591045">Private Network Domain Name</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p133852271452">-h 10.10.10.100</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1362511481379"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p8782872280">dbname</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p1278211752814">Name of the database to be exported.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p12782147122820">human_resource</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1280163131716"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p14801831178">--role</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p8618101717583">Role name for the export operation. After this parameter is set and gs_dump or gs_dumpall connects to the database, the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b17840134562617">SET ROLE</strong> command will be issued. When the user specified by <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1669095572714">-U</strong> does not have the permissions required by gs_dump or gs_dumpall, this parameter allows the user to switch to a role with the required permissions.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p66581345155917">-r role1</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1899681910160"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p18625164815715">--rolepassword</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p1962511481717">Role password.</p>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p1662514481776">--rolepassword password</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_row1885993510341"><td class="cellrowborder" valign="top" width="24.169999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p141711116303">-F</p>
</td>
<td class="cellrowborder" valign="top" width="44.16%" headers="mcps1.3.2.2.5.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p9417511183018">Format of exported files. The values of <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b249973517304">-F</strong> are as follows:</p>
<ul id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_ul4489102813339"><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li19489102814336"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b4293193923014">p</strong>: plain text</li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li1048922883311"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b3304124215303">c</strong>: custom</li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li4489428173313"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b161841545123015">d</strong>: directory</li><li id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_li1248912863319"><strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b11762104743013">t</strong>: .tar</li></ul>
</td>
<td class="cellrowborder" valign="top" width="31.669999999999998%" headers="mcps1.3.2.2.5.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p4417181118302">-F t</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p158951329152915">For details about other parameters, see "gs_dump" or "gs_dumpall" in the <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i93631835174416">Tool Guide</em>.</p>
</p></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_s684215f21ae149bf99602d5cc15f6bb5"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_a51f87a8dc3434c14a9a56ee06ea9129c">Example 1: User <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b618117158417">jack</strong> does not have the permission for exporting data of the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b18181161511417">human_resource</strong> database and the role <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b818191514418">role1</strong> has this permission. To export data of the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1718141534117">human_resource</strong> database, you can set <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b16182171584112">--role</strong> to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b20182715194117">role1</strong> in the export command. The exported files are in .tar format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_s44c5dcee41c2458fa644521024d5c0ec">human_resource=# CREATE USER jack IDENTIFIED BY "<em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i473817536119">password</em>";
gs_dump -U jack -W <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1376518541811">password</em> -f /home//backup/MPPDB_backup11.tar -p <span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text1520522422214">8000</span><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i15532348162514"><span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text6532134802518"> -h 10.10.10.100</span></em> human_resource --role role1 --rolepassword <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i97717559118">password</em> -F t
gs_dump[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text1036472713221">8000</span>'][human_resource][2017-07-21 16:21:10]: dump database human_resource successfully
gs_dump[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text12920162922216">8000</span>'][human_resource][2017-07-21 16:21:10]: total time: 4239 ms</pre>
<p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p183101487566">Example 2: User <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b62945534379">jack</strong> does not have the permission for exporting the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1629515313373">public</strong> schema and the role <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1429814533377">role1</strong> has this permission. To export the <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b117261649113916">public</strong> schema, you can set <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b930085393719">--role</strong> to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b4301155383714">role1</strong> in the export command. The exported files are in .tar format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_screen131258155614">human_resource=# CREATE USER jack IDENTIFIED BY "1234@abc";
gs_dump -U jack -W <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i590815567110">password</em> -f /home//backup/MPPDB_backup12.tar -p <span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text364515348224">8000</span><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1158715411252"><span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text135877542256"> -h 10.10.10.100</span></em> human_resource -n public --role role1 --rolepassword <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i0948957417">password</em> -F t
gs_dump[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text373243712218">8000</span>'][human_resource][2017-07-21 16:21:10]: dump database human_resource successfully
gs_dump[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text111571240182213">8000</span>'][human_resource][2017-07-21 16:21:10]: total time: 3278 ms</pre>
<p id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_p132823911818">Example 3: User <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1761517516405">jack</strong> does not have the permission for exporting all databases in a cluster and the role <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b1362420514019">role1</strong> has this permission. To export all databases, you can set <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b36286512403">--role</strong> to <strong id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_b36301534014">role1</strong> in the export command. The exported files are in text format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_screen2032883917811">human_resource=# CREATE USER jack IDENTIFIED BY "<em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1420194522">password</em>";
gs_dumpall -U jack -W <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i347645429">password</em> -f /home//backup/MPPDB_backup.sql -p <span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text759714482213">8000</span><em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i4644417268"><span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text3645161182613"> -h 10.10.10.100</span></em> --role role1 --rolepassword <em id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_i1151141015214">password</em>
gs_dumpall[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text315194815228">8000</span>'][human_resource][2018-11-14 17:26:18]: dumpall operation successful
gs_dumpall[port='<span id="EN-US_TOPIC_0000001233681793__en-us_topic_0000001145894743_text1675955015221">8000</span>'][human_resource][2018-11-14 17:26:18]: total time: 6437 ms</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0269.html">Using gs_dump and gs_dumpall to Export Metadata</a></div>
</div>
</div>