At this note; I will teach you how you can create a simple Oracle user. In fact there are many types of Oracle users , but at this note we only discuss about simple Oracle users.
To create an Oracle user first you need CREATE USER privilege. When you create a new database ; SYS user has DBA role and consequently has CREATE USER privilege.
Now check which users have CREATE USER privilege with the below query;
select grantee from dba_sys_privs where privilege=’CREATE USER’;
At the simplest way you can create an Oracle user with the below command. This command work on Oracle 11g and Oracle 12c databases.
CREATE USER test01
IDENTIFIED BY oracle
DEFAULT TABLESPACE users
QUOTA 500K ON users
TEMPORARY TABLESPACE temp
This command was run by SYS user. You can find all details about CREATE USER command at Oracle documents.
After creating an Oracle user ; you should give CREATE SESSION privilege to the user. By this way your created user can connect to Oracle database. Otherwise It can not connect to the database.
SQL> Grant CREATE SESSION to test01;
As you see; this user has very simple password. Simple passwords are not a good way to protect our users. The complex passwords is the first defense line to protect our databases. User password should be complex to predict by others. This is the first very important rule to protect our databases. At the same time you should not share the passwords with other persons. The passwords should only be known with the person to know. And you should change the passwords periodically.
Put in a nut shell.
The simple rules to protect Database users is to manage user passwords correctly with below methods.
- Use complex passwords
- Do not share your passwords
- The passwords should only be known with the person to know
- Change your passwords periodically.
At the next notes I will write about how we can achive these goals.