Prerequisites

(warning) First, you will need to install a DataSync Agent configured to share data to an MS SQL Server database.

(warning) You will also need to create a ServiceNow dynamic share with an update trigger or create a ServiceNow bulk share.

(warning) Finally, make sure to stop running your DataSync Agent before making any Agent configuration changes.

What's on this page?






Optional Configuration Directives

The following table reflects the available optional configuration directives:

DirectiveExampleUseDefault
amqp_uri<amqp_uri>amqp://localhost</amqp_uri>Primary Message Bus LocationOptional
amqp_user<amqp_user>admin</amqp_user>User for logging into primary busOptional
amqp_password<amqp_password>adminadmin</amqp_password>User's password for message busOptional
polling_interval<polling_interval>20</polling_interval>Interval between each runOptional
max_reads_per_connect<max_reads_per_connect>1500</max_reads_per_connect>Messages to process per intervalOptional
max_writes_per_connect<max_writes_per_connect>1500</max_writes_per_connect>Messages to process per intervalOptional
schedule<schedule>* * * * *</schedule>Process messages every minutesOptional
schemas_directory<schemas_directory>directory name</schemas_directory>directory holding the schema definitionsOptional
cant_access_directory<cant_access_directory>directory name</cant_access_directory>directory holding the name of table which can't be accessed.Optional
date_format<date_format>MM/dd/yyyy</date_format>format of the date for all tables.Optional
date_time_format<date_time_format>MM/dd/yyyy HH:mm:ss</date_time_format>format of the date and time for all tables.Optional
key<key>ven0001</key>to specify a “key” or instance to subscribe to and ignore records from all other sources e.g. only records coming from the ServiceNow instance ven0001 will be subscribed to and all other messages will be skipped. Introduced in v3.8.0Optional


The following table provides the optional target database configuration options.

DirectiveExampleUseDefault
database_type<database_type>mysql|sqlserver|oracle|postgres|etc</database_type>The type of database replicated toRequired
database<database>psp_repl</database>Name of the target databaseOptional
database_server<database_server>IP or FQDN of the database server</database_server>IP or FQDN of the database serverRequired
database_user<database_user>database user name</database_user>User for logging into the databaseRequired
database_password<database_password>database user password</database_password>Password for logging into the databaseRequired
database_port<database_port>port used by the server</database_port>Port used by the serverOptional
database_parms<database_parms>parms passed to the database server</database_parms>Parameters passed to the database serverOptional
database_sid<database_sid>SID (Oracle Only) </database_sid>SID used for Oracle databaseOptional

↑ Go to top of page




Dynamic Database Port Configuration

For DataSync Agent integrations using MSSQL Server, a configuration option is available to have dynamic database ports. The database_port directive can be nested within each task directive of the agent.xml configuration file for the Replicator Agent. Configuring your Replicator Agent in this way allows you to specify an instance name that will be compatible with dynamic MS SQL Server database ports.

To configure dynamic database ports for your Replicator Agent integration with MS SQL Server, follow these steps:

Navigate to the directory in which your agent.xml file was saved upon installation of the DataSync Agent. Then, open the agent.xml file in a text editing application.

Within each database_port tag, add \DATABASE_INSTANCE_NAME as this directive's value, where DATABASE_INSTANCE_NAME is the name of your MS SQL Server database instance. Your <database_port> directive will look like the following example:

<database_port>\PRODUCTION</database_port>

Save the agent.xml and start the agent. 

↑ Go to top of page




Force reload a prepared SQL statement.

When running your Agent for a DataSync integration with MS SQL Server, a directive in the agent.xml configuration file named <force_preparedstatement_reload> has its value set to true by default so that SQL statements are batched together to prevent primary key violation exceptions. You can turn off this functionality, or stop reloading prepared SQL statements, by changing the value of this directive to false according to the procedure described below

To stop reloading prepared SQL statements for your DataSync integration to an MS SQL Server database, follow these steps:

Navigate to the directory where you saved your agent.xml file when installing your DataSync Agent.

Open your agent.xml file in a text editing application. Then, locate the <force_preparedstatement_reload> directive(s) nested within the <task> directive(s) and change each value to false per the example shown below:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
    <agent>
        <share/>
        <subscribe>
            <task instances="1">
                <task_name>mssql_test_subscribe</task_name>
                <message_connection password="encrypted:vlOtU71yu8N/EFIJH85SSBtaIt7qEEfvqiqft9VZyYE=" queue="psp.out.replicator.test" use_basic_consume="true"    user="admin">amqps://test.perspectium.net</message_connection>
                <instance_connection password="encrypted:vlOtU71yu8N/EFIJH85SSPN9aF0P5/YViVwPEVFcGW4=" user="testuser">https://mycompany.service-now.com</instance_connection>
                <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
                <decryption_key>This is my decryption key for testing</decryption_key>
                <database_type>sqlserver</database_type>
                <database_server>localhost</database_server>
                <database_port>1433</database_port>
                <database_user>testuser</database_user>
                <database_password>testpassword</database_password>
                <database_parms/>
                <database_column_max_size>251</database_column_max_size>
                <database>psp_repl</database>
                <force_preparedstatement_reload>false</force_preparedstatement_reload>
            </task>
        </subscribe>
        <max_reads_per_connect>4000</max_reads_per_connect>
        <polling_interval>5</polling_interval>
        <skip_message_set_processing/>
    </agent>
</config>

Save the changes you made to your agent.xml file and close the file.

↑ Go to top of page