How to create a new schema/new user in Oracle Database 11g?

前端 未结 5 829
终归单人心
终归单人心 2021-01-29 17:03

I have applied for an internship in a company and as a question they have asked me to create a schema for their company with certain requirements and mail them the DDL

5条回答
  •  臣服心动
    2021-01-29 17:44

    SQL> select Username from dba_users
      2  ;
    
    USERNAME
    ------------------------------
    SYS
    SYSTEM
    ANONYMOUS
    APEX_PUBLIC_USER
    FLOWS_FILES
    APEX_040000
    OUTLN
    DIP
    ORACLE_OCM
    XS$NULL
    MDSYS
    
    USERNAME
    ------------------------------
    CTXSYS
    DBSNMP
    XDB
    APPQOSSYS
    HR
    
    16 rows selected.
    
    SQL> create user testdb identified by password;
    
    User created.
    
    SQL> select username from dba_users;
    
    USERNAME
    ------------------------------
    TESTDB
    SYS
    SYSTEM
    ANONYMOUS
    APEX_PUBLIC_USER
    FLOWS_FILES
    APEX_040000
    OUTLN
    DIP
    ORACLE_OCM
    XS$NULL
    
    USERNAME
    ------------------------------
    MDSYS
    CTXSYS
    DBSNMP
    XDB
    APPQOSSYS
    HR
    
    17 rows selected.
    
    SQL> grant create session to testdb;
    
    Grant succeeded.
    
    SQL> create tablespace testdb_tablespace
      2  datafile 'testdb_tabspace.dat'
      3  size 10M autoextend on;
    
    Tablespace created.
    
    SQL> create temporary tablespace testdb_tablespace_temp
      2  tempfile 'testdb_tabspace_temp.dat'
      3  size 5M autoextend on;
    
    Tablespace created.
    
    SQL> drop user testdb;
    
    User dropped.
    
    SQL> create user testdb
      2  identified by password
      3  default tablespace testdb_tablespace
      4  temporary tablespace testdb_tablespace_temp;
    
    User created.
    
    SQL> grant create session to testdb;
    
    Grant succeeded.
    
    SQL> grant create table to testdb;
    
    Grant succeeded.
    
    SQL> grant unlimited tablespace to testdb;
    
    Grant succeeded.
    
    SQL>
    

提交回复
热议问题