How to create a user in Oracle database?
To create a user in an Oracle database, you can follow these steps: 1. Log in to the Oracle database as a system administrator or a role with permission to create users. 2. Execute the following SQL statement to create the user:
CREATE USER username IDENTIFIED BY password;
In this, `username` is the username to be created, and `password` is the user’s password. 3. Assign roles and permissions to the user. You can use the following statement to assign roles to the user:
GRANT role_name TO username;
role_name is the name of the role to be assigned to the user, and username is the name of the user to be assigned the role. One can use the following statement to assign system permissions to the user:
GRANT privilege_name TO username;
privilege_name` is the system privilege to be assigned to the user, `username` is the username to be assigned the privilege. Finally, remember to use the `COMMIT;` statement to commit the changes. This successfully creates a user in the Oracle database.