Steps for setting up Control with a SQL backend under windows
- Create a regular company, or use an existing one. Once you complete the SQL conversion process you cannot go back
Log into the database with a user who can create new databases and specify owners (an admin user, such as postgres), and create the database specified in step 3. For PostgreSql:
-bash-3.00$ su -postgres -bash-3.00$ psql Password: Welcome to psql 8.1.3, the PostgreSQL interactive terminal. postgres=# create database fayez with owner = ccc; CREATE DATABASE
For MS SQL: use MS SQL Enterprise manager For Oracle: free version comes with pre installed database XE and it is not possible to create extra or rename it. For commercial installation: follow instructions
Go to Start->All Programs->Administrative Tools->Data Sources (ODBC)
Go to the System DSN tab, click Add and enter the following information:
SQL Server <Finish> Name: COMPANY CODE Description: anything here Sever: select your SQL server from drop down list (local if on same computer) <next> <select>With Windows NT authentication using the network logon ID <check>Connect to SQL Server to obtain default settings for the additional configuration options <next> <check>Change the default database to: choose your database from drop down list <check> Use ANSI quoted identifiers. <check> Use ANSI nulls, paddings and warnings. <next> <check>Perform translation for character data <Finish>
Run coaad and select the company. Goto the second page, and set the option Use SQL backend? to YES
Change into the SQL environment and then run createccdb to create the required tables and sequences. Other options are available to createdb, you can view these by using the --help option.
Z:\> createccdb Create tables: All, drop existant tables: No, Company code: FAYEZ, Company name: DEMONSTRATION CO. Do you want to proceed (yes/no)? yes create tables [All] successfull, see log for detail
Change to the company directory and create a new directory for the datafiles. All successfully converted files will be moved to this directory. You should also move the index files there. This is not nesscarry but is useful if you need to rollback, or if the import fails. Run importccdb to import all the data into the database. This will take a while if you have a large amount of data.
Z:\> cd \DEMOSQL1> mkdir backup Z:\DEMOSQL1\> importccdb Import file = All, Move processed files = No, directory: Z:\/DEMOSQL1/None Company code: DEMOSQL1, Company name: SQL DEMO COMPANY Do you want to proceed (yes/no)? yes import tables [All] successfull, see log for detail
updateccdd should be run everytime a new field is introduced to a structure or one is moved or removed. It is probably safer to run this everytime new programs are compiled or copied across to customer sites. It is very quick and requires no user interaction.
dropccdd -f filename is a utility to be used to drop tables as updateccdd only removes columns.
createccdb -f filename is a utility to be used to add tables as updateccdd only add columns.
Congratulations, your Control system is now running on an SQL backend!
