목차

Oracle Database

Docker Images

Docker 로 설치

Table Space와 사용자 추가

-- Table Sapace 추가
CREATE TABLESPACE <tablespace_name> 
    DATAFILE '<tablespace_name>.dbf' 
    SIZE 100M 
    AUTOEXTEND ON NEXT 10M;
 
CREATE USER <username> IDENTIFIED BY <password>
    DEFAULT TABLESPACE <tablespace_name>
    QUOTA UNLIMITED ON <tablespace_name>
    TEMPORARY TABLESPACE TEMP;
 
 
GRANT CONNECT, RESOURCE TO <username>;

Version 확인

SELECT * FROM V$VERSION;
SELECT version FROM V$INSTANCE;

charset / characterset

SELECT * FROM nls_database_parameters WHERE parameter LIKE '%CHARACTERSET%'; 
-- NLS_CHARACTERSET : AL32UTF8
-- NLS_NCHAR_CHARACTERSET : AL16UTF16
 
SELECT VALUE$ FROM sys.props$ WHERE name='NLS_LANGUAGE';
SELECT * FROM nls_database_parameters WHERE parameter = 'NLS_LANGUAGE'
-- AMERICAN
UPDATE props$ SET VALUE$='KO16MSWIN949' WHERE name='NLS_CHARACTERSET';
UPDATE props$ SET VALUE$='AL16UTF16' WHERE name='NLS_NCHAR_CHARACTERSET';
UPDATE sys.props$ SET VALUE$='KOREAN_KOREA.UTF8' WHERE name='NLS_LANGUAGE';
commit;
 
-- 모든 데이터베이스에 일괄 적용. 아래 작업을 안하면 오류 발생했음.
-- ORA-06552: PL/SQL: Compilation unit analysis terminated
-- ORA-06553: PLS-553: 알 수 없는 문자 집합 이름입니다
-- ORA-06553: PLS-553: character set name is not recognized
 
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
 
ALTER DATABASE CHARACTER SET INTERNAL_USE KO16MSWIN949;
ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE AL16UTF16;
 
-- 재시작
shutdown IMMEDIATE
startup

TIMEZONE

권한 Grant

기본 Role

Table 단위 권한 부여

-- 부여
GRANT SELECT, INSERT, DELETE, UPDATE ON [TABLE NAME] TO [USER];

-- 해제
REVOKE SELECT, INSERT, DELETE, UPDATE ON [TABLE NAME] FROM [USER];

Identifier too long