<< CSQL Cache Modes - TOC - Working with CSQL Gateway >>
CSQL Cache supports large number of DS (data source) from which tables can be cached. These data sources shall belong to one TDB (Target Database) or more than one. This feature gives flexibility to a greater extent where applications can operate on different tables from different data sources in CSQL.
In this scenario, the CSQL Cache connects to a number of DS, from different DBMS such as MySQL, PostgreSQL, Oracle, and Sybase database.
In this Configuration, CSQL Cache is used to manage the data sources present in all the target databases. After caching the tables from different data sources, application can perform all the DML operations through the gateway.
Note: The Data Source Name should be unique in ~/.odbc.ini file so that CSQL Cache will be able to connect to it.
The CSQL Cache manages it by reading the csqlds.conf file where all the DS names are cited along with the default DS which is present in the csql.conf file. All the DS which are present in csqlds.conf file should be unique along with their user name and password.
Follow the below steps to cache tables from multiple data source.
Lets take a example, where CSQL Cache connects to the three unique different DS which are present in ~/.odbc.ini file. Here “myodbc3” is specified as default DS in csql.conf file.
Below are the name of the data sources and their respective Database:
(i) myodbc3 - MySQL (ii) TestSource - MySQL (iii) psql - Postgres
The above data source names along with their username, password, and TDB name to be populated in csqlds.conf file by using the csqlds tool at command prompt. To know about csqlds tool and all options, Refer the Section 14.1. csqlds tool
$csqlds -U root -P root123 -D myodbc3 -N mysql –a $csqlds -U jitu jitu123 -D TestSource -N mysql –a $csqlds -U lakshya lakshya123 -D psql -N postgres -a
Lets assume that the tables EMPLOYEE, DEPT and DEPOSIT are present in the myodbc3, TestSource and psql data sources respectively. To cache these tables from their respective data source use cachetable tool.
Follow the below command to cache the table:
$cachetable -t EMPLOYEE $cachetable -t DEPT -d TestSource $cachetable -t DEPOSIT -d psql
After caching the tables, user shall use the cachetable tool with –S option to display cached table information.
Note:
(i) -d option is not used for default data source, which is present in csql.conf file. It’s mandatory to use -d option for the data sources except default data source.
(ii) Table names, which need to be cached, should be unique across all data sources. \\
<< CSQL Cache Modes - TOC - Working with CSQL Gateway >>