Selasa, 24 Februari 2015

Oracle Create User

Create User Privileges Oracle XE

Setelah oracle XE berhasil anda install, apa yang harus anda lakukan ? paling tidak ada beberapa yaitu:
  • Create User / Schema
  • Set Privileges User
Berikut tahapan-tahapannya :
  1. Login dengan user sys ( sysdba )
    SQL*Plus: Release 11.2.0.2.0 Production on Jum Nop 30 15:40:06 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    SQL>
    
  2. Buat User ( Schema )

    Pada contoh ini buat user schema : rojulman dengan password passrojul
    SQL> create user rojulman identified by passrojul;
    User created.
    
  3. Unlock user
    SQL> alter user rojulman account unlock;
    User altered.
    
  4. GRANT session user
    SQL> grant create session to rojulman;
    Grant succeeded.
    
  5. GRANT PRIVILEGES user
    SQL> grant all privilege to rojulman;
    Grant succeeded.
    
  6. Tes user login dan create table
    SQL> connect rojulman
    Enter password:
    Connected.
    SQL> create table departemen(
      2  id integer primary key,
      3  nama varchar(40) unique
      4  );
    
    Table created.
    
    SQL> desc departemen;
     Name                                      Null?    Type
     ----------------------------------------- -------- --------
    
     ID                                        NOT NULL NUMBER(38)
     NAMA                                               VARCHAR2(40)
    
    SQL>

Tidak ada komentar:

Posting Komentar