Tuesday, December 6, 2011

Creating a new user in Oracle 11g

Here's how you create a new user in Oracle 11g to get you started in a project:

1. Login as SYSTEM with the password you set during Oracle's installation.
2. Execute the following script:

CREATE USER myNewUser IDENTIFIED BY myPassword
       DEFAULT TABLESPACE users
       TEMPORARY TABLESPACE temp
       QUOTA UNLIMITED ON users;

CREATE ROLE conn;

GRANT CREATE session, CREATE table, CREATE view,
       CREATE procedure, CREATE synonym,
       ALTER any table, ALTER any materialized view, ALTER any procedure,
       DROP ANY table, DROP any view, DROP any procedure, DROP ANY synonym, CREATE sequence, DROP ANY sequence
       TO conn;

GRANT conn TO myNewUser;