Saturday, November 8, 2008

How to create user in Oracle

To create a user which is administration task , cuurent logged in user must have DBA (Data base Administration) Priviliges.
Open sql plus and log in with a user which is having DBA Priviliges.
After logging in into sql plus there are sql commands which are used to create a user.

Syntax:- Create user (User name) identified by (Password);
Example :- Create user test identified by test;

After creating a user we should assign priviliges or roles to the created user.
Syntax:- Grant (rolename) to (username);
Example :- Grant resource,connect,dba to test;
Once the user is created successfully and roles are granted we use that user.
While logging in with the user created above,
Syntax :- Username/Password@cSchemaName
Example :- test/test@(current schema name).

To drop an existing user,
Drop user (username) cascade;
Example :- drop user test cascade;

No comments: