Create User(s) Script

You can use this SQL script to create a user in an Oracle database. Simply change out “new_user” for the name of the user, enter a password and run the script in your favorite client.

DROP USER new_user CASCADE;

CREATE USER new_user
IDENTIFIED BY <password>
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
— 2 Roles for new_user
GRANT DBA TO new_user WITH ADMIN OPTION;
GRANT CONNECT TO new_user WITH ADMIN OPTION;
ALTER USER new_user DEFAULT ROLE ALL;
— 1 System Privilege new_user
GRANT UNLIMITED TABLESPACE TO new_user WITH ADMIN OPTION;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s