• Scroll to top of this topic Scroll to Top of Page

  • Print the current topic Print Topic

  • No expanding elements on this page Show/Hide Expanders

Console Scenario Samples

Here are the console scenario samples.

Compare table and export to automatically generated file

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”left” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Connection side=”right” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Operation name=”Schema Comparison” sourceScope=”Tables TestDB.dbo” targetScope=”Tables TestDB2.dbo”>

                 <Export />

         </Operation>

</DatabaseCompareSuiteScenario>

Multiple operations in a scenario

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”left” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Connection side=”right” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Operation name=”Schema Comparison” sourceScope=”Tables TestDB.dbo” targetScope=”Tables TestDB2.dbo” />

         <Operation name=”Schema Comparison” sourceScope=”Views TestDB.dbo” targetScope=”Views TestDB2.dbo” />

         <Operation name=”Schema Comparison” sourceScope=”TestIntegers.dbo” targetScope=”TestNewTypes.dbo” />

</DatabaseCompareSuiteScenario>

In this scenario there are 3 kinds of objects compared:

  1. Tables of schema “dbo” in databases “TestDB” and “TestDB2”.

  2. Views of schema “dbo” in databases “TestDB” and “TestDB2”.

  3. Schemas “dbo” in databases “TestIntegers” and “TestNewTypes”.

Schema comparison between different database platforms

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”left” databaseDialect=”Oracle” server=”oracle11″ port=”1521″ userID=”user” password=”pass”/>

         <Connection side=”right” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Operation name=”Schema Comparison” sourceScope=”TEST_DB” targetScope=”TestDB.dbo”/>

</DatabaseCompareSuiteScenario>

The Settings comparison operation

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”left” databaseDialect=”MSSQL” server=”mssqlserver2012″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Connection side=”right” databaseDialect=”MSSQL” server=”mssqlserver2014″ port=”1433″ authentication=”SQLServer” userID=”user” password=”pass” />

         <Operation name=”Settings Comparison” sourceScope=”Server mssqlserver2012″ targetScope=”Server mssqlserver2014″>

                 <Export/>

         </Operation>

</DatabaseCompareSuiteScenario>

Multiple operations in a scenario with preferences and manual mapping

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”both” databaseDialect=”Oracle” server=”oracle11″ port=”1521″ database=”orcl” userID=”user” password=”pass” />

         <Operation name=”Detailed Data Comparison” sourceScope=”TEST_DB.SOURCE” targetScope=”TEST_DB.TARGET”>

                 <Preferences>

                         <Add side=”left” parent=”TEST_DB.SOURCE” name=”columns_to_sort_by” value=”ID”/>

                         <Add side=”both” name=”row_filter” value=”NUM &lt; 50″/>

                 </Preferences>

         </Operation>

         <Operation name=”Schema Comparison” sourceScope=”Tables TEST_DB” targetScope=”Tables TEST_DB_EQUAL”>

                 <MatchingPreferences>

                         <Add side=”both” category=”Tables” suffix=”_suf” prefix=”pre_”/>

                 </MatchingPreferences>

                 <ManualMapping>

                         <ObjectPair sourcePath=”TEST_DB.DIFFERENT” targetPath=”TEST_DB_EQUAL.DIFFERENT2″ />

                 </ManualMapping>

                 <Export path=”Result.xml” />

         </Operation>

</DatabaseCompareSuiteScenario>

 

Multiple operations with matching preferences

<“xml version=”1.0″ encoding=”utf-8″“>

<DatabaseCompareSuiteScenario xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

         <Connection side=”both” databaseDialect=”Oracle” server=”oracle11″ port=”1521″ database=”orcl” userID=”user” password=”pass” />

         <MatchingPreferences>                <!– Global matching preferences –>

                 <Add side=”both” category=”Tables” suffix=”_SUF” prefix=”PRE_” />

         </MatchingPreferences>

         <Operation name=”Data Comparison” sourceScope=”Tables TEST_DB” targetScope=”Tables TEST_DB_EQUAL”>        <!– First operation –>

                 <Export path=“Result.csv” />

         </Operation>

         <Operation name=”Data Comparison” sourceScope=”Tables TEST_DB” targetScope=”Tables TEST_DB_EQUAL”>        <!– Second operation –>

                 <MatchingPreferences>

                         <Add side=”left” category=”Tables” suffix=”” prefix=”PRE_” />

                 </MatchingPreferences>

                 <Preferences>

                         <Add side=”both” name=”ignore_case” value=”true” />

                         <Add side=”both” name=”date_comparison_mode” value=”Ignore Time” />

                 </Preferences>

                 <Export path=”Result.csv” append=”true” />

         </Operation>

         <Operation name=”Data Comparison” sourceScope=”Tables TEST_DB” targetScope=”Tables TEST_DB_NOT_EQUAL”>        <!– Third operation –>

                 <Export path=”Result.csv” append=”true” />

         </Operation>

</DatabaseCompareSuiteScenario>

In this scenario there are 3 operations:

  1. In the first operation, global matching preferences are used for both sides: category=”Tables” suffix=”_SUF” prefix=”PRE_”. After the execution of operation, the result will be saved in the Result.csv file.

  2. In the second operation, matching preferences are used for left side that were defined in the operation: category=”Tables” suffix=”” prefix=”PRE_”. It is important to define prefix=”PRE_”, if you want to use this value. Otherwise it will be equal to a not defined value. Global matching preferences are used for the right side: category=”Tables” suffix=”_SUF” prefix=”PRE_”. After the execution of the operation, the result will be appended to the end of Result.csv file.

  3. In the third operation, global matching preferences are used for both sides: category=”Tables” suffix=”_SUF” prefix=”PRE_”. After execution of the operation, the result will be appended to the end of Result.csv file.