reset sysadmin argument: Move the sysadmin database (SQL administration API)

Use the reset sysadmin argument with the admin() or task() function to move the sysadmin database to the specified dbspace. Moving the sysadmin database resets the database back to the original state when it was first created; all data, command history, and results tables are lost. Only built-in tasks, sensors, and thresholds remain in the sysadmin tables.

Syntax


1  EXECUTE FUNCTION
1 admin
1 task
2  (
2  "reset sysadmin"?  , "dbspace"
2  ) ;
Element Description Key Considerations
dbspace The name of the dbspace.

Usage

This function has no equivalent utility command.

If you specify no dbspace as the last argument, this command drops the sysadmin database, and then re-creates it in the rootdbs. All ph_* table and command_history rows are deleted, and all results tables are dropped.

Examples

The following example drops the existing sysadmin database and creates a new sysadmin database in a dbspace named dbsp1:
EXECUTE FUNCTION task("reset sysadmin","dbs1");

The next example drops the sysadmin database, and then re-creates it in the rootdbs.

EXECUTE FUNCTION admin("reset sysadmin");

Except for the built-in tasks, sensors, and thresholds, all data rows are deleted from the ph_ tables and all results tables are dropped from sysadmin by this function call. The command_history table has no rows after the function completes execution.