Descriptions of law_dba Tables

The subsections that follow describe the law_dba tables in detail.

Notice that the clause names mentioned throughout the table descriptions, such as "gbpcache-block" and "table-space-name" refer to the syntax diagrams for the create table and create table space statements in the IBM reference manual DB2 Universal Database for OS/390 SQL Reference Version 6.

law_dba_table

The law_dba_table is used to assign a Lawson table to its own database.

You can use the law_dba_table feature in a non-partitioned system. It is also possible (although uncommon) that you might have a partitioned system for which you do not want to assign a table to its own database. Most partitioned systems use this table.

The following shows the syntax of law_dba_table.

create table law_dba_table (
     name varchar (128) not null,
     dbname varchar(128),
     options varchar (255));
     
create unique index law_dba_tabset1 on law_dba_table
 (name asc);

The following shows the meaning of the options in law_dba_table.

Column Meaning
NAME

This column must be the name of a valid Lawson table (or one that has been created at your site). Type the name in all uppercase letters and do not qualify it.

Examples:

GLMASTER (valid) | glmaster (not valid) LAWPROD.GLMASTER (not valid)

dbname This column must be the name of a valid DB2 database. Make sure to type this name correctly, the ibmdb utility does not validate this name before it executes the create table statement.
options

This column can contain any of the trailing options allowed by DB2, including AUDIT CHANGES, WITH RESTRICTION ON DROP, and DATA CAPTURE NONE.

If you are using more than one option, insert them as a single string. For example, type AUDIT CHANGES WITH RESTRICTION ON DROP to use both options.

Example: Using law_dba_table to assign a Lawson table to its own database

The following example shows how to assign a Lawson table to its own IBM DB2 for OS/390 database where the settings in Database Definition (dbdef) are:

file (table) = GLTRANS Lawson database space = GLTDBS Data table space = GLTTS IBM DB2 390 name = MYDB

LAW_DBA_TABLE "GLTRANS", "GLTDB", NULL

law_dba_index

The law_dba_index table is for using multiple index locations. Before you attempt to use multiple index locations, make sure you understand the bldibmddl utility. What Is the Build Data Definition Language Utility?

The law_dba_index table lets you override the settings on the Database Space Definition form and separate the indexes from a single table to different Stogroups. You can use this table to specify multiple index locations even if you are not using partitioning. If you are using a partitioning, use this table.

The following shows the syntax of the law_dba_index table.

create table law_dba_index (
     name varchar (128) not null,
     tbname varchar(128) not null,
     userman char(1) check(userman='Y')
     mid_options varchar(255),
     clust char(1) check (clust = 'Y')
     numparts int,
     post_options varchr(255));
          part int not null,
     options varchar(255));
     
create unique index law_dba_indset1 on law_dba_index (name);
create unique where not null index law_dba_indset2 
on law_dba_index (tbname, clust);

The following shows the meaning of the options in the law_dba_index table.

Column Meaning
name

This column must contain the name of a user index in all upper-case letters with no qualifications.

Examples:

GLMSET1 (valid) glmset1 (invalid) LAWPROD.GLMSET1 (invalid)

tbname This column must contain the name of the table that the index is crated on. Type TBNAME in all uppercase letters and do not qualify it.
userman Select Y here to specify that the index should be managed by an on-site DBA (user) rather than by the database driver. The most common reason for activating the userman option would be to prevent an unwanted index from being created.
mid_options

This column can contain any options that precede CLUSTER. This includes using-block, free-block, and others. If the value is null, the defaults are STOGROUP, PRIQTY, and SECQTY.

If you do not want to specify mid_options but you also do not want to use these defaults, insert an empty string ' ' in this column.

clust Set this column to Y to specify this index as a clustering index. Partitioning indexes must be set to Y. If the index is not used for partitioning, set the column to null.
numparts Use this column only for partitioning indexes. The value must be greater than zero and match the number of records for this index in law_dba_ixpart.
post_options This column can be used for any options that follow the cluster and partition clauses. This includes the BUFFERPOOL clause, PIECESIZE clause, and others.

law_dba_strings

The law_dba_strings table is used to create table partitions when tables are created. This table overrides the handling of other LAW_DBA tables, and is used for adding SQL strings to SQL creation commands that are used by Lawson.

The LAW_DBA_STRINGS table can be created and used to handle DDL changes even without creating any other LAW_DBA table. If records are found in the LAW_DBA_STRINGS table for a given database object, these records are no longer searched for in the other LAW_DBA tables.

Note: You must have sufficient understanding of DDL syntax when using the LAW_DBA_STRINGS table.

The following example shows the syntax of the law_dba_strings table:

create table law_dba_strings (
object_name varchar (128) not null,
object_type varchar(128) not null,
string_type varchar(128) not null,
position int not null,
string_col varchr(2000)) not null);
 
create unique index law_dba_strset1 
on law_dba_strings (object_name, 
object_type, string_type, position);
 

The following table provides descriptions of the options in the law_dba_strings table:

Column Description
object_name

This column must contain the name of a user table, index, or tablespace in all uppercase letters with no qualifications.

Examples:

GLMSET1(valid)

glmset1 (invalid)

LAWPROD.GLMSET1(invalid)

object_type This column must contain the object type of the data in the object_name column. This column can have a value of either TABLE or INDEX in all uppercase letters.
string_type

This column must contain the name of the type of string to be added to the object . The following are the valid values for this column. These values must be typed in uppercase letters:

OPTIONS - Data in the string_col column is added to the end of the DDL for the object_name or object_type. This value is valid for TABLE, TABLESPACE, or INDEX object types.

DATABASE - Data in the string_col column contains the database name for the table that is specified in the object_name column. This is valid only if the object_type is TABLE.

TABLESPACE - Data in the string_col column contains the name of the tablespace for the table specified in object_name. This is valid only if the object_type is TABLE.

position Use this column if the data in the string_col is too long to fit in one record. When multiple identical records are created with different position values, the string_col values are concatenated and used.
string_col If the string_type value is OPTIONS, this column contains the DDL string to be added to the end of the create DDL for the object_name or object_type. If the string_type is DATABASE or TABLESPACE, this column contains the name of the database or tablespace.

Example: Adding data to the law_dba_strings table

insert into law_dba_strings 
values (tablespacename, 'TABLESPACE',
 'OPTIONS', 1, 'NUMPARTS 2 (PART 1 options, 
PART 2 options) compress yes'
Note: The law_dba_strings table must be created from the example provided in the build_law_390.sql script. The DDL for creating the law_dba_strings table must also be added to the script.

law_dba_tspart

This table is used for the PART n... clauses of the create tablespace... statement. The following shows the syntax of the law_dba_tspart table.

create table law_dba_tspart (
     name varchar (128) not null,
     part int not null,
     options varchar(255));
     
create unique index_law_dba_tsset1 on law_dba_tspart 
(name asc, part asc);

The following shows the meaning of the options in the law_dba_tspart table.

Column Meaning
tsname This column must contain the of the table space and must be identical to the name column in the law_dba_ts table.
part This column must contain an integer (1 or greater) that cannot be greater than the value of numparts in the corresponding law_dba_ts row.
options This column must be used for options specific to the partition you are currently specifying. This might include using-block and free-block as well as other options.

law_dba_ixpart

The law_dba_ixpart table is used for the PART n... clauses of the create index... statement.

The following shows the syntax of the law_dba_ixpart table.

create table law_dba_ixpart (
     name varchar (128) not null,
     part int not null, not null
     values varchar(255), not null
     options varchar(255));
     
create unique index law_dba_ixpset1 on law_dba_ixpart
 (name, part);

The following shows the meaning of the options in the law_dba_ixpart table.

Column Meaning
ixname This column must match the name column of the corresponding row in the law_dba_index table.
part This column must be greater than zero and must not be greater than the value of numparts in the law_dba_table.
values The values column contains the limit value for the part clause. Character values must be enclosed in single quote marks ('') so escape quotes are required.
options This column can contain any options specific to this part. This includes values for using-block, free-block, and gbpcache-block.

build_law_390.sql script

build_law_390.sql is a script that you run to create the tables.