When the user is connected to a database, USABLE_SPACES can also be set by using the following new syntax of the SET ENVIRONMENT statement:
.-,-----. V | >>-SET ENVIRONMENT USABLE_SPACES--+-'----space-+--'-+---------->< +-'DEFAULT SPACE'-+ +-DEFAULT---------+ +-MUTABLE---------+ '-IMMUTABLE-------'
Here space is the name of an existing dbspace or dbslice.
The list of spaces or the keyword that follows the USABLE_SPACES keyword has the following effect:
The SET ENVIRONMENT USABLE_SPACES statement affects only the current session.
By default, any user with Resource privilege can create database objects in any dbspace. In order for this feature to restrict where users create databases and database objects, USABLE_SPACES must be set prior to running any statements that create database objects, such as CREATE TABLE and CREATE INDEX, and the SET ENVIRONMENT USABLE_SPACES statement must be executed each time a new database is opened. The best method to ensure this is to create a sysdbopen( ) procedure for each user or PUBLIC that includes this statement.
To restrict where databases are created, USABLE_SPACES must either be set at the shell with the IBM_XPS_PARAMS environment variable, or else by creating the database while attached to a database where USABLE_SPACES has been set for the session by the SET ENVIRONMENT statement.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]