Laman

Minggu, 07 April 2013

coding grant and revoke

 CREATE USER PRAKTIKUM IDENTIFIED BY PRAKTIKUM;
 GRANT CONNECT TO PRAKTIKUM;
 GRANT RESOURCE TO PRAKTIKUM;

 CREATE USER PRAKTIKUM2 IDENTIFIED BY PRAKTIKUM2;
 GRANT CONNECT TO PRAKTIKUM2;
 GRANT RESOURCE TO PRAKTIKUM2;

 CREATE USER PRAKTIKUM3 IDENTIFIED BY PRAKTIKUM3;
 GRANT CONNECT TO PRAKTIKUM3;
 GRANT RESOURCE TO PRAKTIKUM3;

 *(PRAKTIKUM)*
 CREATE TABLE BIODATA(
 NPM VARCHAR(8) PRIMARY KEY,
 NAMA VARCHAR(20) NOT NULL,
 TANGGAL_LAHIR DATE);

 INSERT INTO BIODATA VALUES('11110654','ANRI SUGIHARA','08-JAN-1992');
 INSERT INTO BIODATA VALUES('12110945','HAYAMI AKARI','17-MAR-1995');
 INSERT INTO BIODATA VALUES('12110927','MAMI HARUNA ','18-SEP-92 ');

 SELECT NPM, NAMA, TANGGAL_LAHIR, TRUNC (MONTHS_BETWEEN (SYSDATE, TANGGAL_LAHIR) /12) AS UMUR FROM BIODATA;

 GRANT SELECT ON BIODATA TO PRAKTIKUM2;

 GRANT UPDATE (NAMA) ON BIODATA TO PRAKTIKUM3;

 *(PRAKTIKUM2)*
 SELECT * FROM PRAKTIKUM.BIODATA;

 *(PRAKTIKUM3)*
 UPDATE PRAKTIKUM.BIODATA SET NAMA='RIKA HIRASAWA' WHERE NPM='12110927'; 

 *(PRAKTIKUM)*
 SELECT * FROM BIODATA;

 *(PRAKTIKUM)*
 REVOKE SELECT ON BIODATA FROM PRAKTIKUM2;

 SELECT * FROM PRAKTIKUM.BIODATA;

Related Article:

0 komentar:

Posting Komentar


 

Gunadarma BAAK News

Gunadarma BAAK News

Gunadarma BAAK News

Total Tayangan Halaman

Pengikut

Powered By Blogger
Copyright 2010 Anggun Blogg's. All rights reserved.
Themes by Bonard Alfin l Home Recording l Distorsi Blog