ALTER DATABASE

Use the ALTER DATABASE command with the added COLLECT HISTORY clause to specify history collection for the databases and the users who are connected to it.

Synopsis

Syntax for altering a DATABASE:
ALTER DATABASE <database-name> [<ALTER-db-clause>]...
<ALTER-db-clause> ::=
            ... existing clauses ...
        |   COLLECT HISTORY { ON | OFF | DEFAULT }

Inputs

The ALTER DATABASE command has the following input:
Table 1. ALTER DATABASE input
Input Description
COLLECT HISTORY [ ON | OFF | DEFAULT ] Specifies whether history data is to be collected for sessions attached to this database.
ON
History is collected only if the user is a member of at least one group for which COLLECT HISTORY is set to ON.
OFF
History is not collected for the database.
DEFAULT
History is collected for the database only if the user is a member of at least one group for which COLLECT HISTORY is set to ON and if one of the following criteria apply:
  • The user is not a member of any user group.
  • All the user groups of which the user is a member have COLLECT HISTORY set to DEFAULT.
  • The user is a member of at least one user group that has COLLECT HISTORY set to ON.

Outputs

The ALTER DATABASE command has the following output:
Table 2. ALTER DATABASE output
Output Description
ERROR: permission denied. You must have Manage Security privilege to set a database history collection attribute.

Description

For details about all the options of the ALTER DATABASE command, see theIBM® Netezza® Database User’s Guide. The ALTER DATABASE command has the following characteristics:
Privileges required
You must be the admin user, the database owner, or your account must have the Alter privilege for the database or for the Database object class. You must have Manage Security privilege to alter the history collection attribute of a database.
Common tasks
In addition to its previous functions, the command assigns the collect history to the database object.

Usage

The following provides sample usage:
ALTER DATABASE SECRET COLLECT HISTORY ON;