Maintaining database server users (UNIX, Linux)

You can modify, drop, or rename a database server user account that was created with the CREATE USER statement.

Before you begin

Prerequisites:

  • You must have DBSA privileges.

About this task

To manage user accounts:

Procedure

Run one of the following statements, as appropriate:
  • Run the ALTER USER statement to change user properties such as user, password, groups, authorization privilege, home directory, and to enable or disable the account of an internally authenticated user, or of the default internally authenticated user.
  • Run the DROP USER statement to remove the user.
  • Run the RENAME USER statement to give the user a different name.
If you are a user whose account was created with the CREATE USER statement, you can run the SET USER PASSWORD statement to change your password.

Examples

To grant DBSA authorization to a user named foo, run the following statement:
ALTER USER foo ADD AUTHORIZATION (dbsa);
To remove the DBSA authorization from user foo, run the following statement:
ALTER USER foo DROP AUTHORIZATION (dbsa);

To remove a user named david, run this command:

DROP USER david

To give a user named ann the new name of ann2, run this command:

RENAME USER ann to ann2

To change a password to pwd3439 for a user named radha, run this command

ALTER USER radha MODIFY PASSWORD pwd3439

If you are a user, not a DBSA, you can change your password, for example, from js12342394 to jayal89, by running this command:

SET USER PASSWORD OLD js12342394 NEW jayal89