Creating a system-period temporal table
Use the following procedure to create a system-period temporal table:
- On the BMC AMI Change Manager for Db2 Main Menu, select WORKID, and press Enter.
- On the WORKID Action Menu, type the name of the WORKID or type a wildcard pattern to display a list of work IDs. Then, select Specify Db2 definitions and press Enter.
- On the Object Specification panel, specify the name of a database and table space (or use wildcard characters) and press Enter.
- On the Mixed List panel, type CTB in the Act column adjacent to the table space (TS) for which you want to create a system-period temporal table and press Enter.
- On the Create Table panel, specify the information about the system-period temporal table:
- Type the owner of the table.
- Type the name of the table.
- Specify the attributes for the table.
- In the Link History TB field, type one of the following values:
- Y to associate a history table to record audit information.
- (PTF BQU1029 applied) E to associate a history table that includes rows of audit information that are deleted from the system-period temporal table.
- Type S to select Table Column List.
- Press Enter.
- On the Table Columns List panel, specify the columns for the system-period temporal table:
Specify the begin column with the following attributes, and press Enter:
Attribute
Value
Column Name
userDefinedSystemBeginName
Column Type
TIMESTAMP
Length
12
Nl
N
Df
A
Pd
S
The product automatically sets the default value to AS ROW BEGIN.
- Type L in the Act column adjacent to the begin column name and press Enter.
Specify the end column with the following attributes and press Enter:
Attribute
Value
Column Name
userDefinedSystemEndName
Column Type
TIMESTAMP
Length
12
Nl
N
Df
A
Pd
T
The product automatically sets the default value to AS ROW END.
- Type L in the Act column adjacent to the begin column name and press Enter.
Specify the transaction ID column with the following attributes, in the order specified in the table:
Attribute
Value
Column Name
userDefinedSystemTransactionIDName
Column Type
TIMESTAMP
Length
12
Pd
blank
Nl
Y or N
Df
X
The product automatically sets the default value to AS TRANSACTION START ID.
- Press Enter.
- (PTF BQU1029 applied) (optional) Specify a non-deterministic generated expression column.
- Type E in the Act column adjacent to a column name and press Enter.
- On the Table Column Detail panel, type G in the With Default field and press Enter.
- On the Table Column Non-deterministic Generated Expression panel, select a value and press Enter.
- On the pop-up panel, type Y to allow the product to make the required changes to the column and press Enter.
- Press END.
- Press END.
- On the Create Table panel, type S to select History Table Information.
- On the History Table Information panel, specify the table owner and name and press END.Now that the table has been created you can analyze a work ID and execute a worklist.