D.B./Oracle
[ORACLE] 다국어 사용시 초기 인코딩 확인 및 셋팅
미련곰
2010. 8. 20. 11:53
프로젝트중 다국어 사이트가 포함되어 설정하던중
DB에서 중국어와 일본어를 불러올때 일부 문자가 깨져버렸다..
기존데이터를 살리고 인코딩을 변경하느라 하루를 버렸네..
DB 초기셋팅때 미리 설정만 해두었더라면.. 이래서 많이알아야 몸이 고생을 안한다니깐..
$ sqlplus "sys/manager as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 19 23:38:38 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
SQL>
SQL>
SQL> SELECT * FROM nls_database_parameters
WHERE parameter='NLS_CHARACTERSET' or parameter='NLS_LANGUAGE' 2 ;
PARAMETER
------------------------------
VALUE
--------------------------------------------------------------------------------
NLS_LANGUAGE
AMERICAN
NLS_CHARACTERSET
KO16KSC5601
SQL>
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2084400 bytes
Variable Size 654311888 bytes
Database Buffers 939524096 bytes
Redo Buffers 14692352 bytes
Database mounted.
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2084400 bytes
Variable Size 654311888 bytes
Database Buffers 939524096 bytes
Redo Buffers 14692352 bytes
Database mounted.
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
System altered.
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> ALTER DATABASE OPEN;
Database altered.
SQL> update sys.props$ set value$='UTF8' where name='NLS_CHARACTERSET';
1 row updated.
SQL> update sys.props$ set value$='UTF8' where name='NLS_NCHAR_CHARACTERSET';
1 row updated.
SQL> update sys.props$ set value$='KOREAN_KOREA.UTF8' where name='NLS_LANGUAGE';
1 row updated.
SQL> commit;
Commit complete.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
System altered.
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> ALTER DATABASE OPEN;
Database altered.
SQL> update sys.props$ set value$='UTF8' where name='NLS_CHARACTERSET';
1 row updated.
SQL> update sys.props$ set value$='UTF8' where name='NLS_NCHAR_CHARACTERSET';
1 row updated.
SQL> update sys.props$ set value$='KOREAN_KOREA.UTF8' where name='NLS_LANGUAGE';
1 row updated.
SQL> commit;
Commit complete.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2084400 bytes
Variable Size 654311888 bytes
Database Buffers 939524096 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
SQL>
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2084400 bytes
Variable Size 654311888 bytes
Database Buffers 939524096 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
SQL>