Configuring SQL Mirror

Enabling External Services

A setting within the EBMS Server Manager program, External Services, must be turned on for the SQL Mirror updates to the flow. Turn on External Services for the company or companies for which there is an SQL mirror.

Configuring the SQL Server Connection String

EBMS needs to access the SQL database to perform both the Complete Upload and the continuous export. This SQL Server Connection string consists of the user and database information as created in the Configuring the SQL Server section.

Open File > System Options > SQL Mirror and enter the following into the Connection String field:

server=[SQL Server Name];Persist Security Info=False;User=[Username];Password=[User password];Initial Catalog=[database name];

Replace the text in [ ] with the appropriate values. A string may look like the following when complete:

server=<SQLServer>;Persist Security Info=False;User=<ebms_user>;Password=<ebms>;Initial Catalog=<EBMSMirror>;

Selecting tables to mirror

EBMS data tables must be individually selected as tables to mirror. Select by choosing Table List on the File > System Options > SQL Mirror dialog. In the Tables to export to SQL Server dialog, select those tables that are to be mirrored.

Each table can be filtered to reduce size using an Advanced Query. Visit the Standard Technical > Advanced Query Options section for instructions on these settings.

T-SQL statements may be configured in EBMS, if desired, and executed within the SQL database after the table has been created there. This is an advanced feature for which an understanding of SQL is critical.

Note: A Complete Upload is required after each change to the table list.

Excluding fields

Certain tables may have sensitive information that should not be exported. Choose the table and fields to exclude in the Fields to exclude from the SQL Mirror dialog. Access this dialog by choosing Field List on the File > System Options > SQL Mirror dialog.

Note: A Complete Upload is required after each change to the field list.

Complete Upload

After configuration, a bulk upload of data to the SQL Server is required. Turn on the Complete Upload option and close the dialog to initiate. EBMS will make copies of the tables selected for mirroring, convert them to .txt files, transfer those files to the shared folder on the SQL Server, and then convert them into SQL tables. Depending on data size this process may take several hours.

It is recommended that a Complete Upload be completed each time data structure changes, such as when adding or deleting a table or changing field exclusions.

Enable Export

EBMS will push any database changes to the SQL database every few seconds. Turn on the Enable Export option to start this process. It can be left on always for those companies for which an SQL database is configured and a mirror is desired.

Notes:

Technical Information: Administrators may access the DBEXCHG.dbf EBMS database table to observe the SQL export files waiting to be exported. The SQL Mirror keeps track of the last record successfully sent and checks every few seconds to see if any new ones have been added.

Verbose Logging

Only use the Log option when troubleshooting. This will write a log to the Logs.dbf EBMS database table every time the export event is triggered, as well as increase the detail that is written to the Diagnostic logs accessible from the EBMS Server Manager.

Every time EBMS sends information to SQL a log of the event is written to a text file. Administrators may monitor this detail by opening the EBMS Server Manager program and choosing the View Logs option. The log files found here are very helpful in determining the status of complete uploads and export status.

Common errors

Table: INWH bulk import to SQL failed. Cannot bulk load because the file "E:\Temp\bulkexport\INWH.txt" could not be opened. Operating system error code 5(Access is denied.).

Resolution: check folder security

Table does not exist

Resolution: check connection string in EBMS, check SQL server user permissions.