Creates a database user authorization identifier, which consists of a user name and optional password. When you form the CREATE AUTHORIZATION statement, you can also assign the new user to a default schema. After you commit the CREATE AUTHORIZATION statement, you can connect to the database with the new user.
The user name argument must be unique in the database. The user name can be up to 128 characters long and cannot be "PUBLIC" or "DBA."
The password argument is optional. If you include a password argument in the CREATE AUTHORIZATION statement, the password must be preceded by
PASSWORD
. The password can be up to 128 characters long and is case-sensitive. You must enter the password every time the user connects to the database.
If you do not include a password argument in the CREATE AUTHORIZATION statement, the password has a null value and you will not need to enter a password when you connect to the database.
Optionally, you can assign the user to a default schema. If you include a DEFAULT SCHEMA clause in the CREATE AUTHORIZATION statement, the specified schema is always the initial schema for the user when the user connects to the database. If you do not include a DEFAULT SCHEMA clause, the initial schema for the user is the PUBLIC schema.
If you specify a schema in the DEFAULT SCHEMA clause that does not already exist in the database, Data Vault creates the schema and assigns the new user OWNER privileges with the GRANT option on the schema. If the DEFAULT SCHEMA you specify already exists in the database, Data Vault assigns the new user OWNER privileges without the GRANT option.
The following statement creates a user authorization called
user1
with the password
pass
:
CREATE AUTHORIZATION user1 PASSWORD 'pass';
The following statement creates the user authorization
u1
with a null password, and makes the default schema for the user
vip
:
CREATE AUTHORIZATION u1 DEFAULT SCHEMA vip;