μ¬μ©μ κ³μ μμ±
κ³μ μμ±νκΈ°
β’
11g λ²μ μ΄ν : μ΄λ€ μ΄λ¦μΌλ‘λ κ³μ μμ± κ°λ₯
β’
12c λ²μ μ΄μ : βc##β μ λμ΄λ₯Ό λΆμ¬μ κ³μ μ μμ±νλλ‘ μ μ±
μ μ ν¨
β¦
μλ μ€λ₯ λ°μ
ORA-65096: κ³΅ν΅ μ¬μ©μ λλ λ‘€ μ΄λ¦μ΄ λΆμ ν©ν©λλ€.
65096. 00000 - "invalid common user or role name"
c## μμ΄ κ³μ μμ±
ALTER SESSION SET "_ORACLE_SCRIPT" = TRUE;
SQL
볡μ¬
HR κ³μ μμ±
-- CREATE USER κ³μ λͺ
IDENTIFIED BY λΉλ°λ²νΈ;
CREATE USER HR IDENTIFIED BY 123456;
SQL
볡μ¬
ν μ΄λΈ μ€νμ΄μ€ λ³κ²½
β’
HR κ³μ μ κΈ°λ³Έ ν
μ΄λΈ μμμ βusersβ μμμΌλ‘ μ§μ
-- ALTER USER κ³μ λͺ
DEFAULT TABLESPACE users;
ALTER USER HR DEFAULT TABLESPACE users;
SQL
볡μ¬
κ³μ μ΄ μ¬μ©ν μ μλ μ©λ μ€μ
β’
HR κ³μ μ μ¬μ© μ©λμ 무νλλ‘ μ§μ
-- ALTER USER κ³μ λͺ
QUOTA UNLIMIED ON ν
μ΄λΈμ€νμ΄μ€;
ALTER USER HR QUOTA UNLIMITED ON users;
SQL
볡μ¬
κ³μ μ κΆνμ λΆμ¬
β’
HR κ³μ μ connect, resource κΆνμ λΆμ¬
-- GRANT κΆνλͺ
1, κΆνλͺ
2 TO κ³μ λͺ
;
GRANT connect, resource TO HR;
SQL
볡μ¬
κΈ°λ³Έ κ³μ μμ±
β’
HR κ³μ μ μμ±νκ³ , κΈ°λ³Έ μ€μ ν κΆν λΆμ¬
ALTER SESSION SET "_ORACLE_SCRIPT" = TRUE;
CREATE USER HR IDENTIFIED BY 123456;
ALTER USER HR DEFAULT TABLESPACE users;
ALTER USER HR QUOTA UNLIMITED ON users;
GRANT connect, resource TO HR;
SQL
볡μ¬
κ³μ μμ
β’
HR κ³μ μμ
-- DROP USER κ³μ λͺ
[CASCADE];
DROP USER HR CASCADE;
SQL
볡μ¬
κ³μ μ κΈ ν΄μ
-- ALTER USER κ³μ λͺ
ACCOUNT UNLOCK;
ALTER USER HR ACCOUNT UNLOCK;
SQL
볡μ¬