The CustDB consolidated database can be any MobiLink supported consolidated database.
A SQL Anywhere 12 CustDB consolidated database is provided in %SQLANYSAMP12%\UltraLite\CustDB\custdb.db. A DSN called SQL Anywhere 12 CustDB is included with your installation.
You can rebuild this database using the file %SQLANYSAMP12%\UltraLite\CustDB\makedbs.cmd.
If you want to explore the way the CustDB sample is created, you can view the file %SQLANYSAMP12%\MobiLink\CustDB\custdb.sql.
The following SQL scripts are provided in %SQLANYSAMP12%\MobiLink\CustDB to build the CustDB consolidated database as any one of these supported RDBMSs:
RDBMS | Custdb setup script |
---|---|
Adaptive Server Enterprise | custase.sql |
SQL Server | custmss.sql |
Oracle | custora.sql |
DB2 LUW | custdb2.sql |
MySQL | custmys.sql |
For more information about preparing a database for use as a consolidated database, see Consolidated database setup.
The following procedure creates a CustDB consolidated database for each of the supported RDBMS.
Create a database in your RDBMS.
Add the MobiLink system objects by running one of the following SQL scripts, located in the MobiLink\setup subdirectory of your SQL Anywhere 12 installation:
For an Adaptive Server Enterprise consolidated database, run syncase.sql.
For a MySQL consolidated database, run syncmys.sql.
For an Oracle consolidated database, run syncora.sql.
For a SQL Server consolidated database, run syncmss.sql.
Add sample user tables, stored procedures and MobiLink synchronization scripts to the CustDB database by running one of the following SQL scripts, located in %SQLANYSAMP12%\MobiLink\CustDB:
For an Adaptive Server Enterprise consolidated database, run custase.sql.
For a MySQL consolidated database, run custmys.sql.
For an Oracle consolidated database, run custora.sql.
For a SQL Server consolidated database, run custmss.sql.
Create an ODBC data source called CustDB that references your database on the client computer.
Choose Start » Programs » SQL Anywhere 12 » Administration Tools » ODBC Data Source Administrator.
Click Add.
Select the appropriate driver from the list.
Click Finish.
Name the ODBC data source CustDB.
Click the Login tab. Enter the User ID and Password for your database.
Create a consolidated database on the DB2 LUW server named CustDB.
Ensure that the default table space (usually called USERSPACE1) uses 8 KB pages.
If the default table space does not use 8 KB pages, complete the following steps:
Verify that at least one of your buffer pools has 8 KB pages. If not, create a buffer pool with 8 KB pages.
Create a new table space and temporary table space with 8 KB pages.
For more information, consult your DB2 LUW documentation.
Add the MobiLink system objects to the DB2 LUW consolidated database using the file MobiLink\setup\syncdb2.sql:
Change the connect command at the top of the file syncdb2.sql. Replace DB2Database with the name of your database (or its alias). In this example, the database is called CustDB. You can also add your DB2 user name and password as follows:
connect to CustDB user userid using password ~ |
Open a DB2 LUW Command Window on either the server or client computer. Run syncdb2.sql by typing the following command:
db2 -c -ec -td~ +s -v -f syncdb2.sql |
Add data tables, stored procedures and MobiLink synchronization scripts to the CustDB database:
If necessary, change the connect command in custdb2.sql. For example, you could add the user name and password as follows. Replace userid and password with your user name and password.
connect to CustDB user userid using password |
Open a DB2 Command Window on either the server or client computer.
Run custdb2.sql by typing the following command:
db2 -c -ec -td~ +s -v -f custdb2.sql |
When processing is complete, enter the following command to close the command window:
exit |
Create an ODBC data source called CustDB that references the DB2 LUW database on the DB2 LUW client.
Start the ODBC Data Source Administrator:
Choose Start » Programs » SQL Anywhere 12 » Administration Tools » ODBC Data Source Administrator.
The ODBC Data Source Administrator appears.
On the User DSN tab, click Add.
In the Create New Data Source window, select the ODBC driver for your DB2 LUW database. For example, choose IBM DB2 UDB ODBC Driver. Click Finish.
For information about how to configure your ODBC driver, see:
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |