본문 바로가기

공부이야기/Oracle

[오라클] 11g XE 기본 세팅 방법

캐릭터셋 세팅
C>sqlplus / as sysdba;

-- CharSet 변경
update sys.props$ set value$='KO16MSWIN949' where name='NLS_CHARACTERSET';
update sys.props$ set value$='KO16MSWIN949' where name='NLS_NCHAR_CHARACTERSET';
update sys.props$ set value$='AMERICAN_AMERICA.KO16MSWIN949' where name='NLS_LANGUAGE';
update sys.props$ set value$='AL16UTF16' where name='NLS_NCHAR_CHARACTERSET';

-- DATA Base CharSet 변경
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET KO16MSWIN949;
SHUTDOWN IMMEDIATE;
STARTUP;
quit;

-- TABLESPACE 생성
create tablespace 테이블스페이스명 datafile 'C:\oraclexe\oradata\XE\테이블스페이스파일명01.DAT' size 2048m autoextend on;

-- USER 생성
create user 유저명 identified by 패스워드
default tablespace 테이블스페이스명
temporary tablespace temp;

grant connect , resource to  유저명;

quit;

**************************************************************************

문제) 오라클 10g : export 실행할때나 PLSQL, 토드로 접속할때 아래의 에러발생.
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-553: character set name is not recognized

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
COL VALUE NEW_VALUE CHARSET
SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER='NLS_CHARACTERSET';
COL VALUE NEW_VALUE NCHARSET
SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER='NLS_NCHAR_CHARACTERSET';
ALTER DATABASE CHARACTER SET INTERNAL_USE &CHARSET;
ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE &NCHARSET;
SHUTDOWN IMMEDIATE;
STARTUP;
-- yes, 2 times startup/shutdown . This is not a typo
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;

*** SQL> ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE &NCHARSET; 오류 발생시
SQL>update sys.props$ set value$='AL16UTF16' where name='NLS_NCHAR_CHARACTERSET';
처리후 위에 작업 다시 수행