CREATE USER|ROLE… PROFILE MANAGEMENT CLAUSES v13
Name
CREATE USER|ROLE
Synopsis
CREATE USER|ROLE <name> [[WITH] option […]]
where option can be the following compatible clauses:
PROFILE <profile_name>
| ACCOUNT {LOCK|UNLOCK}
| PASSWORD EXPIRE [AT '<timestamp>']or option can be the following non-compatible clauses:
| LOCK TIME '<timestamp>'
For information about the administrative clauses of the CREATE USER or CREATE ROLE command that are supported by Advanced Server, see the PostgreSQL core documentation available at:
https://www.postgresql.org/docs/current/static/sql-commands.html
Description
CREATE ROLE|USER… PROFILE adds a new role with an associated profile to an Advanced Server database cluster.
Roles created with the CREATE USER command are (by default) login roles. Roles created with the CREATE ROLE command are (by default) not login roles. To create a login account with the CREATE ROLE command, you must include the LOGIN keyword.
Only a database superuser can use the CREATE USER|ROLE clauses that enforce profile management; these clauses enforce the following behaviors:
Include the
PROFILEclause and aprofile_nameto associate a pre-defined profile with a role, or to change which pre-defined profile is associated with a user.Include the
ACCOUNTclause and theLOCKorUNLOCKkeyword to specify that the user account should be placed in a locked or unlocked state.Include the
LOCK TIME 'timestamp'clause and a date/time value to lock the role at the specified time, and unlock the role at the time indicated by thePASSWORD_LOCK_TIMEparameter of the profile assigned to this role. IfLOCK TIMEis used with theACCOUNT LOCKclause, the role can only be unlocked by a database superuser with theACCOUNT UNLOCKclause.Include the
PASSWORD EXPIREclause with the optionalAT 'timestamp'keywords to specify a date/time when the password associated with the role will expire. If you omit theAT 'timestamp'keywords, the password will expire immediately.
Each login role may only have one profile. To discover the profile that is currently associated with a login role, query the profile column of the DBA_USERS view.
Parameters
name
The name of the role.
profile_name
The name of the profile associated with the role.
timestamp
The date and time at which the clause will be enforced. When specifying a value for timestamp, enclose the value in single-quotes.
Examples
The following example uses CREATE USER to create a login role named john who is associated with the acctg_profile profile:
CREATE USER john PROFILE acctg_profile IDENTIFIED BY “1safepwd”;
john can log in to the server, using the password 1safepwd.
The following example uses CREATE ROLE to create a login role named john who is associated with the acctg_profile profile:
CREATE ROLE john PROFILE acctg_profile LOGIN PASSWORD “1safepwd”;
john can log in to the server, using the password 1safepwd.
See Also