Creating the database schema by running SQL scripts
After you create an empty database, you create the schema for the Rule Execution Server database. One way of doing so consists in running SQL scripts.
About this task
The script that creates the database schema is named repository_<DatabaseName>.sql. This procedure shows the Derby and DB2® examples.
If you want to use Decision Warehouse, you can also create the required database tables by running the script trace_<DatabaseName>.sql. If you also store the Java™ XOMs in a database, you must create these tables by running the xomrepository_<DatabaseName>.sql script.
- A user ID
- A password
- Complete privileges on the tables and view of the schema (create, insert, delete)
- Privileges for index creation (create index)
- On Oracle, additional creation privileges: create trigger and create sequence.
Database | Database tool |
---|---|
IBM® DB2 | DB2 command line processor |
Derby | ij command line processor |
MySQL | mysql command line processor |
Oracle | sqlplus command line processor - Run all the scripts in the SQL Plus client. |
Postgre SQL | Postgre SQL command-line tool |
SQL Server | Query Tool |
Sybase | isql command line processor |
The following example shows how to run the Derby SQL script to create the schema. It is assumed that the embedded version of Derby is used.
Procedure
Running SQL scripts to create a DB2 schema
If you work with a DB2 database, you can use SQL scripts from an SQL Plus client and specific constraints apply.
About this task
The script that creates the DB2 database schema is named repository_db2.sql. You can also create the database schema for Decision Warehouse by running the script trace_db2.sql. If you are storing the Java XOM in the database, you must create these tables by running the xomrepository_db2.sql script.
- BP32K is the buffer pool that is expected in
SYSCAT.BUFFERPOOLS. If BP32K is
not there, you can use the existing buffer pool or create a new buffer
pool named BP32K. Use the following command to query SYSCAT.BUFFERPOOLS for
the existing buffer pool:
Select * from SYSCAT.BUFFERPOOLS
Otherwise, use the following command to create a buffer pool named BP32K:CREATE BUFFERPOOL BP32K SIZE 2000 PAGESIZE 32K
- You must update the trace_db2.sql script
and select the custom option in the Installation Settings wizard
to run it. Modify the following line in the script to specify storage
for tablespace:
CREATE TABLESPACE RESDWTS PAGESIZE 32K BUFFERPOOL BP32K;
Here is an example of the tablespace specification in the script:CREATE TABLESPACE RESDWTS PAGESIZE 32K MANAGED BY Database USING [ FILE 'C:\DB2\Container.file' 640 ] BUFFERPOOL BP32K;
- You might have to further modify the script, depending on your database settings.