User Management

You can create, modify, or remove users in the Oracle NoSQL Database through the SQL CLI, where the commands for manipulating users are exposed in SQL format through DDL API. To start the SQL CLI, see Starting the SQL shell. You can also display information about a specific user account, as well as get a summary list of registered users. For more information, see the next sections describing each user management operation.

All user passwords should follow the password security policies. For more information see Password Complexity Policies.

User Creation

To create a user, use the following command:

CREATE USER user_name
 (IDENTIFIED BY password
  [PASSWORD EXPIRE | PASSWORD LIFETIME duration_time_unit])
  [ACCOUNT LOCK|UNLOCK]
  [ADMIN]

where:

User Modification

To alter a user, use the following command:

ALTER USER user_name [IDENTIFIED BY password
[RETAIN CURRENT PASSWORD]] [CLEAR RETAINED PASSWORD] [PASSWORD EXPIRE]
[PASSWORD LIFETIME duration] [ACCOUNT UNLOCK|LOCK]

where:

If you are updating the password of an existing user, the new password should comply with the password security policies. For more information see Password Complexity Policies.

User Removal

DROP USER user_name [CASCADE]

Use the DROP USER user_name command to remove the specified user account (users cannot remove themselves), where user_name is the name of the user to drop.

If the user has existing tables, drop each of the tables first, and then drop the user. Alternatively, use the optional CASCADE option, which drops the user tables along with the user.

For example:

sql->drop USER Kate cascade;

Dropping a user occurs immediately. If another user was accessing tables that the user owned, the tables are no longer available for DML or DDL operations.

User Status

SHOW [AS JSON] USERS| USER user_name

For example:

sql->show users;
user:KVStoreUser[id=u3 name=Alice]
user:KVStoreUser[id=u2 name=Kate]
user:KVStoreUser[id=u1 name=Ken]

Note: The User ID values are incremented sequentially as you add each user. They are an internal mechanism for ensuring each user is unique.

To view detailed information about a specific user:

sql-> show user Kate;
KVStoreUser[id=u2 name=Kate] enabled=true auth-type=LOCAL current-passwd-expiration=2026-05-04 11:20:56 UTC retain-passwd=inactive granted-roles=[public, readwrite]

User Login

You can use either the -username <user> or the -security <path to security file> argument to login to the SQL CLI. For more details on logging in to the SQL client, see Starting the SQL shell.