Files
doc-exports/docs/dws/tool/dws_16_0020.html
luhuayi a5e3903f6b DWS TG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-04-23 13:53:01 +00:00

164 lines
19 KiB
HTML

<a name="EN-US_TOPIC_0000001813598740"></a><a name="EN-US_TOPIC_0000001813598740"></a>
<h1 class="topictitle1">Executing DSC</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_section1434510584915"><h4 class="sectiontitle">Important Notes</h4><ul id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_ul04631634911"><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li204661684913">Before starting DSC, specify the output folder path. Separate the input folder path, output folder path, and log path with spaces. The input folder path cannot contain spaces which will cause an error when DSC is used for migrating data. For details, see <a href="dws_16_0210.html#EN-US_TOPIC_0000001813598928">Troubleshooting</a>.</li></ul>
</div>
<ul id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_ul13134568483"><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li143316569488">If the output folder contains subfolders or files, DSC deletes the subfolders and files or overwrites them based on parameter settings in the <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b174107832331930">application.properties</strong> configuration file in the <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b210818895531930">config</strong> folder before the migration. Deleted or overwritten subfolders and files cannot be restored by DSC.</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li73955616487">If migration tasks are performed concurrently on the same server (by the same or different DSCs), different migration tasks must use different output folder paths and log paths.</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li102111218151217">You can specify a log path by configuring optional parameters. If the path is not specified, DSC automatically creates a log folder under <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b28518883131930">TOOL_HOME</strong>. For details, see <a href="dws_16_0032.html#EN-US_TOPIC_0000001813598960">Log Reference</a>.</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li645723917579">The maximum size of a single SQL statement is 20 KB. If the size exceeds 20 KB, the execution may be slow and the conversion may fail.</li></ul>
<div class="section" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_section448154454918"><h4 class="sectiontitle">Migration Methods</h4><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p659494919258">You can run the <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b107428940431930">runDSC.sh</strong> or <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b54692014131930">runDSC.bat</strong> command to perform a migration task on Windows and Linux. For details, see <a href="#EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_table296962642912">Table 1</a>.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_table296962642912"></a><a name="en-us_topic_0000001432327697_table296962642912"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_table296962642912" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Migration on Windows and Linux</caption><thead align="left"><tr id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_row19970122619290"><th align="left" class="cellrowborder" valign="top" width="38.18%" id="mcps1.3.3.3.2.3.1.1"><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p3970526172911"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b17716125015162">Migration</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.82%" id="mcps1.3.3.3.2.3.1.2"><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p29700266297"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b11504717178">CLI Parameter</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_row1397016260295"><td class="cellrowborder" valign="top" width="38.18%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p11970152652918"><a href="dws_16_0026.html#EN-US_TOPIC_0000001860198977">Teradata SQL Migration</a></p>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p7970192672911"></p>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p1797072612919"></p>
</td>
<td class="cellrowborder" valign="top" width="61.82%" headers="mcps1.3.3.3.2.3.1.2 "><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen18970132610298"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="n">runDSC</span><span class="p">.</span><span class="n">sh</span>
<span class="w"> </span><span class="c1">--source-db Teradata</span>
<span class="p">[</span><span class="c1">--application-lang SQL]</span>
<span class="p">[</span><span class="w"> </span><span class="c1">--input-folder &lt;input-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T][Optional]</span>
</pre></div></td></tr></table></div>
</div>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen11971326132914"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="n">runDSC</span><span class="p">.</span><span class="n">bat</span>
<span class="c1">--source-db Teradata</span>
<span class="p">[</span><span class="c1">--application-lang SQL]</span>
<span class="p">[</span><span class="w"> </span><span class="c1">--input-folder &lt;input-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T][Optional]</span>
</pre></div></td></tr></table></div>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_row10408162616402"><td class="cellrowborder" valign="top" width="38.18%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p126285216412"><a href="dws_16_0027.html#EN-US_TOPIC_0000001860318449">Teradata Perl Migration</a></p>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p1314310542247"></p>
</td>
<td class="cellrowborder" valign="top" width="61.82%" headers="mcps1.3.3.3.2.3.1.2 "><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen9671352164111"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="n">runDSC</span><span class="p">.</span><span class="n">sh</span>
<span class="c1">--source-db Teradata</span>
<span class="p">[</span><span class="c1">--application-lang Perl]</span>
<span class="p">[</span><span class="c1">--input-folder &lt;input-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T][Optional]</span>
</pre></div></td></tr></table></div>
</div>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen1257231519444"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="n">runDSC</span><span class="p">.</span><span class="n">bat</span>
<span class="w"> </span><span class="c1">--source-db Teradata</span>
<span class="p">[</span><span class="c1">--application-lang Perl]</span>
<span class="p">[</span><span class="c1">--input-folder &lt;input-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt; ]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T][Optional]</span>
</pre></div></td></tr></table></div>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_row1597382662916"><td class="cellrowborder" valign="top" width="38.18%" headers="mcps1.3.3.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p0973132613293"><a href="dws_16_0028.html#EN-US_TOPIC_0000001860198801">MySQL SQL Migration</a></p>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p10973126132910"></p>
</td>
<td class="cellrowborder" valign="top" width="61.82%" headers="mcps1.3.3.3.2.3.1.2 "><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen497302692913"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="p">.</span><span class="o">/</span><span class="n">runDSC</span><span class="p">.</span><span class="n">sh</span>
<span class="c1">--source-db MySql</span>
<span class="p">[</span><span class="c1">--application-lang SQL]</span>
<span class="p">[</span><span class="c1">--input-folder &lt;input-script-path&gt;]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt;]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--conversion-type &lt;conversion-Type-BulkOrBlogic&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T]</span>
</pre></div></td></tr></table></div>
</div>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen9974526112914"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">&gt;</span><span class="w"> </span><span class="n">runDSC</span><span class="p">.</span><span class="n">bat</span>
<span class="c1">--source-db MySql</span>
<span class="p">[</span><span class="c1">--application-lang SQL]</span>
<span class="p">[</span><span class="c1">--input-folder &lt;input-script-path&gt;]</span>
<span class="p">[</span><span class="c1">--output-folder &lt;output-script-path&gt;]</span>
<span class="p">[</span><span class="c1">--log-folder &lt;log-path&gt;]</span>
<span class="p">[</span><span class="c1">--conversion-type &lt;conversion-Type-BulkOrBlogic&gt;]</span>
<span class="p">[</span><span class="c1">--target-db/-T]</span>
</pre></div></td></tr></table></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="note" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_note1510439132713"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_ul101193918271"><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li9732105184511">The CLI parameters are described as follows:<ul id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_ul07341598456"><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li45625331151423"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b81138158131930">source-db</strong> specifies the source database. The value can be <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b106360376331930">Teradata</strong>, which is case-insensitive.</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li51351879151547"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b4839451331930">conversion-type</strong> specifies the migration type. This parameter is optional. DSC supports the following migration types:<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p1766184915350"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b118797778431930">Bulk</strong>: migrates DML and DDL scripts.</p>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p897934915352"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b109199710131930">BLogic</strong>: migrates service logic, such as stored procedures and functions.</p>
</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li127444418011"><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b84059238221">target-db</strong> specifies the target database. The parameter value is <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b13611930102220">GaussDB(DWS)</strong>.</li></ul>
</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li151211916467">Command output description:<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p21141810104620"><a name="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li151211916467"></a><a name="en-us_topic_0000001432327697_li151211916467"></a><strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b15635269931930">Migration process start time</strong> indicates the migration start time and <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b140120636031930">Migration process end time</strong> indicates the migration end time. <strong id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_b58961176931930">Total process time</strong> indicates the total migration duration, in milliseconds. In addition, the total number of migrated files, total number of processors, number of used processors, log file path, and error log file path are also displayed on the console.</p>
</li></ul>
</div></div>
<div class="section" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_section172239553438"><h4 class="sectiontitle">Examples</h4><ul id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_ul152671459143313"><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li184185420716">Example 1: Run the following command to migrate the SQL file of the Teradata database to the SQL script of GaussDB(DWS) on Linux:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen0410175010528"><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="p">.</span><span class="o">/</span><span class="n">runDSC</span><span class="p">.</span><span class="n">sh</span><span class="w"> </span><span class="c1">--source-db Teradata --input-folder D:\test\conversion\input --output-folder D:\test\conversion\output --log-folder D:\test\conversion\log --conversion-type ddl --targetdb gaussdb</span>
</pre></div></td></tr></table></div>
</div>
</li><li id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_li6273125817313">Example 2: Run the following command to migrate the SQL file of the Oracle database to the SQL script of GaussDB(DWS) on Windows:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen19291835131612"><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="n">runDSC</span><span class="p">.</span><span class="n">bat</span><span class="w"> </span><span class="c1">--source-db Teradata --input-folder D:\test\conversion\input --output-folder D:\test\conversion\output --log-folder D:\test\conversion\log --conversion-type ddl --targetdb gaussdb</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
<p id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_p3969124113819">Migration details are displayed on the console (including the progress and completion status):</p>
<pre class="screen" id="EN-US_TOPIC_0000001813598740__en-us_topic_0000001432327697_screen8318131816519">********************** Schema Conversion Started *************************
DSC process start time : Mon Jan 20 17:24:49 IST 2020
Statement count progress 100% completed [FILE(1/1)]
Schema Conversion Progress 100% completed
**************************************************************************
Total number of files in input folder : 1
Total number of valid files in input folder : 1
**************************************************************************
Log file path :....../DSC/DSC/log/dsc.log
Error Log file :
DSC process end time : Mon Jan 20 17:24:49 IST 2020
DSC total process time : 0 seconds
********************* Schema Conversion Completed ************************</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0017.html">Migration Process</a></div>
</div>
</div>