CREATE USER

Create a user.

Syntax:

   CREATE USER username
      IDENTIFIED {BY password | EXTERNALLY | GLOBALLY AS 'external_name'}
         options;

options:
   
   DEFAULT TABLESPACE tablespace
   TEMPORARY TABLESPACE tablespace
   QUOTA int {K | M} ON tablespace
   QUOTA UNLIMITED ON tablespace
   PROFILE profile_name
   PASSWORD EXPIRE
   ACCOUNT {LOCK|UNLOCK}

EXAMPLES

-- Create a user with no rights to save data or create objects:

CREATE USER limited IDENTIFIED BY ChangeThis;


-- Create a user with full rights to create objects and save data:

DROP USER MySchemaOwner CASCADE;

CREATE USER MySchemaOwner IDENTIFIED BY ChangeThis
       DEFAULT TABLESPACE data  
       TEMPORARY TABLESPACE temp
       QUOTA UNLIMITED ON data;

CREATE ROLE conn;

GRANT CREATE session, CREATE table, CREATE view, 
      CREATE procedure,CREATE synonym,
      ALTER table, ALTER view, ALTER procedure,ALTER synonym,
      DROP table, DROP view, DROP procedure,DROP synonym,
      TO conn;

GRANT conn TO MySchemaOwner;

You have to create a user first before you can GRANT permissions, roles or assign a default ROLE.

"If you bungle raising your children, I don't think whatever else you do well matters very much" ~ Jacqueline Kennedy Onassis

Related Commands:

ALTER USER DEFAULT ROLE
DROP USER
GRANT

Related Views:

                                           USER_PASSWORD_LIMITS  
                                                                SESSION_ROLES
                                                                SESSION_PRIVS
                                                                SESSION_CONTEXT
 DBA_TS_QUOTAS                             USER_TS_QUOTAS
 DBA_USERS            ALL_USERS            USER_USERS

 V$SESSION
 V$SESSION_CONNECT_INFO
  


© Copyright SS64.com 1999-2014
Some rights reserved