•  Scroll to Top of Page

  •  Print Topic

  •  Show/Hide Expanders

CLI scenario samples

Here are the command-line interface 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="Standard" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" userID="user" password="pass" />
         <Operation name="Schema Comparison" sourceScope="Tables TestDB.dbo" targetScope="Tables TestDB2.dbo">
                 <Export />
         </Operation>
</DatabaseCompareSuiteScenario>

Execute scripts on databases

<?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="Standard" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" userID="user" password="pass" />
         <ExecuteSql side="left">Update dbo.Country Set CountryCode = 1234 Where CountryName="BAHAMAS"</ExecuteSql>
         <ExecuteSql side="right" path="D:\Word\DB\AddNewProd.sql"/>
</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="Standard" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" 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”.

Open an existing project 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="Oracle" server="oracle11" port="1521" database="orcl" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" userID="user" password="pass" />
         <OpenProject>C:\WorkFolder\MyProjectFile.dsuite</OpenProject>
         <Operation name="Schema Comparison" sourceScope="TEST_DB" targetScope="TestDB.dbo" />
</DatabaseCompareSuiteScenario>

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" database="orcl" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" 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="Standard" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2014" port="1433" authentication="Standard" 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>

The operation with matching rules

<?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" database="orcl" userID="user" password="pass" />
         <Connection side="right" databaseDialect="MSSQL" server="mssqlserver2012" port="1433" authentication="Standard" userID="user" password="pass" />
         <Operation name="Schema Comparison" sourceScope="DB_SOURCE.dbo" targetScope="DB_2000.dbo">
           <MatchingRules>
             <FilterRule side="source" metadataObjectType="Table" mode="exactName" action="exclude">lobtypesTable, floatTypesTable</FilterRule>
             <CategoryRule sourceCategoriesList="Table" targetCategoriesList="View"/>
             <NameConversionRule sourceObjectType="View" targetObjectType="Table" sourcePattern="view_%{name}" targetReplacement="${name}"/>
           </MatchingRules>
         </Operation>
</DatabaseCompareSuiteScenario>