PrepAway - Latest Free Exam Questions & Answers

What needs to be defined in order to track changes made to a system-period temporal table over time?

What needs to be defined in order to track changes made to a system-period temporal table
over time?

PrepAway - Latest Free Exam Questions & Answers

A.
Once the row-begin, row-end, and transaction-start-id columns are created, all changes
are tracked.

B.
A history table must be created with identical columns to the base table and a unique
index must be defined on the transaction-start-id column.

C.
A history table must be created as a clone table of the base table after the row-begin,
row-end, and transaction-start-id columns have beendefined.

D.
A history table must be created with identical columns to the base table and then the
base table altered with the ADD VERSIONING clause torelate it to the history table.

Explanation:

2 Comments on “What needs to be defined in order to track changes made to a system-period temporal table over time?

  1. db2man says:

    D)

    https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/c0058816.html

    In order to store row data, the history table columns and system-period temporal table columns must have the same names, order, and data types. You can create a history table with the same names and descriptions as the columns of the system-period temporal table by using the LIKE clause of the CREATE TABLE statement, for example:




    0



    0
  2. Chow, Kenneth KY says:

    To add a system period to a table and define system-period data versioning:

    Issue the ALTER TABLE statement on the base table to alter or add row-begin, row-end, and transaction-start-ID columns, and to define the system period. After you alter the table, it must have the following attributes:
    A row-begin column that is defined as TIMESTAMP(12) NOT NULL with the GENERATED ALWAYS AS ROW BEGIN attribute.
    A row-end column that is defined as TIMESTAMP(12) NOT NULL with the GENERATED ALWAYS AS ROW END attribute.
    A system period (SYSTEM_TIME) defined on two timestamp columns. The first column is the row-begin column and the second column is the row-end column.
    A transaction-start-ID column that defined as TIMESTAMP(12) NOT NULL with the GENERATED ALWAYS AS TRANSACTION START ID attribute.
    The only table in the table space
    The table definition is complete
    Issue a CREATE TABLE statement to create a history table that will correspond with the system-period temporal table. The history table must have the following attributes:
    The same number of columns as the system-period temporal table that it corresponds to
    Columns with the same names, data types, null attributes, CCSIDs, subtypes, hidden attributes, and field procedures as the corresponding system-period temporal table. However, the history table cannot have any GENERATED ALWAYS columns unless the system-period temporal table has a ROWID GENERATED ALWAYS or ROWID GENERATED BY DEFAULT column. In that case, the history table must have a corresponding ROWID GENERATED ALWAYS column. .
    The only table in the table space
    The table definition is complete
    A history table cannot be a materialized query table, an archive-enabled table, or an archive table, cannot have a clone table defined on it, and cannot have the following attributes:
    Identity columns or row change timestamp columns
    ROW BEGIN, ROW END, or TRANSACTION START ID columns
    Column masks
    Row permissions
    Security label columns
    System or application periods
    Issue the ALTER TABLE ADD VERSIONING statement with the USE HISTORY TABLE clause to define system-period data versioning on the table. This step establishes a link between the system-period temporal table and the history table.




    0



    0

Leave a Reply