DCL (Data Control Language) : Grant (๊ถํ ๋ถ์ฌ), Revoke (๊ถํ ์์ฑ)
-- *********** ์์คํ
์ธ์
์ผ๋ก ์คํ *************
CREATE USER USER02 IDENTIFIED BY USER02; -- USER02 ๊ณ์ ์์ฑ ํ
GRANT CONNECT, RESOURCE TO USER02; -- ๊ถํ ๋ถ์ฌ (์ ์๊ถํ, ์์ฑ๊ถํ)
-- *********** ์์คํ
์ธ์
์ผ๋ก ์คํ *************
-- ์ธ๋ถ ๊ถํ ๋ถ์ฌ
GRANT SELECT ON USER01.COFFEE TO USER02;
GRANT INSERT ON USER01.COFFEE TO USER02;
-- GRANT๋ฅผ ์ฑ๊ณตํ์ต๋๋ค. ๊ถํ ๋ถ์ฌ
-- *********** USER02 ์ธ์
์ผ๋ก ์คํ *************
SELECT * FROM USER01.COFFEE;
INSERT INTO USER01.COFFEE VALUES('์นด๋์ปคํผ', 1500, '์นด๋');
INSERT INTOUSER01.COFFEE VALUES('๋ฉ๋จธ๋์ปคํผ', 1500, '๋ฉ๋จธ๋');
COMMIT; -- COMMIT์ ํด์ค์ผ ๋ค๋ฅธ ๊ณณ์์๋ ์์ ๋ ๋ด์ฉ์ ๋ณผ ์ ์์
-- *********** ์์คํ
์ธ์
์ผ๋ก ์คํ *************
REVOKE SELECT ON USER01.COFFEE FROM USER02;
REVOKE INSERT ON USER01.COFFEE FROM USER02;
-- REVOKE๋ฅผ ์ฑ๊ณตํ์ต๋๋ค. ๊ถํ ํ์