doc-exports/docs/dws/tool/dws_16_0027.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
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:35:25 +00:00

97 lines
25 KiB
HTML

<a name="EN-US_TOPIC_0000001772536404"></a><a name="EN-US_TOPIC_0000001772536404"></a>
<h1 class="topictitle1">Teradata Perl Migration</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_section16350192815390"><h4 class="sectiontitle">Overview</h4><p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p1596485455518">This section describes how to migrate Teradata Perl files.</p>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p43045016154636">Run the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b192361727332038">runDSC.sh </strong>or <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b142326214932038">runDSC.bat</strong> command and set <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b23071710432038">--application-lang</strong> to <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b116797093532038">perl</strong> to migrate Teradata <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b199702243632038">BTEQ</strong> or <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b15397904932038">SQL_LANG</strong> scripts in Perl files to Perl-compatible GaussDB(DWS). After migrating Perl files, you can verify the migration by comparing the output file with its input file using a comparison tool.</p>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p167852057155517">The Perl file migration process is as follows:</p>
<ol id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ol5425598912"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li36041859115815">Complete the steps in section <a href="dws_16_0018.html#EN-US_TOPIC_0000001772696064">Prerequisites</a>.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li5996617171310">Create an input folder and copy the Perl files to be migrated to the folder. For example, create a <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b67443945032038">/migrationfiles/perlfiles</strong> folder.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li19999111713132">Execute DSC to migrate Perl scripts and set <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057__en-us_topic_0000001706105017_en-us_topic_0000001443528629_li147773406162">db-bteq-tag-name</a> to <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b55571047932038">BTEQ</strong> or <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057__en-us_topic_0000001706105017_en-us_topic_0000001443528629_li132693018413">db-tdsql-tag-name</a> to <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b180860005432038">SQL_LANG</strong>.<ol type="a" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ol132337337109"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li1523383391010">The DSC extracts the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b99175735032038">BTEQ</strong> or <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b115333192932038">SQL_LANG</strong> scripts from the Perl files.<ol class="substepthirdol" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ol11520135705412"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li122022027114215">BTEQ is the tag name, which contains a set of BTEQ scripts. This tag name is configurable using the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b59082097832038">db-bteq-tag-name </strong>configuration parameter in <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b45129180332038">perl-migration.properties</strong> file.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li1182434974316">SQL_LANG is another tag name, which contains Teradata SQL statements. This is also configurable using the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b24380507732038">db-tdsql-tag-name</strong> configuration parameter.</li></ol>
</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li096575811710">DSC invokes the Teradata SQL to migrate the extracted SQL scripts. For details about Teradata SQL migration, see <a href="dws_16_0026.html#EN-US_TOPIC_0000001772696076">Teradata SQL Migration</a>.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li17667513187">Perl files are embedded in the migrated scripts.</li></ol>
</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li56533484174">DSC creates the migrated files in the specified output folder. If no output folder is specified, DSC creates an output folder named <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b37505687432038">converted</strong> in the input folder, for example, <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b59764796532038">/migrationfiles/perlfiles/converted</strong>.<div class="note" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_note95314511501"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul17111228356"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li15111428051">Perl variables containing SQL statements can also be migrated to SQL by setting the <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057__en-us_topic_0000001706105017_en-us_topic_0000001443528629_li1148411265916">migrate-variables</a> parameter.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li31117282056">For perl v 5.10.0 and later are compatible.</li></ul>
</div></div>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_section14305652786"><h4 class="sectiontitle">Teradata Perl Migration</h4><p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p189412231216">To migrate Perl files, execute DSC with <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b86114577432038">--source-db Teradata</strong> and <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b21487685432038">--application-lang Perl</strong> parameter values. DSC supports the migration of <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b155197885832038">BTEQ</strong> and <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b88725114432038">SQL_LANG</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b73210589832038"> </strong>scripts. You can specify the scripts to be migrated by setting <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057__en-us_topic_0000001706105017_en-us_topic_0000001443528629_li147773406162">db-bteq-tag-name</a> or <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057__en-us_topic_0000001706105017_en-us_topic_0000001443528629_li132693018413">db-tdsql-tag-name</a>.</p>
</div>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p13117521383">Run the following commands to set the source database, input and output folder paths, log paths, and application language.</p>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p647712369277"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1093094392717">Linux</strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen63127528817"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b139722412918">./runDSC.sh </strong>
<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b83141452388">--source-db</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b3316135215813">|-S</strong> Teradata
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1481363920713">--application-lang|-A </strong>Perl]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b316512465815">--input-folder|-I</strong> &lt;input-script-path&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b7901518145812">--output-folder</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1432118524812">|</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1132135216812">-O</strong> &lt;output-script-path&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b18114318714">--conversion-type</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1832412522815">|</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1732513522081">-M</strong> &lt;Bulk or BLogic&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b63265521787">--log-folder|-L</strong> &lt;log-path&gt;]</pre>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p105251146132716"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b512245314270">Windows</strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen916115142812"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b3161013284">runDSC.bat</strong>
<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b77271821986">--source-db</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b27271421682">|-S</strong> Teradata
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1972818216813">--application-lang|-A </strong>Perl]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b20728422816">--input-folder|-I</strong> &lt;input-script-path&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b67281723810">--output-folder</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b16728923810">|</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1728121786">-O</strong> &lt;output-script-path&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b147282215810">--conversion-type</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b19728721986">|</strong><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b072814210810">-M</strong> &lt;Bulk or BLogic&gt;]
[<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1728321887">--log-folder|-L</strong> &lt;log-path&gt;]</pre>
<div class="p" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p1097915444517">For example:<pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen15633161115262">./runDSC.sh --input-folder /opt/DSC/DSC/input/teradata_perl/ --output-folder /opt/DSC/DSC/output/ --source-db teradata --conversion-type Bulk --application-lang PERL</pre>
</div>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p12527116135310">During the execution of DSC, the migration summary, including the progress and completion status, is displayed on the console.</p>
<pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen2884230912226">********************** 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
**************************************************************************
Log file path :....../DSC/DSC/log/dsc.log
DSC process end time : Mon Jan 20 17:24:49 IST 2020
DSC total process time : 0 seconds
********************* Schema Conversion Completed ************************</pre>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p43501326164811">For details about the parameters for Teradata Perl migration, see <a href="dws_16_0015.html#EN-US_TOPIC_0000001819336057">Teradata Perl Configuration</a>.</p>
<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p44048551489">For details about CLI parameters, see <a href="dws_16_0024.html#EN-US_TOPIC_0000001819416101">Database Schema Conversion</a>.</p>
<div class="note" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_note1935612694820"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul1635622612483"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li935012266484">DSC formats the input files and saves them in the output folder. You can compare the formatted input files with the output files.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li11553184215107">Ensure that there are no spaces in the input path. If there is a space, DSC throws an error. For details, see <a href="dws_16_0210.html#EN-US_TOPIC_0000001819336325">Troubleshooting</a>.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li635019262483">For details about logs, see <a href="dws_16_0032.html#EN-US_TOPIC_0000001772696088">Log Reference</a>.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_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_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b11819143652619">application.properties</strong> configuration file in the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b1782013614261">config</strong> folder before the migration. Deleted or overwritten subfolders and files cannot be restored by DSC.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li11356826164811"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b194527926632038">Process start time</strong> indicates the migration start time and <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b96455083732038">Process end time</strong> indicates the migration end time. <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b204480118032038">Process total 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.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li14998124041513">Set <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b212562281532038">--add-timing-on</strong> to <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b190761676132038">true</strong> in the <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b194963838332038">perl-migration.properties</strong> file to add a custom script to calculate statement execution time.<p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p399884011513">Example:</p>
<div class="p" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p199810404154"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b59982040141511">Input</strong><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen144553513144"><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></pre></div></td><td class="code"><div><pre><span></span><span class="err">$</span><span class="n">V_SQL2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="ss">&quot;SELECT T1.userTypeInd FROM T07_EBM_CAMP T1 WHERE T1.Camp_List_Id = '$abc'&quot;</span><span class="p">;</span>
<span class="err">$</span><span class="n">STH</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">$</span><span class="n">dbh</span><span class="o">-&gt;</span><span class="k">prepare</span><span class="p">(</span><span class="err">$</span><span class="n">V_SQL2</span><span class="p">);</span>
<span class="err">$</span><span class="n">sth</span><span class="o">-&gt;</span><span class="k">execute</span><span class="p">();</span>
<span class="o">@</span><span class="k">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">$</span><span class="n">sth</span><span class="o">-&gt;</span><span class="n">fetchrow</span><span class="p">();</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="p" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p9998174021517"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b59981405158">Output</strong><pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen11455115191414">$V_SQL2 = "SELECT T1.userTypeInd FROM T07_EBM_CAMP T1 WHERE T1.Camp_List_Id = '$abc'";
$STH = $dbh-&gt;prepare($V_SQL2);
use Time::HiRes qw/gettimeofday/;
my $start = [Time::HiRes::gettimeofday()];
$sth-&gt;execute();
my $elapsed = Time::HiRes::tv_interval($start);
$elapsed = $elapsed * 1000;
printf("Time: %.3f ms\n", $elapsed);
@rows = $sth-&gt;fetchrow();</pre>
</div>
</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li171301826191219">GROUP and OTHERS must not have write permission for the files or folders specified by<strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b124185256232038">--input-folder</strong>. That is, the privilege for the folder specified by <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b44761007632038">--input-folder</strong> must not be higher than <strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b163040559932038">755</strong>. For security purposes, DSC will not be executed if the input files or folders have the write permission.</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li12356112620485">If migration tasks are executed concurrently, the input folder must be unique for each task.</li></ul>
</div></div>
<div class="section" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_section14864195644818"><h4 class="sectiontitle">Best Practices</h4><p id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_p15212112511416">To optimize the migration, you are advised to follow the standard practices:</p>
<ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul1629515361417"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li1229593610412"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b35170153932038">BTEQ</strong> scripts must be in the following format:<pre class="screen" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen1162081914169">print BTEQ &lt;&lt;ENDOFINPUT;
TRUNCATE TABLE employee;
ENDOFINPUT
close(BTEQ);</pre>
</li></ul>
<ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul67518459165"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li187534541617"><strong id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_b200628580332038">SQL_LANG</strong> scripts must be in the following format:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_screen1175545101616"><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></pre></div></td><td class="code"><div><pre><span></span><span class="n">my</span><span class="w"> </span><span class="err">$</span><span class="n">sSQL</span><span class="o">=&lt;&lt;</span><span class="n">SQL_LANG</span><span class="p">;</span>
<span class="k">TRUNCATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">employee</span><span class="p">;</span>
<span class="n">SQL_LANG</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
<ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul1914635581915"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li11146655201914">Comment must not contain the following information:<ul id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_ul1914625541911"><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li1114620553196">print BTEQ &lt;&lt;ENDOFINPUT</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li6146855161912">ENDOFINPUT</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li151461255121919">close(BTEQ)</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li131461055171916">my $sSQL=&lt;&lt;SQL_LANG</li><li id="EN-US_TOPIC_0000001772536404__en-us_topic_0000001706224309_en-us_topic_0000001443723857_li2014612552195">SQL_LANG</li></ul>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0024.html">Database Schema Conversion</a></div>
</div>
</div>