Teori Data Control Language
Teori Data Control Language
A. CREATE USER
- Membuat user
CREATE USER namausername IDENTIFIED BY password;
C. DAFTAR PREVILAGE
ALTER ANY CACHE GROUP Enables a user to alter any cache group in the
database.
Privilege Description
ALTER ANY INDEX Enables a user to alter any index in the database.
Note: There is no ALTER INDEX statement.
ALTER ANY MATERIALIZED Enables a user to alter any materialized view in the
VIEW
database. Note: There is no ALTER MATERIALIZED
VIEW statement.
ALTER ANY TABLE Enables a user to alter any table in the database.
ALTER ANY VIEW Enables a user to alter any view in the database.
Note: There is no ALTER VIEW statement.
CREATE ANY CACHE GROUP Enables a user to create a cache group owned by
any user in the database.
CREATE ANY TABLE Enables a user to create a table owned by any user
in the database.
CREATE ANY VIEW Enables a user to create a view owned by any user
in the database.
Privilege Description
CREATE CACHE GROUP Enables a user to create a cache group owned by
that user.
DELETE ANY TABLE Enables a user to delete from any table in the
database.
DROP ANY CACHE GROUP Enables a user to drop any cache group in the
database.
DROP ANY INDEX Enables a user to drop any index in the database.
DROP ANY MATERIALIZED VIEW Enables a user to drop any materialized view in the
database.
DROP ANY TABLE Enables a user to drop any table in the database.
DROP ANY VIEW Enables a user to drop any view in the database.
FLUSH ANY CACHE GROUP Enables a user to flush any cache group in the
database.
INSERT ANY TABLE Enables a user to insert into any table in the
database. It also enables the user to insert into any
table using the synonym, public or private, to that
table.
LOAD ANY CACHE GROUP Enables a user to load any cache group in the
database.
REFRESH ANY CACHE GROUP Enables a user to flush any cache group in the
database.
SELECT ANY TABLE Enables a user to select from any table, view,
materialized view, or synonym in the database.
UNLOAD ANY CACHE GROUP Enables a user to unload any cache group in the
database.
PREVILAGE TABLE
Privilege Description
Kegiatan Praktikum
Kegiatan praktikum pada pertemuan hari ini akan difokuskan ke pembuatan username dan
memberikan hak akses kepada user tersebut. Adapun lankah-langkah nya adalah sebagai
berikut:
1. Untuk membuat username baru kita harus login dulu sebagai administrator database
karena yang memiliki akses penuh adalah administrator. Buka SQL plus. Masuk sebagai
system, dan untuk password nya ketikkan sama seperti yang kita ketikkan sewaktu
proses instalasi oracle
2. Kita akan membuat user dengan nama oracleUser dan password oraclePassword.
Ketikkan perintah berikut
3. Cek didalam tabel all_users untuk melihat user yang dibuat telah berhasil
5. Buka SQL Plus pada jendela baru untuk mencoba login user baru. Masuk sebagai
oracleUser dan ketikkan password sesuai dengan yang telah di tentukan sebelumnya
Akan muncul warning bahwasanya user tidak bisa login karen belum mempunyai akses
session previlage. Karena secara default didalam oracle user yang pertama kalinya
dibuat tidak mempunyai hak ases sama sekali. Untuk itu perlu ditambahkan previlage.
Yang berhak untuk menambahkan previlage adalah administrator database.
6. Kita kembali ke login sebagai system. Kita akan menambahkan previlage session
ketikkan perintah
8. Pencabuatan Previlage bisa dilakukan dengan REVOKE. Misalkan kita akan mencabut
previlage create session dari user userOracle. Maka kita bisa ketikan perintah sebagai
berikut diSQL
9. REVOKE create session FROM oracleUser;
10. Cara diatas dapat digunakan untuk memberikan atau mengilangkan PREVILAGE yang
lain.
Tugas Praktikum
1. Buatlah user di oracle sebanyak anggota kelompok
Masing-masing user berikanlah previlage sebagai berikut
a. Superuser (system)
b. User 1 : create table, dan alter tabel
c. User 2 : Insert, update row
d. User 3 : select table
2. Buatlah rancangan database (ER-Diagram) sistem informasi kesehatan yang didalamnya
terdapat minimal satu buah relasi one to one, one to many, many to many