CREATE DATABASE

Use the CREATE DATABASE command with the added COLLECT HISTORY clause.

Synopsis

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

Inputs

The CREATE DATABASE command has the following inputs:
Table 1. CREATE DATABASE inputs
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. This is the default.
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 CREATE DATABASE command has the following output:
Table 2. CREATE 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 CREATE DATABASE command, see theIBM® Netezza® Database User’s Guide. The CREATE DATABASE command has the following characteristics:
Privileges required
None.
Common tasks
In addition to its previous functions, the command assigns the collect history to the database object.

Usage

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