What is the method for creating a user in Oracle and granting them privileges?
To create a user and assign permissions in an Oracle database, you can follow the steps below:
- Log in to the Oracle database using the system administrator account, such as sys or system.
- Establish a user with the name username and password as identification.
- user identifier
- secret code
- Grant permission to connect to the database: GRANT CONNECT TO username;
- Grant permission to create tables to a specific username.
- Grant permission to insert, update, and delete records: GRANT INSERT, UPDATE, DELETE ON table_name TO username;
- Grant the permission to select (query) on the table: GRANT SELECT ON table_name TO username;
- Grant full permissions to all objects: GRANT ALL PRIVILEGES TO username;
- Save changes and exit.
Please note that creating users and granting permissions require sufficient privileges. Additionally, in order to ensure the security of the database, only the minimum necessary permissions should be granted to new users.