CREATE SYSTEM TRIGGER Statement (create_system_trigger_statement)

The CREATE SYSTEM TRIGGER statement (create_system_trigger_statement) defines a trigger for restart.

Syntax

<create_system_trigger_statement> ::=
  CREATE SYSTEM TRIGGER [<
schema_name>.]<trigger_name> AFTER RESTART EXECUTE (<routine>)

Explanation

A system trigger is a special database procedure performed implicitly during a restart. This is executed at a point when, though the database instance has been fully started, connections are still not possible.

If a schema is not specified before the trigger name, the current schema is implicitly assumed. The trigger is assigned to the schema that has been determined implicitly or specified explicitly.

The current user must be a database administrator. He or she becomes the owner of the system trigger.

The current user must have the CREATEIN privilege for this schema. The trigger name must be different from the names of all the trigger names already existing in the schema.

If more than one system trigger is defined in the database, these are executed in a random order.

<routine>

If STOP results in an error number other than null, restart fails. The database instance is only possible in such cases if the system triggers are deactivated (ENABLE_SYSTEM_TRIGGERS database parameter).