The CREATE SYSTEM TRIGGER statement (create_system_trigger_statement) defines a trigger for the restart.
Syntax
<create_system_trigger_statement> :: CREATE SYSTEM TRIGGER [<schema_name>.]<trigger_name> AFTER RESTART EXECUTE (<routine>)
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.
The current user must be a database administrator. He or she becomes the owner of the system trigger. 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 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.
If STOP ends the trigger with an error number other than null, restart fails. Restarting the database instance is only possible in such cases if the system triggers are deactivated (Support Database Parameters UseSystemTriggers).