Dropping a system-period temporal table also drops its associated history table and any indexes defined on the history table.
A history table is implicitly dropped when its associated system-period temporal table is dropped. A history table cannot be explicitly dropped by using the DROP statement.
To avoid losing historical data when a system-period temporal table is dropped, you can either create the history table with the RESTRICT ON DROP attribute or alter the history table by adding the RESTRICT ON DROP attribute. If you try to drop a system-period temporal table and its history table has the RESTRICT ON DROP attribute, the drop of the system-period temporal table fails (SQLSTATE 42893). In such cases, you must break the link between the system-period temporal table and the history table by removing the VERSIONING attribute and then rerun the DROP statement.
When a table is altered to drop VERSIONING, all packages with the versioning dependency on the table are invalidated. Other dependent objects, for example, views or triggers are marked invalid 'N' in the system catalog. Auto-revalidation is done. Any objects failing revalidation are left as invalid in the catalog. Some objects can become valid after only explicit user action.
To drop a system-period temporal table and its associated history table:
Dropping table spaces
DROP TABLESPACE hist_space;
If
table space that contains a history table and the table space containing
the associated system-period temporal table are included together,
then the statement is allowed. For example, the following statement
would succeed:DROP TABLESPACE policy_space hist_space;
A
history table is implicitly dropped when the table space for its associated
system-period temporal table is dropped. For example, the following
statement would drop the hist_policy_info history
table:DROP TABLESPACE policy_space;