www.articlescloud.com
An Oracle Course - Feedback
 

How to Create user [Oracle SQL]

CREATING USERS IN ORACLE

 

 

The (Oracle) SQL statement create user creates a user.
In the most simple form, the create user statement is as follows:
create user dan identified by pwd;
create user dan identified externally;
create user dan identified globally as 'external_name';
The first one creates a local user, the second one creates an external user while the last one creates a global user.

Default tablespaces

When a user is created, his default tablespace as well as his temporary tablespace can be specified.
create user          dan
identified by        pwd
default   tablespace ts_u
temporary tablespace ts_t;

Locked users

SQL> create user dan identified by password account lock;
The user is now created, he can be granted the right to connect to the database:
SQL> grant connect to dan;
Now, if the user tries to connect to the database, he will get ORA-28000:
SQL> connect dan/password
ERROR:
ORA-28000: the account is locked
The user can now be unlocked with an alter user statement:
SQL> alter user dan account unlock;
Which allows dan to log on to the database now:
SQL> connect dan/passw0rd
Connected.

Restrictions on passwords

The following restrictions apply to a password: