/* Multi Line Comments */
-- Single Line Comment
-- 유저생성
-- CREATE USER [USER_NAME]
-- IDENTIFIED BY [PASSWORD];
CREATE USER INHA
IDENTIFIED BY "1234";
--CONNECT
GRANT CREATE SESSION TO INHA;
--유저 삭제
DROP USER INHA;
SELECT USERNAME, ACCOUNT_STATUS FROM DBA_USERS;
-- TEST1 USER 생성
-- 1. TEST1/1234
-- 2. DEFAULT TABLESPACE ( 데이터들이 저장 될 테이블을 지정 )
-- 3. LOCK/UNLOCK
-- ** ROLE **
-- CONNECT : CREATE SESSION
-- RESOURCE : 개발자들을 위한 롤
-- DBA : SYS바로 밑단계
-- 4. GRANT CONNECT, RESOURCE
CREATE USER TEST1
IDENTIFIED BY "1234"
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
ACCOUNT LOCK;
--GRANT
GRANT CONNECT, RESOURCE, DBA TO TEST1;
REVOKE DBA FROM TEST1;
--UNLOCK
ALTER USER TEST1
ACCOUNT UNLOCK;
--TEST1
SELECT * FROM USER_ROLE_PRIVS;
SELECT * FROM ROLE_SYS_PRIVS WHERE ROLE = 'RESOURCE';
SELECT * FROM ROLE_SYS_PRIVS WHERE ROLE = 'CONNECT';