doc-exports/docs/dws/tool/dws_mt_0207.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

40 lines
14 KiB
HTML

<a name="EN-US_TOPIC_0000001188681026"></a><a name="EN-US_TOPIC_0000001188681026"></a>
<h1 class="topictitle1">Overview</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p913062319147">The following use cases for migration are supported by DSC:</p>
<ul id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_ul730518309597"><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li19324172114419">Migrate Teradata SQL</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li1232414211444">Migrate Oracle SQL</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li16324192120419">Migrate Teradata Perl files</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li128333854117">Migrate Netezza</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li1469454642218">Migrate MySQL SQL</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li158126194115">Migrate DB2</li></ul>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p46458414133"><a href="#EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_fig3820191814472">Figure 1</a> shows the DSC Migration Process.</p>
<div class="fignone" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_fig3820191814472"><a name="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_fig3820191814472"></a><a name="en-us_topic_0218440516_fig3820191814472"></a><span class="figcap"><b>Figure 1 </b>Syntax migration process</span><br><span><img id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_image482071811478" src="figure/en-us_image_0000001234200759.png"></span></div>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p16646151319541">This section contains information about the prerequisites to be completed before starting the migration process.</p>
<div class="section" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_section1416813556537"><h4 class="sectiontitle">Executing Custom Scripts</h4><p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p761412145412">The DSC configuration contains the following custom DB scripts in the <em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i1061151295411">DSC/</em><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i239141511106">scripts</em>:</p>
<ul id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_ul106386271443"><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li66378277440"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i206371827164413">date_functions.sql</em> : Custom DB script for Oracle date functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li106372272440"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i963712713446">environment_functions.sql</em>: Custom DB script for Oracle environment functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li166371127184416"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i86372270441">string_functions.sql</em>: Custom DB script for Oracle string functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li10637112711448"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i116373277443">pkg_variable_scripts.sql</em>: Custom DB script for Oracle package variable functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li1963742794419"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i26371827164417">sequence_scripts.sql</em>: Custom DB script for Oracle sequence functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li10638627164419"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i163742744413">mig_fn_get_datatype_short_name.sql</em>: Custom DB script for Teradata functions</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li14638327164414"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i1963892719441">mig_fn_castasint.sql</em> : Custom DB script for migration of CAST AS INTEGER</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li19638827104411"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i263872784412">vw_td_dbc_tables.sql</em>: Custom DB script for migration of DBC.TABLES</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li1663812764418"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i1463813272442">vw_td_dbc_indices.sql</em>: Custom DB script for migration of DBC.INDICES</li></ul>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p52145476585">These DB scripts are required to support certain input keywords not present in one or more versions of the target DB. These scripts need to be executed once in the target DB prior to migration.</p>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p189319515219">For details about executing custom database scripts, see <a href="dws_mt_0033.html#EN-US_TOPIC_0000001233922139__en-us_topic_0218440503_section974418973610">Custom DB Script Configuration</a>.</p>
<div class="p" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p18664620417">Use any of the following methods to execute the required scripts in all target GaussDB(DWS) databases for which migration is to be performed:<ul id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_ul33657573111"><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li03655523114">Run the following command to connect to the GaussDB(DWS) database and paste all content in the .sql file to <strong id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_b2594654104510">gsql</strong>, which will automatically execute the pasted content.<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p2916171364417">Run the following command to connect to the <span id="EN-US_TOPIC_0000001188681026__text730420274914">GaussDB(DWS)</span> database:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_screen51281181448"><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">gsql</span><span class="w"> </span><span class="o">-</span><span class="n">h</span><span class="w"> </span><span class="o">&lt;</span><span class="n">host_addr_xxx</span><span class="p">.</span><span class="n">xxx</span><span class="p">.</span><span class="n">xxx</span><span class="p">.</span><span class="n">xxx</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="w"> </span><span class="o">&lt;</span><span class="n">database_name</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">U</span><span class="w"> </span><span class="o">&lt;</span><span class="n">user_name</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">W</span><span class="w"> </span><span class="o">&lt;</span><span class="n">password</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">p</span><span class="w"> </span><span class="o">&lt;</span><span class="n">port_number</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">r</span>
</pre></div></td></tr></table></div>
</div>
</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li11754716174816">Use gsql to connect to the <span id="EN-US_TOPIC_0000001188681026__text92591416164915">GaussDB(DWS)</span> database and execute the <strong id="EN-US_TOPIC_0000001188681026__b821461917315">.sql</strong> file:<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p12760016154810">Run the following command to connect to the <span id="EN-US_TOPIC_0000001188681026__text8301162004912">GaussDB(DWS)</span> database and execute the <strong id="EN-US_TOPIC_0000001188681026__b1462334716318">.sql</strong> file:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_screen176112162486"><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">gsql</span><span class="w"> </span><span class="o">-</span><span class="n">h</span><span class="w"> </span><span class="o">&lt;</span><span class="n">host_addr_xxx</span><span class="p">.</span><span class="n">xxx</span><span class="p">.</span><span class="n">xxx</span><span class="p">.</span><span class="n">xxx</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="w"> </span><span class="o">&lt;</span><span class="n">database_name</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">U</span><span class="w"> </span><span class="o">&lt;</span><span class="n">user_name</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">W</span><span class="w"> </span><span class="o">&lt;</span><span class="n">password</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">p</span><span class="w"> </span><span class="o">&lt;</span><span class="n">port_number</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">f</span><span class="w"> </span><span class="o">&lt;</span><span class="n">filename</span><span class="p">.</span><span class="k">sql</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">o</span><span class="w"> </span><span class="o">&lt;</span><span class="n">output_filename</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">L</span><span class="w"> </span><span class="o">&lt;</span><span class="n">log_filename</span><span class="p">.</span><span class="n">log</span><span class="o">&gt;</span><span class="w"> </span><span class="o">-</span><span class="n">r</span>
</pre></div></td></tr></table></div>
</div>
</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li63651059311">Use Data Studio to connect to the <span id="EN-US_TOPIC_0000001188681026__text95781724114910">GaussDB(DWS)</span> database, and open and execute the <strong id="EN-US_TOPIC_0000001188681026__b207844150411">.sql</strong> file in Data Studio.</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li9140561138">Before Oracle PL/SQL objects (procedures or functions) are migrated, migrate all DDL and DML using the <strong id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_b18765933111212">Bulk</strong> migration type. Then, migrate the scripts containing PL/SQL objects using the <strong id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_b0197193916128">BLogic</strong> migration type.<div class="note" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_note7140661314"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p1438524911510">If the migration type is <strong id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_b17638646161212">Bulk</strong>, the input file cannot contain any PL/SQL objects.</p>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p20293832860">Similarly, if the migration type is <strong id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_b11607151541419">BLogic</strong>, the input files must not contain any DDL/DML.</p>
</div></div>
</li></ul>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_section171026437592"><h4 class="sectiontitle">Configuring DSC and Migration Properties</h4><p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p1170816380019">The DSC configuration contains the following configuration files in the <em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i19729431821">DSC/config</em> folder:</p>
<ul id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_ul288416323448"><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li4884732194420"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i158831332114417">application.properties</em>: Configuration parameters for the DSC</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li108847320449"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i18884143213447">features-teradata.properties</em>: Configuration parameters for Teradata SQL Migration</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li118841932134412"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0237712456_i188433284412">features-oracle.properties</em>: Configuration parameters for Oracle SQL Migration</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li14884113234416"><em id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_i1988416321440">oracle-migration.properties</em>: Configuration parameters for Oracle (Beta) SQL Migration</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li1388483219447"><em id="EN-US_TOPIC_0000001188681026__i593418366193">perl-migration.properties</em>: Configuration parameters for Perl Migration</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li335215370818"><em id="EN-US_TOPIC_0000001188681026__i8723829111916">features-netezza.properties</em>: Configuration parameters for Netezza Migration</li><li id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_li069814202439"><em id="EN-US_TOPIC_0000001188681026__i163329206198">features-mysql.properties</em>: Configuration parameters for MySQL SQL Migration</li></ul>
<p id="EN-US_TOPIC_0000001188681026__en-us_topic_0218440516_p1968665810599">For details about how to update configuration parameters, see <a href="dws_mt_0025.html">DSC Configuration</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_mt_0032.html">Migration Process</a></div>
</div>
</div>