Incremetal replication from Cisco CVP Reporting (IBM Infromix) to MSSQL
Solution made for acceleration of custom reports and reducing workload on CVP Reporting instance, benefit of this
solution is speed up the reports, cause you gain the full control of tables/indexes/statistics/execution plan, and it's
optimization.
One of the main advantages of OPENQUERY is remote execution, meaning that the query is sent from the local server to remote server while having knowledge of those remote tables that are now local to the query. By the way, remote execution also enables the use of native syntax of the remote server, so you can take advantage of other RDBMS system’s performance tricks. But, the main reason why OPENQUERY will use - it's perform better is the knowledge of the table in terms of indexes and stats, knowledge that a direct linked server doesn’t have.
Source DB schema and table description
on Cisco.com
- Depending on which Windows operating system version (32-bit or 64-bit) is used, install according IBM Informix Client SDK for Windows Operating Systems, which contains ODBC driver for IBM Informix
- Configure ODBC driver on Windows used ODBC Data Sources Administrator (32-bit or 64-bit)
- Configure Linked server on MSSQL to use previously configured ODBC connection - f.e check data/linked_server.sql
- On my deployment I used - clientsdk.4.10.FC14.windows64.zip
- For more information about connecting to CVP Reporting instance, check Cisco documentation
- call
- vxmlsession
- vxmlelement
- vxmlelementdetail
- vxmlcustomcontent
- call
- vxmlsession
- vxmlelement
- vxmlelementdetail
- vxmlcustomcontent
- tIndexStateHistory - logs table for index reglament procedure
- tSetting - global settings, RowCopyPerTime, Cleanup_Age, LinkedServer name, etc
- tSettingsTables - settings for copy and update tables, sSyncReportTables used this table
- tSyncLog - stored infromation about each run of copy/update/cleanup procedure
- sCleanupIndexStateHistoryTable - cleanup procedure for table tIndexStateHistory
- sCleanupReportTables - cleanup procedure for tables in tSettingsTables
- sCleanupSyncLogTable - cleanup procedure for table tSyncLog
- sOnReglamentIndex - procedure for reglament work on indexes (reorganization/rebuild/update statistics)
- sQueryGetColumns - helper procedure which preparing query columns
- sQueryGetParameters - helper procedure which preparing query parameters
- sSyncReportTables - main procedure which use tSettingsTables and run according job for each table
- sSettingsTableUpdate - helper procedure for update tSettings tables setting
- sSyncTablesIncremental - procedure for incremental copy with OPENQUERY
- sSyncTablesUpdate - procedure for update tables with OPENQUERY
- job_runSyncReportTable - run increment copy and update procedure
- job_runOnReglamentIndex - run reglament procedure and disabled/enabled incremental copy job while the run
- job_cleanupTasks - run cleanup procedure
- job_maintenanceplan_db - run maintenanceplan plan for backup database
- job_maintenanceplan_log - run maintenanceplan plan for backup transaction log (if you plan to use DB recovery mode: FULL)
- Configure database maintenance plan according your best practice
UTF8_TO_NVARCHAR - helper scalar function which convert Unicode to NVARCHAR.
Note
SQL Server 2019 (15.x) introduces full support for the widely used UTF-8 character encoding as an import or export
encoding, and as database-level or column-level collation for string data. UTF-8 is allowed in the char and varchar
data
types, and it's enabled when you create or change an object's collation to a collation that has a UTF8 suffix.
Detailed on Microsoft
- In source DB, in the "call" and "vxmlsession" tables, enddatetime column is filled after the call is completed
- In source DB, in the "call" and "vxmlsession" tables, enddatetime column may not be filled for some reason and stay NULL
- In source DB, in the "vxmlelementdetail" table may contain repeated rows
Important
- Convert "varvalue" column data which may contains non-Latin char from source "vxmlelementdetail" table to NVARCHAR using scalar function dbo.UTF8_TO_NVARCHAR(varvalue)
- Convert date/datetime from source to according date/datetime in MSSQL
- Periodically trying to update enddatetime value for "call" and "vxmlsession" tables because it’s presented in source tables with NULL value for uncompleted calls (we may have a call lasting up to an hour)
Tip
Tune the number of copied records and linked server name on tSetting and time and frequency running jobs according your workload and your tasks.