Using Attunity via ODBC to Export to Splice Machine

Follow these steps to use Attunity Replicate with the Splice Machine ODBC driver to export tables from a MySQL database and import them into your Splice Machine database:

  1. Install the Splice Machine ODBC Driver
  2. Create a Splice Machine Endpoint in Attunity
  3. Create an Attunity Task to Export Data
  4. Run the Replication Task
  5. Verify the Tables in Splice Machine

1. Install the Splice Machine ODBC Driver

If you don’t already have our ODBC driver installed, please follow the instructions in our Installing the Splice Machine ODBC Driver on Linux topic to install and test the driver on your system.

2. Create a Splice Machine Endpoint in Attunity

Your first step is to open the Attunity Replicate user interface and click Manage Endpoint Connections.

In the pop-up window that opens, select + New Endpoint Connection, and follow these steps:

  1. Enter data in these fields:
    1. Enter the name for your endpoint in the Name: field.
    2. Enter a description for the endpoint in the Description: field.
    3. Select Target as the value of the Role: field.
    4. Select ODBC as the value of the Type: field.
  2. Click the Connection String button, and enter ODBC connection information. Specify the Driver exactly as shown here, and replace the `Port` and `URL` values as required for your environment:

    Driver={SpliceODBCDriver};Port=1527;URL=192.168.2.215
  3. Enter your Splice Machine user name and password in the Username and Username fields.
  4. Click the Save button at the bottom of the window to save your endpoint settings.
  5. Click the Test Connection button to test your settings.

3. Create an Attunity Task to Export Data

Now that you’ve created the endpoint, you need to create an Attunity Replicate task that exports data from the MySQL source to files that Splice Machine can import.

Start by clicking + New Task in the Attunity Replicate UI, and then follow these steps:

  1. Enter the name for your task in the Name: field.
  2. Enter a description for the task in the Description: field.
  3. Select Unidirectional in the Replication Profile field.
  4. In the Task Options section:
    • Select Full Load.
    • Select Apply Changes.
    • If you want to store the change logs on the target you selected, select Store Changes.
  5. Click OK to save the task settings and proceed to the Table Selection settings.
  6. Drag and drop the source and target endpoints into the center panel. Select the Splice Machine endpoint you just created as the target endpoint.
    1. Click Table Selection to open the pop-up window for selecting tables.
    2. Select the tables from your source endpoint
    3. Click OK.
  7. Click Save in the top-left portion of the window to save the task.

4. Run the Replication Task

Now you can run your newly defined replication task by clicking Run.

Once your task is running, you can:

  • Click Monitor to monitor the task.
  • Click Stop to stop the task.

5. Verify the Tables in Splice Machine

Once the replication task has completed, you can use the splice> command line interpreter (sqlshell.sh) to verify that the tables look good in your Splice Machine database:

  • To verify that the new schema you replicated from Attunity, display a list of available schemas:

    splice> SHOW SCHEMAS;
  • To see a list of the tables in your schema, use the SHOW TABLES command. For example, if your schema name is mySchema, use this command:

    splice> SHOW TABLES IN MYSCHEMA;
  • If you selected the Store Changes options in your replication task settings, you'll see change tables listed with a format like this:

    <MY_TABLE>__ct
  • To verify the number of rows in a table, use a command like this:

    splice> SELECT COUNT(*) FROM MYSCHEMA.MYTABLE;
  • To display the first 10 rows of a table, use a command like this:

    splice> SELECT * FROM MYSCHEMA.MYTABLE {LIMIT 10};

Though splice> command lines are shown in all caps in the examples above, the commands are not case sensitive.