By default, we make a connection with the database by the username and password of any default user. But when we need to create any new database with separate database schema then it is necessary to use different username and password. You can create a new user from the command line by using SQL PLUS or from the graphical user interface by using SQL Developer. This tutorial will help you to learn the way of creating a new user for Oracle 12c from SQL Developer.
Create new database user
Follow the following steps to create a new Oracle database user.
- Open SQL Developer and create a new database connection with any default username and password. Click on the connect button to make the connection.
- Run the following SQL command before creating any new user for the newly created database to avoid SQL error. Click on the commit button for the confirmation.
alter session set “_ORACLE_SCRIPT”=true;
- From the left plane, expand the database connection and open the Other Users folder. Here, you will get the list of all existing username.
- Right click on the folder and select Create Users… from the pop-up menu.
- Type the username and password in user tab of create user dialog box.
- Set all permissions for admin in Granted Roles tab by clicking Admin All button.
- Click on the Apply button to complete the user creation task.
- Now disconnect the database.
- Connect again by using a new username and password.
If you face any problem then you can check the following video.
Your new database connection with the new user is now ready to use. Good Luck.