Creating a history table for a system-period temporal table
Use the following procedure to create a history table for a system-period 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 history table for an associated system-period temporal table.
- Specify the information about the history table.
- Type the owner of the table.
- Type the name of the table.
- Specify the attributes for the table.
- Type S to select Table Column List.
On the Table Columns List panel, specify the columns for the history table.
Specify the begin column with the following attributes, and then press Enter.
Attribute
Value
Column Name
userDefinedSystemBeginName
Column Type
TIMESTAMP
Length
12
Nl
N
Df
N
Pd
blank
Default Value
blank
- 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
N
Pd
blank
Default Value
blank
- Type L in the Act column adjacent to the begin column name and press Enter.
Specify the transaction ID column with the following attributes:
Attribute
Value
Column Name
userDefinedSystemTransactionIDName
Column Type
TIMESTAMP
Length
12
Nl
Y or N
Df
X
Pd
blank
Default Value
blank
- Press Enter.
- Press END.
- Modify the base system-period temporal table.
- On the Mixed List panel, type E in the Act column adjacent to the system-period temporal table.
- On the Table Detail panel, at the Link History TB field, type
- Y to enable versioning without enabling the recording of an extra history table row when deleting a system-period temporal table row
- E to enable versioning and enable recording of an extra history table row when deleting a system-period temporal table row
- Type S to select History Table Information.
- On the History Table Information panel, specify the name of the history table.
- Press Enter.
- Press END.
- Press END.Now that the table has been created, you can analyze a work ID and execute a worklist.