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>
83 lines
27 KiB
HTML
83 lines
27 KiB
HTML
<a name="EN-US_TOPIC_0000001188323692"></a><a name="EN-US_TOPIC_0000001188323692"></a>
|
|
|
|
<h1 class="topictitle1">GDS-based Cross-Cluster Interconnection</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_section724412461419"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p950017387514">With data processing based on foreign tables, GDS is used to transfer data and synchronize data between multiple clusters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_section12749173213914"><h4 class="sectiontitle">Scenarios</h4><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul195331041918"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li145331841017">Data is synchronized from one cluster to another. Full data synchronization and data synchronization based on filter criteria are supported.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li113124451015">Currently, only the following syntax is supported.<ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul83106455111"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li3311174514110">INSERT INTO <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i1742710221198">inner table</em> SELECT... FROM <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i763612351911">linked_external_table 1</em> [WHERE];</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li73110451717">INSERT INTO <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i3299182516193">linked_external_table</em> SELECT * FROM <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i7300202571911">inner table 1</em> [JOIN <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i193001625121912">inner table 2</em> | WHERE];</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li102921914122">SELECT ... FROM <em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i15463526181915">linked_external_table</em>;</li></ul>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_section1623517594108"><h4 class="sectiontitle">Important Notes</h4><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul101291444171118"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li631110101218">The column name and type of the created foreign table must be the same as those of the corresponding source table, and the tables in the remote cluster must be row-store or column-store.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li123481332111419">Before running the synchronization statement, ensure that the tables to be synchronized exist in the local and remote clusters.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li469895621712">The status of the two clusters is <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1288144814559">Normal</strong>.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li187689353187">Both clusters must be able to connect to each other using GDS.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li6661075197">The database code of both clusters must be the same. Otherwise, an error may be reported or the received data may be garbled characters.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li330415773518">The compatible database types specified for both clusters must be the same. Otherwise, an error may be reported or the received data may be garbled characters.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li14466117145312">Ensure that the user performing table synchronization has the permission to access those tables.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li949713132195">Foreign tables for interconnection can be used only for cross-cluster data synchronization. In other scenarios, errors may occur or the operation may be invalid.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li163888363213">The foreign tables for interconnection do not support complex column expressions or complex syntax, including <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b982762513410">join</strong>, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b16731629649">sort</strong>, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b12105232048">cursor</strong>, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b13514123516416">with</strong>, and <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b2857153817414">set</strong>.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li844417298264">SQL statements that are not pushed down cannot use this feature to synchronize data.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li82144159239">The explain plan and logical cluster are not supported.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li38321958165517">Only the simple JDBC mode is supported.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li81981811143518">If data is synchronized from the local cluster to a remote cluster, only internal table query is supported.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li714195019244">The GDS specified by the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b14948144217010">syncsrv</strong> option of foreign servers does not support the SSL mode.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li19226194213268">After data synchronization is complete, only the number of data rows is verified.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li642095571316">The maximum number of concurrent services cannot be greater than half of the value of the GDS startup parameter <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b18648165531520">-t</strong> and cannot be greater than the value of <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b53017227171">max_active_statements</strong>. Otherwise, services may fail due to timeout.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_section6870234174413"><h4 class="sectiontitle">Preparations</h4><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul1075377164520"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li875320734512">Configure the interconnection between both clusters.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li13833194811466">Plan and deploy GDS servers. Ensure that all GDS servers can communicate with all nodes in the two clusters. That is, the security group of the GDS servers must allow the corresponding GDS port (for example, 5000) and DWS port (8000 by default) in the inbound direction. For details about how to deploy GDS, see <a href="dws_04_0193.html">Installing, Configuring, and Starting GDS</a>.<div class="note" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_note198810476101"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p118894718108">When starting GDS, you can specify any directory as the data transit directory, for example, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1219115354190">/opt</strong>. An example of the startup command is as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen2474115817112"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b4794151710124">/opt/gds/bin/gds -d /opt -p<em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i1066532919121"> </em></strong><em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i7665529181213">192.168.0.2</em><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b2578132821612">:5000 -H </strong><em id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_i9579182821612">192.168.0.1/24</em><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b16578528121615"> -l /opt/gds/bin/gds_log.txt -D -t 2</strong></pre>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_section65571212194813"><h4 class="sectiontitle">Procedure</h4><p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p1281313200116">Assume that the table <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b2187045203914">tbl_remote</strong> in the remote cluster is to be synchronized with the table <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b15775124417575">tbl_local</strong> in the local cluster and the user performing the synchronization is <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1766925205613">user_remote</strong>. Note that the user must have the permission to access the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b511012911015">tbl_remote</strong> table.</p>
|
|
<ol id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ol13997117144816"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li9997151784817"><a name="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li9997151784817"></a><a name="en-us_topic_0000001233761713_li9997151784817"></a><span>Create a server.</span><p><pre class="screen" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen4260193217489">CREATE SERVER server_remote FOREIGN DATA WRAPPER GC_FDW OPTIONS(
|
|
address '192.168.178.207:8000',
|
|
dbname 'db_remote',
|
|
username 'user_remote',
|
|
password 'xxxxxxxx',
|
|
syncsrv 'gsfs://192.168.178.129:5000|gsfs://192.168.178.129:5000'
|
|
);</pre>
|
|
<ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul68344244913"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li124931254192713"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b6290144512916">server_remote</strong> indicates the server name, which is used by the foreign table for interconnection.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li20243171517282"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b7666120181010">address</strong> indicates the IP address and port number of the CN in the remote cluster. Only one address is allowed.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li8020022915"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1792621361111">dbname</strong> indicates the database name of the remote cluster.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1341304519299"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1968015520118">username</strong> indicates the username used for connecting to the remote cluster. This user cannot be a system administrator.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1036883319305"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1538571616124">password</strong> indicates the password used for connecting to the remote cluster.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li2834526495"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b7679185318120">syncsrv</strong> indicates the IP address and port number of the GDS server. If there are multiple addresses, use vertical bars (|) to separate them. The function of <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b98791323141310">syncsrv</strong> is similar to that of <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b77332368548">location</strong> in the GDS foreign table.<div class="note" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_note8268103220311"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p1114543914617">GaussDB(DWS) tests the network connected to the GDS addresses set by <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b753514315480">syncsrv</strong>.</p>
|
|
<ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul87017438714"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li2705432714">The test can only show the network status between the local cluster and the GDSs, but cannot show the network status between the remote cluster and GDS. You need to check the error message.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li28982719815">After removing the unavailable GDSs, select a proper number of GDSs that do not cause service suspension to synchronize data.</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
</p></li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li4173123111495"><span>Create a foreign table for interconnection.</span><p><pre class="screen" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen123746379495">CREATE FOREIGN TABLE ft_tbl(
|
|
col_1 type_name,
|
|
col_2 type_name,
|
|
...
|
|
) SERVER server_remote OPTIONS (
|
|
schema_name 'schema_remote',
|
|
table_name 'tbl_remote',
|
|
encoding 'utf8'
|
|
);</pre>
|
|
<ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul165315235506"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li18986272452"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b8111645151419">schema_name</strong> indicates the schema that the remote cluster table belongs to. If this option is not specified, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b44545157">schema_name</strong> is set to the schema of the foreign table.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li159866734512"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b53171922201518">table_name</strong> indicates the remote cluster table name. If this option is not specified, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b59413941616">table_name</strong> is set to the name of the foreign table.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li79861272457"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b193021737201614">encoding</strong> indicates the encoding format of the remote cluster. If this option is not specified, the default encoding format of the source cluster database is used.</li></ul>
|
|
<div class="note" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_note425822819416"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul105981852194115"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1525813531901">The values of <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b19720055175519">schema_name</strong> and <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b6823759185519">table_name</strong> are case sensitive and must be the same as those of the remote schema and table.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li554102014497">The foreign table for interconnection cannot contain any constraints in its columns.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li6598552124114">The column names and column types of the foreign table must be the same as those of the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b199912402517">tbl_remote</strong> table.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li5465164911530"><strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b0661140161818">SERVER</strong> must be set to the server created in <a href="#EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li9997151784817">Step 1</a> and must contain the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b165699318195">syncsrv</strong> attribute.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1863885895119"><span>Use the foreign table for interconnection to synchronize data.</span><p><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul1849626144111"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1250126114120">If the local cluster is the destination cluster, you can run the following statements:<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p16788155114210"><a name="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1250126114120"></a><a name="en-us_topic_0000001233761713_li1250126114120"></a>Full data synchronization of all columns:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen14788165174211"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">tbl_local</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">ft_tbl</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p778875184212">Data synchronization of all columns based on filter criteria:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen15788450425"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">tbl_local</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">ft_tbl</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">col_2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">XX</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p978935104211">Full data synchronization of some columns:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen1778917564215"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">tbl_local</span><span class="w"> </span><span class="p">(</span><span class="n">col_1</span><span class="p">)</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">col_1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">ft_tbl</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p67891556427">Data synchronization of some columns based on filter criteria:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen16789553427"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">tbl_local</span><span class="w"> </span><span class="p">(</span><span class="n">col_1</span><span class="p">)</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">col_1</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">ft_tbl</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">col_2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">XX</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1871022610427">If the local cluster is the source cluster, you can run the following statements:<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p145489220432"><a name="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li1871022610427"></a><a name="en-us_topic_0000001233761713_li1871022610427"></a>Synchronization of unsharded tables:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen45481284310"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">ft_tbl</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tbl_local</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_p11548123431">Data synchronization of the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b536712226393">join </strong>results:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen454802124316"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">ft_tbl</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tbl_local1</span><span class="w"> </span><span class="k">join</span><span class="w"> </span><span class="n">tbl_local2</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="n">XXX</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
<div class="note" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_note7961126815"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_ul98562471126"><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li285684715218">If a connection failure is reported, check the server information and ensure that both clusters are connected.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li76709271047">If an error indicating GDS connection failure is reported, check whether the GDS server specified by <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1427918419245">syncsrv</strong> has been started and whether it can communicate with all nodes in both clusters.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li98569477216">If an error is reported indicating that the table does not exist, check whether the <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b198534968093217">option</strong> information of the foreign table is correct.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li583215521768">If an error is reported indicating that the column does not exist, check whether the column name of the foreign table is the same as that of the source table.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li662051715412">If an error message is displayed indicating that a column is repeatedly defined, check whether the column name is too long. If yes, use the AS alias to simplify the column name.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li199823172710">If an error is reported indicating that the column type cannot be parsed, check whether the statement contains a column expression.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li58571947223">If a column mismatch error is reported, check whether the column information of the foreign table is the same as that of the corresponding table in the remote cluster.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li8742123310814">If an error is reported indicating that the syntax is not supported, check whether complex syntax is used, such as <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b195111338204913">join</strong>, <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b1024615184913">distinct</strong>, and <strong id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_b162638412502">sort </strong>.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li9857144719210">If garbled characters are displayed, check whether the encoding formats of both databases are the same.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li5622172810495">If the local cluster is the source cluster, there is a low probability that data is successfully synchronized to the remote cluster but the local cluster returns an execution failure. In this case, you are advised to check the number of synchronized data records.</li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li3345153315377">If the local cluster is the source cluster, data synchronization controlled by transaction blocks and sub-transactions can be queried only after the total transaction is committed.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_li814118467534"><span>Delete the foreign table for interconnection.</span><p><pre class="screen" id="EN-US_TOPIC_0000001188323692__en-us_topic_0000001233761713_screen565025117532">DROP FOREIGN TABLE ft_tbl;</pre>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0179.html">Importing Data</a></div>
|
|
</div>
|
|
</div>
|
|
|