Search

DCL - ๋ฐ์ดํ„ฐ ์ œ์–ด์–ด

SQL - DCL (Data Control Language)

: ๋ฐ์ดํ„ฐ ์ œ์–ด์–ด

โ–ช
GRANT
โ–ช
REVOKE

๊ถŒํ•œ ๋ถ€์—ฌ

GRANT ๊ถŒํ•œ1, ๊ถŒํ•œ2, ... TO ์‚ฌ์šฉ์ž๋ช…;
SQL
๋ณต์‚ฌ

๊ถŒํ•œ

: ์‚ฌ์šฉ์ž ์ƒ์„ฑ ๋ฐ ๊ด€๋ฆฌ, ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ž์›์„ ์ƒ์„ฑ ๋ฐ ๊ด€๋ฆฌํ•˜๋Š” ๊ถŒํ•œ

๊ถŒํ•œ ์ข…๋ฅ˜

โ€ข
USER : CREATE USER, ALTER USER, DROP USER
โ€ข
SESSION : CREATE SESSION, ALTER SESSION
โ€ข
TABLE : CREATE TABLE, ALTER TABLE, DROP ANY TABLE SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
โ€ข
INDEX : CREATE ANY INDEX, ALTER ANY INDEX, DROP ANY INDEX
โ€ข
VIEW : ...
โ€ข
SEQUENCE : ...
โ€ข
SYNONYM : ...
๋กค (ROLE)
: ์—ฌ๋Ÿฌ ๊ถŒํ•œ์„ ํ•˜๋‚˜๋กœ ๋ฌถ์–ด๋†“์€ ๊ทธ๋ฃน๊ถŒํ•œ
โ€ข
๋กค์„ ์ด์šฉํ•˜๋ฉด, ์—ฌ๋Ÿฌ ๊ถŒํ•œ์„ ํ•œ ๋ฒˆ์— ๋ถ€์—ฌํ•˜๊ณ , ํ•ด์ œํ•  ์ˆ˜ ์žˆ๋‹ค.
์‚ฌ์ „ ์ •์˜ ๋กค
โ€ข
CONNECT : ALTER SESSION, CREATE CLUSTER, CREATE DATABASE LINK, CREATE SEQUENCE, CREATE SESSION, CREATE SYNONYM, CREATE TABLE, CREATE VIEW
โ€ข
RESOURCE : CREATE TRIGGER, CREATE SEQUENCE, CREATE TYPE, CREATE PROCEDURE, CREATE CLUSTER, CREATE OPERATOR, CREATE INDEXTYPE, CREATE TABLE
โ€ข
DBA : ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ์‹œ์Šคํ…œ ๊ถŒํ•œ์˜ ๋Œ€๋ถ€๋ถ„

๊ถŒํ•œ ๋ถ€์—ฌ - GRANT

GRANT ๊ถŒํ•œ TO ์‚ฌ์šฉ์ž๋ช… [WITH ADMIN OPTION];
SQL
๋ณต์‚ฌ
GRANT ๊ถŒํ•œ ON ์Šคํ‚ค๋งˆ.๊ฐ์ฒด TO ์‚ฌ์šฉ์ž๋ช… [WITH GRANT OPTION];
SQL
๋ณต์‚ฌ
โ€ข
WITH ADMIN OPTION, WITH GRANT OPTION : ๋ถ€์—ฌ๋ฐ›์€ ๊ถŒํ•œ์„ ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž์—๊ฒŒ ์žฌ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ๊นŒ์ง€ ๋ถ€์—ฌ
โ€ข
ALL PRIVILEGES : ๋ชจ๋“  ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•˜๋Š” ํ‚ค์›Œ๋“œ

๊ถŒํ•œ ํ•ด์ œ - REVOKE

REVOKE ๊ถŒํ•œ FROM ์‚ฌ์šฉ์ž๋ช…;
SQL
๋ณต์‚ฌ
REVOKE ๊ถŒํ•œ ON ์Šคํ‚ค๋งˆ.๊ฐ์ฒด FROM ์‚ฌ์šฉ์ž๋ช… [CASCADE | FORCE | RESTRICT];
SQL
๋ณต์‚ฌ
โ€ข
CASCADE : ์ข…์†๋œ ์‚ฌ์šฉ์ž ๊ถŒํ•œ์ด ์žˆ๋‹ค๋ฉด ๊ฐ™์ด ํ•ด์ œ
โ€ข
RESTRICT : ์ข…์†๋œ ์‚ฌ์šฉ์ž ๊ถŒํ•œ์ด ์žˆ๋‹ค๋ฉด ๊ถŒํ•œ ํ•ด์ œ๋ฅผ ๋ฐฉ์ง€
โ€ข
FORCE : ์‚ฌ์šฉ์ž ์ •์˜์— ๋Œ€ํ•œ ์‹คํ–‰ ๊ถŒํ•œ์„ ์ทจ์†Œ