ORACLE/SQL2009. 9. 11. 20:52
반응형
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
char[(n)]
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
유니코드가 아니고, 길이가 n바이트인 고정 길이 문자 데이터입니다. n은 1에서 8,000 사이의 값이어야 하고 저장소 크기는 n바이트입니다. char의 SQL-92 동의어는 character입니다.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
varchar[(n)]
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
유니코드가 아니고, 길이가 n바이트인 가변 길이 문자 데이터입니다. n은 1에서 8,000 사이의 값이어야 하고 저장소 크기는 n바이트가 아니라 입력한 데이터의 실제 바이트 길이입니다. 입력한 데이터의 길이는 0일 수 있습니다. varchar의 SQL-92 동의어는 char varying 또는 character varying입니다.
비고

데이터 정의나 변수 선언문에서 n을 지정하지 않으면 기본 길이는 1입니다. CAST 함수에 n을 지정하지 않으면 기본 길이는 30입니다.

char이나 varchar을 사용하는 개체는 COLLATE 절을 사용하여 특정 데이터 정렬을 할당하지 않는 한 데이터베이스의 기본 데이터 정렬이 할당됩니다. 데이터 정렬은 문자 데이터를 저장하는 데 사용하는 코드 페이지를 제어합니다.

여러 언어를 지원하는 사이트는 문자 변환 문제를 최소화하기 위해 유니코드 nchar 또는 nvarchar 데이터 형식을 사용하는 것을 고려해야 합니다. char 또는 varchar을 사용하는 경우,

    * 열의 데이터 값이 크기가 비슷할 경우 char를 사용합니다.
    * 열의 데이터 값이 크기가 다를 경우 varchar를 사용합니다.

CREATE TABLE 또는 ALTER TABLE을 실행할 때 SET ANSI_PADDING이 OFF면 NULL로 정의된 char 열이 varchar로 처리됩니다.

데이터 정렬 코드 페이지에서 더블바이트 문자를 사용할 경우 저장소 크기는 계속 n바이트입니다. 문자열에 따라 n바이트의 저장소 크기가 n자보다 작을 수도 있습니다.


자료출처 : http://cafe.naver.com/q69.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=22995


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
VARCHAR2 와  NVARCHAR2
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
VARCHAR2 타입은, 데이터베이스의 character set 데이터를 가변 길이로 저장하고, NVARCHAR2 타입은 데이터베이스의 national character set 데이터를 가변 길이로 저장하는데 사용되는 데이터 타입입니다.
NVARCHAR2 타입도 NCHAR 타입과 같이 Oracle 9i 이상 버전에서는 UNICODE를 사용하여야만 합니다. 따라서 UTF8이나 AL16UTF16만 가능합니다.

VARCHAR2 나 NVARCHAR2 의 주된 특징은, 컬럼 정의 시 지정된 max length보다 적은 길이의 문자열을 저장하는 경우, Empty Byte가 SPACE로 추가 (padding) 되지 않고, 실제 data만 저장되는 가변 길이라는 것입니다. 그래서 CHAR/NCHAR에 비해 불필요한 자원 낭비를 막고, 테이블에 대한 Full Scan시에도 작은블록을 읽어 성능상 장점이 있으며, Empty Block이 PADDING되지 않아 정확한 비교를 하는데 유의해야 할사항이 적습니다.

VARCHAR2 Data Type은 최대 4000byte까지 저장이 가능하며 , 자릿수는 반드시 지정해야 합니다.
한 편 NVARCHAR2 Data Type도 최대 4000byte까지 저장이 가능한데, 자릿수를 지정하지 않을 경우 한글자가 지정됩니다. 저장되는 National Character Set에 따라 AL16UTF16의 경우엔 2 BYTE, UTF8의 경우는 3BYTE가 기본입니다.

내부 저장방식을 dump() function으로 확인해 보면, VARCHAR2 및 NVARCHAR2 의 내부 데이터 코드값은 1 입니다. 이 내부코드 값으로 Data Type에 대한 식별이 가능합니다.

Length는 실제 data를 insert한 양에 따라 유동적입니다. CHAR/NCHAR에 비해 불필요한 space가 추가되지 않았음을 확인할 수 있습니다.
실제로 저장된 문자data는 각 문자의 ASCII CODE값만 저장되었음을 확인이 하실 수 있습니다.

참고>
참고로 VARCHAR2와 NVARCHAR2의 dump결과 내부코드가 같으나, 구별은 table description으로
column에 정의된 Data Type에 대한 확인이 가능하며, 또한 한글의 경우 저장된 byte로도 확인이 가능합니다.
예를 들어 DB characterset이 KO16KSC5601이고 national characterset이 UTF8인 경우,
“가”를 저장한다고 보면, varchar2 Data Type의 length는 2byte이나 nvarchar2 Data Type은 3byte로 보입니다.
물론 DB characterset과 national characterset이 같은 UTF8인 경우엔 column에 정의된 Data
Type으로만 확인이 가능합니다.


자료출처 : http://blog.naver.com/redfreek2c?Redirect=Log&logNo=120028930188
반응형

'ORACLE > SQL' 카테고리의 다른 글

NVL,DECODE  (0) 2010.01.03
constraint 제약조건 (primary, foreign , unique,check, default)  (0) 2009.11.02
ROLLUP , CUBE , GROUPING  (0) 2009.09.02
Oracle 널값(null)에 대하여 정리  (0) 2009.08.21
SELECT문 및 연산자  (0) 2009.08.10
Posted by [PineTree]
ORACLE/ADMIN2009. 9. 11. 20:42
반응형
Index of This Note:
-------------------

1) What is the National Character Set?
2) Which datatypes use the National Character Set?
3) How to know if I use N-type columns?
4) Should I worry when I upgrade from 8i or lower to 9i, 10g or 11g?
5) The NLS_NCHAR_CHARACTERSET is NOT changed to UTF8 or AL16UTF16 after upgrading to 9i.
6) Can I change the AL16UTF16 to UTF8 / I hear that there are problems with AL16UTF16.
7) Is the AL32UTF8 problem the same as the AL16UTF16 / do I need the same patches?
8) But I still want <characterset> as NLS_NCHAR_CHARACTERSET, like I had in 8(i)!
9) Do i need to set NLS_LANG to AL16UTF16 when creating/using the NLS_NCHAR_CHARACTERSET ?
10) I try to use AL32UTF8 as NLS_NCHAR_CHARACTERSET but it fails with ORA-12714
11) I have the message "( possible ncharset conversion )" during import.
12) Can i use AL16UTF16 as NLS_CHARACTERSET ?
13) I'm inserting <special character> in a Nchar or Nvarchar2 col but it comes back as ? ...
14) Do i need to change the NLS_NCHAR_CHARACTERSET in 8i to UTF8 BEFORE upgrading to 9i/10g?
15) Having a UTF8 NLS_CHARACTERSET db is there a advantage to use AL16UTF16 N-types ?
16) I have a message in the DBUA (Database Upgrade Assistant) about NCHAR type when upgrading from 8i..
17) How to go from an UTF8 NLS_NCHAR_CHARTERSET to AL16UTF16?

1) What is the National Character Set?
--------------------------------------

The National Character set (NLS_NCHAR_CHARACTERSET) is a character set
which is defined in addition to the (normal) database character set and
is used for data stored in NCHAR, NVARCHAR2 and NCLOB columns.

Your current value for the NLS_NCHAR_CHARACTERSET can be found with this select:

select value from NLS_DATABASE_PARAMETERS where parameter='NLS_NCHAR_CHARACTERSET';

You cannot have more than 2 charactersets defined in Oracle:
The NLS_CHARACTERSET is used for CHAR, VARCHAR2, CLOB columns;
The NLS_NCHAR_CHARACTERSET is used for NCHAR, NVARCHAR2, NCLOB columns.

NLS_NCHAR_CHARACTERSET is defined when the database is created
and specified with the CREATE DATABASE command.
The NLS_NCHAR_CHARACTERSET defaults to AL16UTF16 if nothing is specified.

From 9i onwards the NLS_NCHAR_CHARACTERSET can have only 2 values:
UTF8 or AL16UTF16 who are Unicode charactersets.
See Note 260893.1 Unicode character sets in the Oracle database
for more info about the difference between them.

Al lot of people think that they *need* to use the NLS_NCHAR_CHARACTERSET to have
UNICODE support in Oracle, this is not true, NLS_NCHAR_CHARACTERSET (NCHAR, NVARCHAR2)
is in 9i always Unicode but you can perfectly use "normal" CHAR and VARCHAR2 columns for storing unicode
in a database who has a AL32UTF8 / UTF8 NLS_CHARACTERSET.
See also point 15.

When trying to use another NATIONAL characterset the CREATE DATABASE command will
fail with "ORA-12714 invalid national character set specified"

The character set identifier is stored with the column definition itself.

2) Which datatypes use the National Character Set?
--------------------------------------------------

There are three datatypes which can store data in the national character set:

NCHAR - a fixed-length national character set character string.
The length of the column is ALWAYS defined in characters
(it always uses CHAR semantics)

NVARCHAR2 - a variable-length national character set character string.
The length of the column is ALWAYS defined in characters
(it always uses CHAR semantics)

NCLOB - stores national character set data of up to four gigabytes.
Data is always stored in UCS2 or AL16UTF16, even if the
NLS_NCHAR_CHARACTERSET is UTF8.
This has very limited impact, for more info about this please see:
Note 258114.1 Possible action for CLOB/NCLOB storage after 10g upgrade
and if you use DBMS_LOB.LOADFROMFILE see
Note 267356.1 Character set conversion when using DBMS_LOB

If you don't know what CHAR semantics is, then please read
Note 144808.1 Examples and limits of BYTE and CHAR semantics usage

If you use N-types, DO use the (N'...') syntax when coding it so that Literals are
denoted as being in the national character set by prefixing letter 'N',
for example:

create table test(a nvarchar2(100));
insert into test values(N'this is a NLS_NCHAR_CHARACTERSET string');


3) How to know if I use N-type columns?
---------------------------------------

This select list all tables containing a N-type column:

select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB');

On a 9i database created without (!) the "sample" shema you will see these rows (or less) returned:

OWNER TABLE_NAME
------------------------------ ------------------------------
SYS ALL_REPPRIORITY
SYS DBA_FGA_AUDIT_TRAIL
SYS DBA_REPPRIORITY
SYS DEFLOB
SYS STREAMS$_DEF_PROC
SYS USER_REPPRIORITY
SYSTEM DEF$_LOB
SYSTEM DEF$_TEMP$LOB
SYSTEM REPCAT$_PRIORITY

9 rows selected.

These SYS and SYSTEM tables may contain data if you are using:

* Fine Grained Auditing -> DBA_FGA_AUDIT_TRAIL
* Advanced Replication -> ALL_REPPRIORITY, DBA_REPPRIORITY, USER_REPPRIORITY
DEF$_TEMP$LOB , DEF$_TEMP$LOB and REPCAT$_PRIORITY
* Advanced Replication or Deferred Transactions functionality -> DEFLOB
* Oracle Streams -> STREAMS$_DEF_PROC


If you do have created the database with the DBCA and included
the sample shema then you will see typically:

OWNER TABLE_NAME
------------------------------------------------------------
OE BOMBAY_INVENTORY
OE PRODUCTS
OE PRODUCT_DESCRIPTIONS
OE SYDNEY_INVENTORY
OE TORONTO_INVENTORY
PM PRINT_MEDIA
SYS ALL_REPPRIORITY
SYS DBA_FGA_AUDIT_TRAIL
SYS DBA_REPPRIORITY
SYS DEFLOB
SYS STREAMS$_DEF_PROC
SYS USER_REPPRIORITY
SYSTEM DEF$_LOB
SYSTEM DEF$_TEMP$LOB
SYSTEM REPCAT$_PRIORITY

15 rows selected.

The OE and PM tables contain just sample data and can be dropped if needed.

4) Should I worry when I upgrade from 8i or lower to 9i, 10g or 11g?
--------------------------------------------------------------------

* When upgrading from version 7:

The National Character Set did not exist in version 7,
so you cannot have N-type columns.
Your database will just have the -default- AL16UTF16 NLS_NCHAR_CHARACTERSET
declaration and the standard sys/system tables.
So there is nothing to worry about...

* When upgrading from version 8 and 8i:

- If you have only the SYS / SYSTEM tables listed in point 3)
then you don't have USER data using N-type columns.

Your database will just have the -default- AL16UTF16 NLS_NCHAR_CHARACTERSET
declaration after the upgrade and the standard sys/system tables.
So there is nothing to worry about...

We recommend that you follow this note:
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i

- If you have more tables then the SYS / SYSTEM tables listed in point 3)
(and they are also not the "sample" tables) then there are 3 possible cases:

* Again, the next to points are *only* relevant when you DO have n-type USER data *

a) Your current 8 / 8i NLS_NCHAR_CHARACTERSET is in this list:

JA16SJISFIXED , JA16EUCFIXED , JA16DBCSFIXED , ZHT32TRISFIXED
KO16KSC5601FIXED , KO16DBCSFIXED , US16TSTFIXED , ZHS16CGB231280FIXED
ZHS16GBKFIXED , ZHS16DBCSFIXED , ZHT16DBCSFIXED , ZHT16BIG5FIXED
ZHT32EUCFIXED

Then the new NLS_NCHAR_CHARACTERSET will be AL16UTF16
and your data will be converted to AL16UTF16 during the upgrade.

We recommend that you follow this note:
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i

b) Your current 8 / 8i NLS_NCHAR_CHARACTERSET is UTF8:

Then the new NLS_NCHAR_CHARACTERSET will be UTF8
and your data not be touched during the upgrade.

We still recommend that you follow this note:
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i

c) Your current 8 / 8i NLS_NCHAR_CHARACTERSET is NOT in the list of point a)
and is NOT UTF8:

Then your will need to export your data and drop it before upgrading.
We recommend that you follow this note:
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i

For more info about the National Character Set in Oracle8 see Note 62107.1

5) The NLS_NCHAR_CHARACTERSET is NOT changed to UTF8 or AL16UTF16 after upgrading to 9i.
----------------------------------------------------------------------------------------

That may happen if you have not set the ORA_NLS33/ORA_NLS10 environment parameter
correctly to the 9i/10g Oracle_Home during the upgrade.
Note 77442.1 ORA_NLS (ORA_NLS32, ORA_NLS33, ORA_NLS10) Environment Variables explained.

You may see errors like "ORA-12714: invalid national character set specified"

We recommend that you follow this note for the upgrade:
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i

Strongly consider to restore your backup and do the migration again or log a
TAR, refer to this note and ask to assign the TAR to the NLS/globalization
team. That team can then assist you further.

However please do note that not all situations can be corrected,
so you might be asked to do the migration again...

Note: do NOT use the UTLNCHAR.SQL or N_SWITCH.SQL script!
This will not help and make things only worse...

Provide the output of this select:

select distinct OWNER, TABLE_NAME, DATA_TYPE from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB');

when logging a SR.

6) Can I change the AL16UTF16 to UTF8 / I hear that there are problems with AL16UTF16.
--------------------------------------------------------------------------------------

6a) If you do *not* use N-types then there is NO problem at all with AL16UTF16
because you are simply not using it and we strongly advice you the keep
the default AL16UTF16 NLS_NCHAR_CHARACTERSET.

6b) If you *do* use N-types then there will be a problem with 8i clients and
lower accessing the N-type columns (note that you will NOT have a problem
selecting from "normal" non-N-type columns).
More info about that is found there:
Note 140014.1 ALERT Oracle8/8i to Oracle9i/10g using New "AL16UTF16" National Character Set
Note 236231.1 New Character Sets Not Supported For Use With Developer 6i And Older Versions

If this is a situation you find yourself in we recommend to simply use UTF8
as NLS_NCHAR_CHARACTERSET or create a second 9i db using UTF8 as NCHAR and use this as "inbetween" between the 8i and the 9i db
you can create views in this new database that do a select from the AL16UTF16 9i db
the data will then be converted from AL16UTF16 to UTF8 in the "inbetween" database and that can
be read by oracle 8i

This is one of the 2 reasons why you should use UTF8 as NLS_NCHAR_CHARACTERSET.
If you are NOT using N-type columns with pre-9i clients then there is NO reason to go to UTF8.

6c) If you want to change to UTF8 because you are using transportable tablespaces from 8i database
then check if are you using N-types in the 8i database that are included in the tablespaces that you are transporting.

select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB');

If yes, then you have the second reason to use UTF8 as as NLS_NCHAR_CHARACTERSET.

If not, then leave it to AL16UTF16 and log a tar for the solution of the ORA-19736
and refer to this document. (see also point 8 in this note)

6D) You are in one of the 2 situations where it's really needed to change from
AL16UTF16 to UTF8 then the correct steps to go from AL16UTF16 to UTF8 are:

6D1) install csscan:

Note 458122.1 Installing and configuring CSSCAN in 8i and 9i
Note 745809.1 Installing and configuring CSSCAN in 10g and 11g

6D2) For 9i:

* export all the user N-data

* drop/truncate all the user N-data
-- If you do not drop all N-data then you will run into
-- ORA-12717: Cannot issue ALTER DATABASE NATIONAL CHARACTER SET when NCLOB, NCHAR or NVARCHAR2 data exists

* run csscan to check if everything is ok

csscan FULL=Y TONCHAR=UTF8 LOG=check CAPTURE=Y ARRAY=1000000 PROCESS=2

aways run csscan with / as sydba

* csscan will ask:


Current database character set is UTF8. <- this is the current NLS_CHARACTERSET

Enter new database character set name: > <-*just hit enter here*


* check that you see in the check.txt file this:

All character type data in the data dictionary remain the same in the new character set
All character type application data remain the same in the new character set


* then you can do a ALTER DATABASE NATIONAL CHARACTER SET UTF8;
Shutdown the listener and any application that connects locally to the database.
There should be only ONE connection the database during the WHOLE time and that's
the sqlplus session where you do the change.

1. Make sure the parallel_server parameter in INIT.ORA is set to false or it is not set at all.
If you are using RAC see
Note 221646.1 Changing the Character Set for a RAC Database Fails with an ORA-12720 Error

2. Execute the following commands in sqlplus connected as "/ AS SYSDBA":

SPOOL Nswitch.log
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 NATIONAL CHARACTER SET UTF8;
SHUTDOWN IMMEDIATE;

3. Restore the parallel_server parameter in INIT.ORA, if necessary.

* import the user N-data again

6D3) for 10g and up:

* export any user N-data
* drop/truncate any user N-data
* Truncate these 2 xdb tables if

SQL>select LOCALNAME from XDB.XDB$QNAME_ID;
SQL>select NMSPCURI from XDB.XDB$NMSPC_ID;

gives 7 rows

SQL>truncate table XDB.XDB$QNAME_ID
SQL>truncate table XDB.XDB$NMSPC_ID

if you have more rows log a SR.

* run csscan to check if everything is ok

csscan FULL=Y TONCHAR=UTF8 LOG=check CAPTURE=Y ARRAY=1000000 PROCESS=2

always run csscan with / as sydba

* csscan will ask:


Current database character set is UTF8. <- this is the current NLS_CHARACTERSET

Enter new database character set name: > <-*just hit enter here*


* check that you see in the check.txt file this:

All character type data in the data dictionary remain the same in the new character set
All character type application data remain the same in the new character set

* after that run csalter ( using alter database is in a 10g system for the national characterset not really a problem, but csalter is the official way)

Shutdown the listener and any application that connects locally to the database.
There should be only ONE connection the database during the WHOLE time and that's
the sqlplus session where you do the change.

Then you do in sqlplus connected as "/ AS SYSDBA":


-- Make sure the parallel_server and CLUSTER_DATABASE parameter are set
-- to false or it is not set at all.
-- If you are using RAC you will need to start the database in single instance
-- with CLUSTER_DATABASE = FALSE
sho parameter CLUSTER_DATABASE
sho parameter PARALLEL_SERVER
-- check if you are using spfile
sho parameter pfile
-- if this "spfile" then you are using spfile
-- in that case note the
sho parameter job_queue_processes
sho parameter aq_tm_processes
-- (this is Bug 6005344 fixed in 11g )
-- then do

shutdown immediate
startup restrict
SPOOL Nswitch.log
@@?\rdbms\admin\csalter.plb
-- if you are using spfile then you need to also
-- ALTER SYSTEM SET job_queue_processes=<original value> SCOPE=BOTH;
-- ALTER SYSTEM SET aq_tm_processes=<original value> SCOPE=BOTH;

shutdown
startup


* after this update the XDB tables again with these inserts:

(these inserts can also be found in the $ORACLE_HOME/rdbms/admin/catxdbtm.sql script)

insert into xdb.xdb$nmspc_id values ('http://www.w3.org/XML/1998/namespace', HEXTORAW('01'));
insert into xdb.xdb$nmspc_id values ('http://www.w3.org/XML/2000/xmlns', HEXTORAW('02'));
insert into xdb.xdb$nmspc_id values ('http://www.w3.org/2001/XMLSchema-instance', HEXTORAW('03'));
insert into xdb.xdb$nmspc_id values ('http://www.w3.org/2001/XMLSchema', HEXTORAW('04'));
insert into xdb.xdb$nmspc_id values ('http://xmlns.oracle.com/2004/csx', HEXTORAW('05'));
insert into xdb.xdb$nmspc_id values ('http://xmlns.oracle.com/xdb', HEXTORAW('06'));
insert into xdb.xdb$nmspc_id values ('http://xmlns.oracle.com/xdb/nonamespace', HEXTORAW('07'));

insert into xdb.xdb$qname_id values (HEXTORAW('01'), 'space', HEXTORAW('01'), HEXTORAW('10'));
insert into xdb.xdb$qname_id values (HEXTORAW('01'), 'lang', HEXTORAW('01'), HEXTORAW('11'));
insert into xdb.xdb$qname_id values (HEXTORAW('03'), 'type', HEXTORAW('01'), HEXTORAW('12'));
insert into xdb.xdb$qname_id values (HEXTORAW('03'), 'nil', HEXTORAW('01'), HEXTORAW('13'));
insert into xdb.xdb$qname_id values (HEXTORAW('03'), 'schemaLocation', HEXTORAW('01'), HEXTORAW('14'));
insert into xdb.xdb$qname_id values (HEXTORAW('03'), 'noNamespaceSchemaLocation', HEXTORAW('01'), HEXTORAW('15'));
insert into xdb.xdb$qname_id values (HEXTORAW('02'), 'xmlns', HEXTORAW('01'), HEXTORAW('16'));

commit;

* import any user N-data


important:

Do NOT use the UTLNCHAR.SQL or N_SWITCH.SQL script.
Using this a to try to go from UTF8 to AL16UTF16 (or inverse)
will corrupt existing NCHAR data !!!!!!
It is to be used only in specific conditions when upgrading from 8i to 9i

7) Is the AL32UTF8 problem the same as the AL16UTF16 / do I need the same patches?
----------------------------------------------------------------------------------
No, they may look similar but are 2 different issues.

For information about the possible AL32UTF8 issue please see
Note 237593.1 Problems connecting to AL32UTF8 databases from older versions (8i and lower)

8) But I still want <characterset> as NLS_NCHAR_CHARACTERSET, like I had in 8(i)!
---------------------------------------------------------------------------------

This is simply not possible.

From 9i onwards the NLS_NCHAR_CHARACTERSET can have only 2 values: UTF8 or AL16UTF16.

Both UTF8 and AL16UTF16 are unicode charactersets, so they can
store whatever <characterset> you had as NLS_NCHAR_CHARACTERSET in 8(i).

If you are not using N-types then keep the default AL16UTF16 (or use UTF8 if you really want),
it doesn't matter if you don't use the N-types.

There is one condition in which this "limitation" can have a undisired affect,
when you are importing an Oracle8i Transportable Tablespace into Oracle9i
you can run into a ORA-19736 (as wel with AL16UTF16 as with UTF8).

Simply provide the 8i output of:

select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB');

In that case log a TAR, refer to this note and ask to assign the TAR to the
NLS/globalization team. That team can then assist you to work around this
issue in a easy way.
Do NOT try to change the national characterset in 8i to AL16UTF16 or update system tables
like you find sometimes on "oracle dba sites" on the internet if you don't want to
test your backup strategy.

9) Do i need to set NLS_LANG to AL16UTF16 when creating/using the NLS_NCHAR_CHARACTERSET ?
------------------------------------------------------------------------------------------

As clearly stated in
Note 158577.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?)
point "1.2 What is this NLS_LANG thing anyway?"

* NLS_LANG is used to let Oracle know what characterset you client's OS is USING
so that Oracle can do (if needed) conversion from the client's characterset to the
database characterset.

NLS_LANG is a CLIENT parameter has has no influence on the database side.

10) I try to use AL32UTF8 as NLS_NCHAR_CHARACTERSET but it fails with ORA-12714
-------------------------------------------------------------------------------

From 9i onwards the NLS_NCHAR_CHARACTERSET can have only 2 values:
UTF8 or AL16UTF16.

UTF8 is possible so that you can use it (when needed) for 8.x backwards compatibility.
In all other conditions AL16UTF16 is the preferred and best value.
AL16UTF16 has the same unicode revision as AL23UTF8,
so there is no need for AL32UTF8 as NLS_NCHAR_CHARACTERSET.

11) I have the message "( possible ncharset conversion )" during import.
------------------------------------------------------------------------

in the import log you see something similar to this:

Import: Release 9.2.0.4.0 - Production on Fri Jul 9 11:02:42 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V08.01.07 via direct path
import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
export server uses WE8ISO8859P1 NCHAR character set (possible ncharset conversion)

This is normal and is not a error condition.

- If you do not use N-types then this is a pure informative message.

- But even in the case that you use N-types like NCHAR or NCLOB then this is not a problem:

* the database will convert from the "old" NCHAR characterset to the new one automatically.
(and - unlike the "normal" characterset - the NLS_LANG has no impact on this conversion
during exp/imp)

* AL16UTF16 or UTF8 (the only 2 possible values in 9i) are unicode characterset and so
can store any character... So no data loss is to be expected.

12) Can i use AL16UTF16 as NLS_CHARACTERSET ?
----------------------------------------------

No, AL16UTF16 can only be used as NLS_NCHAR_CHARACTERSET in 9i and above.
Trying to create a database with a AL16UTF16 NLS_CHARACTERSET will fail.

13) I'm inserting <special character> in a Nchar or Nvarchar2 col but it comes back as ? ...
--------------------------------------------------------------------------------------------------

see point 14 in Note 227330.1 Character Sets & Conversion - Frequently Asked Questions

14) Do i need to change the NLS_NCHAR_CHARACTERSET in 8i to UTF8 BEFORE upgrading to 9i/10g?
--------------------------------------------------------------------------------------------

No, see point 4) in this note.

15) Having a UTF8 NLS_CHARACTERSET db is there a advantage to use AL16UTF16 N-types ?
-------------------------------------------------------------------------------------

There might be 2 reasons:

a) one possible advantage is storage (disk space) for NCHAR/NVARCHAR2.

UTF8 uses 1 up to 3 bytes, AL16UTF16 always 2 bytes.

If you have a lot of non-western data (cyrillic, Chinese, Japanese, Hindi languages..)
then it can be advantageous to use N-types for those columns seen those characters will use
3 bytes in UTF8 and 2 bytes in AL16UTF16.

For western data (english, french, spanish, dutch, german, portuguese etc...)
UTF8 will use in most cases less disk space then AL16UTF16.

Note 260893.1 Unicode character sets in the Oracle database

This is NOT true for NCLOB and CLOB, they are both encoded a internal fixed-width Unicode character set
Note 258114.1 Possible action for CLOB/NCLOBrage after 10g upgrade
so they will use the same amount of disk space.

b) other possible advantage is extending the limits of CHAR semantics

For a single-byte character set encoding, the character and byte length are
the same. However, multi-byte character set encodings do not correspond to
the bytes, making sizing the column more difficult.

Hence the reason why CHAR semantics was introduced. However, we still have some
physical underlying byte based limits and development has choosen to allow full usage
of the underlying limits. This results in the following table giving the maximum amount
of CHARarcters occupying the MAX datalength that can be stored for a certain
datatype in 9i and up.

The MAX colum is the MAXIMUM amount of CHARACTERS that can be stored
occupying the MAXIMUM data length. Seen that UTF8 and AL32UTF8 are VARRYING
charactersets this means that a string of X chars can be X to X*3 (or X*4 for AL32) bytes.

The MIN col is the maximum size that you can *define* and that Oracle can store if all data
is the MINIMUM datalength (1 byte for AL32UTF8 and UTF8) for that characet.

N-types (NVARCHAR2, NCHAR) are *always* defined in CHAR semantics, you cannot define them in BYTE.

All numbers are CHAR definitions.


UTF8 (1 to 3 bytes) AL32UTF8 (1 to 4 bytes) AL16UTF16 ( 2 bytes)
MIN MAX MIN MAX MIN MAX
CHAR 2000 666 2000 500 N/A N/A

VARCHAR2 4000 1333 4000 1000 N/A N/A

NCHAR 2000 666 N/A N/A 1000 1000

NVARCHAR2 4000 1333 N/A N/A 2000 2000

(N/A means not possible)

This means that if you try to store more then 666 characters
that occupy 3 bytes in UTF8 in a CHAR UTF8 colum you still will get a
ORA-01401: inserted value too large for column
(or from 10g onwards: ORA-12899: value too large for column )
error, even if you have defined the colum as CHAR (2000 CHAR)
so here it might be a good idea to define that column as NCHAR
that will raise the MAX to 1000 char's ...

Note 144808.1 Examples and limits of BYTE and CHAR semantics usage

Disadvantages using N-types:

* You might have some problems with older clients if using AL16UTF16
see point 6) b) in this note
* Be sure that you use (AL32)UTF8 as NLS_CHARACTERSET , otherwise you will run into
point 13 of this note.
* Do not expect a higher *performance* by using AL16UTF16, it might be faster
on some systems, but that has more to do with I/O then with the database kernel.
* Forms 6i/9i does not support NCHAR / NVARCHAR2.
This is documented in the 6i Forms online help.
and in Note 258195.1 Oracle9 Features not yet Supported in Forms 9i
* If you use N-types, DO use the (N'...') syntax when coding it so that Literals are
denoted as being in the national character set by prepending letter 'N', for example:

create table test(a nvarchar2(100));
insert into test values(N'this is NLS_NCHAR_CHARACTERSET string');

Normally you will choose to use Char/Varchar2 (using a (AL32)UTF8 NLS_CHARACTERSET)
for simplicity, to avoid confusion and possible other limitations who might be
imposed by your application or programming language to the usage of N-types.

16) I have a message running DBUA (Database Upgrade Assistant) about NCHAR type when upgrading from 8i .
--------------------------------------------------------------------------------------------------------

see point 16 in Note 227330.1 Character Sets & Conversion - Frequently Asked Questions

17) How to go from an UTF8 NLS_NCHAR_CHARTERSET to AL16UTF16?
-------------------------------------------------------------

Befor going from UTF8 to AL16UTF16 you need to see that you don't have any
NCHAR bigger then 1000 CHAR or NVARCHAR2 column bigger then 2000 CHAR

select distinct OWNER, TABLE_NAME, COLUMN_NAME, CHAR_LENGTH from DBA_TAB_COLUMNS where DATA_TYPE='NCHAR' and CHAR_LENGTH > 1000;
select distinct OWNER, TABLE_NAME, COLUMN_NAME, CHAR_LENGTH from DBA_TAB_COLUMNS where DATA_TYPE='NVARCHAR2' and CHAR_LENGTH > 2000;

or the ALTER DATABASE NATIONAL CHARACTER SET AL16UTF16; / Csalter will fail

You will need to adapt those columns after exporting the User N-data (if any).

you can ignore for the moment SYS.DBA_FGA_AUDIT_TRAIL|SQL_TEXT if this is 4000 and change to AL16UTF16
-> select CHAR_LENGTH from DBA_TAB_COLUMNS where OWNER='SYS' and TABLE_NAME='DBA_FGA_AUDIT_TRAIL' and COLUMN_NAME='SQL_TEXT';
And then after the change to AL16UTF16 run SQL> @?\rdbms\admin\catfga.sql

The procedure is just the same as in point 6D) simply use AL16UTF16 instead of UTF8 as characterset.

Related Documents:
------------------
Note 62107.1 The National Character Set in Oracle8
Note 227330.1 Character Sets & Conversion - Frequently Asked Questions
Note 227332.1 NLS considerations in Import/Export - Frequently Asked Questions

Note 158577.1 NLS_LANG Explained (How does Client-Server nversion Work?)
Note 159657.1 Complete Upgrade Checklist for Manual Upgrades from 8.X.0.1 to Oracle9i
Note 278725.1 utlnchar.sql and n_switch.sql fail with ORA-01735 on "non-standard" object names
Note 260893.1 Unicode character sets in the Oracle database
Note 144808.1 Examples and limits of BYTE and CHAR semantics usage

Note 237593.1 Problems connecting to AL32UTF8 databases from older versions (8i and lower)
Note 140014.1 ALERT Oracle8/8i to Oracle9i using New "AL16UTF16" National Character Set
Note 236231.1 New Character Sets Not Supported For Use With Developer 6i And Older Versions

Note 258114.1 Possible action for CLOB/NCLOB storage after 10g upgrade
Note 267356.1 Character set conversion when using DBMS_LOB

For further NLS / Globalization information you may start here:
Note 60134.1 Globalization Technology (NLS) - Frequently asked Questions
반응형
Posted by [PineTree]
ORACLE/SCRIPT2009. 9. 11. 14:15
반응형
select *
from 테이블
where case when m_stpdesc < 'ㄱ' then SUBSTR(m_stpdesc, 1, 1)
            when ascii('ㄱ') <= ascii(m_stpdesc) and
                 ascii(m_stpdesc)<= ascii('ㅎ') then m_stpdesc
            when m_stpdesc < '나' then 'ㄱ'
            when m_stpdesc < '다' then 'ㄴ'
            when m_stpdesc < '라' then 'ㄷ'
            when m_stpdesc < '마' then 'ㄹ'
            when m_stpdesc < '바' then 'ㅁ'
            when m_stpdesc < '사' then 'ㅂ'
            when m_stpdesc < '아' then 'ㅅ'
            when m_stpdesc < '자' then 'ㅇ'
            when m_stpdesc < '차' then 'ㅈ'
            when m_stpdesc < '카' then 'ㅊ'
            when m_stpdesc < '타' then 'ㅋ'
            when m_stpdesc < '파' then 'ㅌ'
            when m_stpdesc < '하' then 'ㅍ'
            else                  'ㅎ'
       end = 'ㄹ' ;    <<=================찾고자하는 자음


m_stpdesc <<===========해당 컬럼

반응형
Posted by [PineTree]
ORACLE/INSTALL2009. 9. 7. 21:30
반응형
I. Hardware:
===========
  1. Minimum Hardware Requirements
    a.) At least 1.0 Gb (1024 MB) of physical RAM
    b.) Swap disk space proportional to the system's physical memory as follows: 

         RAM                                Swap Space
         1024 Mb to 2048 Mb      1.5 x RAM
         2049 Mb to 16 Gb           1 x RAM 
         greater than 16 Gb            16 Gb

    c.) 1024 Mb of disk space (and less than 2Tb of disk space) in the /tmp directory.
    d.) 3.8 Gb of local disk space for the database software.
    e.) 1.7 Gb of disk space for a preconfigured database that uses file system storage (optional)


II. Software:
============
  1. As is specified in section 1.3.1 of the Oracle Database Installation Guide for 11gR2 on Linux (part number E10840-01), Oracle recommends that you install the Linux operating system with the default software packages (RPMs) and do not customize the RPMs during installation. For additional information on "default-RPMs", please see Note 376183.1, "Defining a "default RPMs" installation of the RHEL OS"

  2. Red Hat Enterprise Linux AS/ES 4 update 7 (or greater), which is Kernel 2.6.9-78.EL or newer.

  3. Required OS Components (per Release Notes, and Install Guide)
    a.) The exact version number details of this list are based upon 64-bit (x86-64) RHEL AS 4 update 7. When a newer "update" level is used, the RPM release numbers (such as 2.6.9-78) may be slightly higher (such as 2.6.9-83 or 2.6.9-95). Since RHEL AS/ES 4 "update" levels of "update 7" and beyond are certified, this is fine so long as you are still using 64-bit Linux (x86-64) RHEL AS/ES 4 RPMs.
    b.) Some of the Install Guide requirements will already be present from the "default-RPMs" foundation of Linux that you started with:
        1.) binutils-2.15.92.0.2-25 (x86_64)
        2.) compat-libstdc++-33-3.2.3-47.3 (x86_64) << both ARCH's are required. See next line.
        3.) compat-libstdc++-33-3.2.3-47.3 (i386) << both ARCH's are required. See previous line.
        4.) elfutils-libelf-0.97.1-5 (x86_64)
        5.) expat-1.95.7-4 (x86_64)
        6.) glibc-2.3.4-2.41 (x86_64) << both ARCH's are required. See next line.
        7.) glibc-2.3.4-2.41 (i686) << both ARCH's are required. See previous line.
        8.) glibc-common-2.3.4-2.41 (x86_64)
        9.) libaio-0.3.105-2 (i386) << both ARCH's are required. See next section.
        10.) libgcc-3.4.6-10 (x86_64) << both ARCH's are required. See next line.
        11.) libgcc-3.4.6-10 (i386) << both ARCH's are required. See previous line.
        12.) libstdc++-3.4.6-10 (x86_64) << both ARCH's are required. See next line.
        13.) libstdc++-3.4.6-10 (i386) << both ARCH's are required. See previous line.
        14.) make-3.80-7.EL4 (x86_64)
        15.) pdksh-5.2.14-30.6 (x86_64)
        16.) unixODBC-2.2.11-1.RHEL4.1 (x86_64) << both ARCH's are required. See next line.
        17.) unixODBC-2.2.11-1.RHEL4.1 (i386) << both ARCH's are required. See previous line.


    c.) The remaining Install Guide requirements will have to be installed:
        1.) elfutils-libelf-devel-0.97.1-5.x86_64.rpm
        2.) glibc-headers-2.3.4-2.41.x86_64.rpm will be required as a prerequisite
            a.) glibc-kernheaders-2.4-9.1.103.EL.x86_64.rpm will be required as a prerequisite
        3.) glibc-devel-2.3.4-2.41.x86_64.rpm << both ARCH's are required. See next section.
        4.) gcc-3.4.6-10.x86_64.rpm
        5.) libaio-0.3.105-2.x86_64.rpm << both ARCH's are required. See previous section.
        6.) libaio-devel-0.3.105-2.x86_64.rpm << both ARCH's are required. See next line.
        7.) libaio-devel-0.3.105-2.i386.rpm << both ARCH's are required. See previous line.
        8.) libstdc++-devel-3.4.6-10.x86_64.rpm
        9.) gcc-c++-3.4.6-10.x86_64.rpm 
      10.) sysstat-5.0.5-19.el4.x86_64.rpm
      11.) unixODBC-devel-2.2.11-1.RHEL4.1.x86_64.rpm << both ARCH's are required. See next line.
      12.) unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm << both ARCH's are required. See previous line.

  4. Additional Required OS Components (per the runInstaller OUI)
    a.) intentionally blank

  5. Additional Required OS Components (per this NOTE)
    a.) Please do not rush, skip, or minimize this critical step. This list is based upon a "default-RPMs" installation of 64-bit (x86-64) RHEL AS/ES 4. Additional RPMs (beyond anything known to Oracle) may be needed if a "less-than-default-RPMs" installation of 64-bit (x86-64) RHEL AS/ES 4 is performed. For more information, please refer to Note 376183.1, "Defining a "default RPMs" installation of the RHEL OS"
    b.) glibc-devel-2.3.4-2.41.i386.rpm << both ARCH's are required. See previous section.
    c.) Several RPMs will be required as prerequisites to those listed in section II.3.c:
        1.) glibc-kernheaders-2.4-9.1.103.EL.x86_64.rpm
        2.) itentionally blank

  6. Oracle Global Customer Support has noticed a recent trend with install problems that originates from installing too many RPMs. For example:
    a.) installing your own JDK version (prior to beginning the Oracle Software “runInstaller”) is not needed on Linux, and is not recommended on Linux. A pre-existing JDK often interferes with the correct JDK that the Linux Oracle Software “runInstaller” will place and use.
    b.) installing more than the required version of the gcc / g++ RPMs often leads to accidentally using (aka enabling or activating) the incorrect one. If you have multiple RDBMS versions installed on the same Linux machine, then you will likely have to manage multiple versions of gcc /g++ . For more information, please see Note 444084.1, "Multiple gcc / g++ Versions in Linux"

  7. All of the RPMs in section II. are on the Red Hat Enterprise Linux AS/ES 4 64-bit (x86-64) distribution media.

III. Environment:
================
  1. Modify your kernel settings in /etc/sysctl.conf (RedHat) as follows. If the current value for any parameter is higher than the value listed in this table, do not change the value of that parameter. Range values (such as net.ipv4.ip_local_port_range) must match exactly.
    kernel.shmall = physical RAM size / pagesize For most systems, this will be the value 2097152. See Note 301830.1 for more information.
    kernel.shmmax = 1/2 of physical RAM, but not greater than 4GB. This would be the value 2147483648 for a system with 4Gb of physical RAM.
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 512 x processes (for example 6815744 for 13312 processes)
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576 

  2. To activate these new settings into the running kernel space, run the “sysctl –p” command

  3. The gcc and g++ RPM items above will ensure that the correct gcc / g++ versions are installed. It is also required that you ensure that these correct gcc / g++ versions are active, and in-use. Ensure that the commands "gcc --version" and "g++ --version" each return "3.4.x".

  4. Set Shell Limits for the oracle User. Assuming that the "oracle" Unix user will perform the installation, do the following:

    a.) Add the following settings to /etc/security/limits.conf
         oracle soft nproc 2047
         oracle hard nproc 16384
         oracle soft nofile 1024
         oracle hard nofile 65536

    b.) Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
         session required pam_limits.so

    c.) Add the following lines to /etc/profile:
         if [ $USER = "oracle" ]; then 
            if [ $SHELL = "/bin/ksh" ]; then
               ulimit -p 16384
               ulimit -n 65536
            else
               ulimit -u 16384 -n 65536
            fi
         fi


  5. The hostname command should return the fully qualified hostname as shown
below:
      % hostname 
          hostname.domainname

  6. If any Java packages are installed on the system, unset the Java environment variables, for example JAVA_HOME.

  7. The oracle account used to install Oracle 11.2.0.1, should not have the Oracle install related variables set by default. For example setting ORACLE_HOME, PATH, LD_LIBRARY_PATH to include Oracle binaries in .profile, .login file and /etc/profile.d should be completely avoided.
    a.) Setting $ORACLE_BASE (not $ORACLE_HOME) is recommended, since it eases a few prompts in the OUI runInstaller tool.
    b.) following the succesful install, it is recommended to set $ORACLE_HOME, and to set $PATH to include the Oracle binaries ($ORACLE_HOME/bin) as the first location.

  8. Log in as Oracle user and start the installation as follows:
     ./runInstaller

    a.) When performing the 11.2.0.1 installation, make sure to use the "runInstaller" version that comes with 11.2.0.1 software. 
    b.) When performing any subsequent 11.2.0.x patchset, make sure to use the "runInstaller" version that comes with the patchset. 
    c.) it is best practice not to use any form of "su" to start the runInstaller, in order to avoid potential display-related problems



ADDITIONAL NOTES
----------------
1. Supported distributions of the 32-bit (x86) Linux OS can run on on AMD64/EM64T and Intel Processor Chips that adhere to the x86_64 architecture
  a.) Oracle 32-bit running on AMD64/EM64T with 32-bit OS is supported, but is NOT covered by this NOTE.
  b.) Oracle 32-bit running on AMD64/EM64T with 64-bit OS is not certified and is not supported.

2. Asynchronous I/O on ext2 and ext3 file systems is supported if your scsi/fc driver supports that functionality.

3. No extra patch is required for the DIRECTIO support for x86-64.

4. No LD_ASSUME_KERNEL value should be used with the 11gR2 product.

5. Following rpm command can be used to distinguish between a 32-bit or 64-bit package.
    #rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep glibc-devel
     glibc-devel-2.3.4-2.41 (i386)
     glibc-devel-2.3.4-2.41 (x86_64)
반응형
Posted by [PineTree]
ORACLE/SCRIPT2009. 9. 4. 16:46
반응형
반응형
Posted by [PineTree]
ORACLE/ORACLE TOOL2009. 9. 4. 14:22
반응형

SQL * Plus 명령어  & 환경 시스템 변수

                                                                           - By Everekk79 ( Last Updated 2007.11.22 )

 

sqlplus [ username [ /password [ @database ]]

 

SQL*Plus 명령어는 한번에 한 라인만 입력할 수 있으며 명령어를 축약하여 사용할 수 있다.

SQL*Plus 명령어는 SQL 버퍼에 저장되지 않으며 세미콜론(;)과 같은 종료 문자를 사용하지 않는다.

 

RUN : 최근에 실행된 SQL 명령문을 실행한다

         SQL 명령문과 함께 결과를 출력한다

/ : 최근에 실행된 SQL 명령문을 실행한다.

    검색 결과만을 출력한다.

  ==> 최근에 실행된 SQL 명령문은 SQL 버퍼에 저장되어 있 다.

 

eixt : 정상 종료

  ==> 정상 종료를 해야만 사용자가 데이터베이스에 수정한 내용이 디스크에 영구적으로 저장된다.

 

 

▣ 시스템 변수 설정 명령어

 

 SET System_Variable Value

 

Set Auto [Commit] { off | on | imm[ediate] | n }

on, immediate : DML 명령문이 성공적으로 실행되면 자동적으로 Commit 명령문 실행

off : DML 명령문 실행 후, 사용자가 직접 Commit 명령문 실행

n : DML 명령문을 n 번 성공적으로 실행 후 자동적으로 Commit 문 실행 

 

Set Feed[back] { 6 | n | off | on }

Select 문의 실행 결과를 표시하기 위하여 출력 행의 수를 지정하는 시스템 변수

n : 출력 행의 수가 n 이상인 경우만  " n개의 행이 선택되었습니다" 라는 메시지 출력

6 : 기본값

on : feedback 변수 값을 기본값으로 설정한다.

 

Set Heading { off | on }

off : 컬럼 제목이 출력되지 않는다.

on : 컬럼 제목을 출력한다.

 

Set Lin[esize] { 80 | n }

한 화면에 표시되는 SQL 명령문의 출력 결과에 대한 행의 크기를 설정한다.

기본값은 80이며 최대값은 시스템에 따라 차이가 남

 

Set Pages[ize] { 14 | n }

한 화면에 표시되는 SQL 명령문의 실행 결과에 대한 페이지의 크기를 설정하기 위한 시스템 변수

한 페이지에는 칼럼 제목, 데이터의 구분선, 페이지를 구분하기 위한 공백 라인도 포함된다.

기본값은 14이다,

 

Set Pause { off | on }

SQL 명령문의 실행 결과를 한 화면에 보기 힘든 경우에 한 페이지씩 나누어 출력하기 위한 시스템 변수이다.

on : 사용자가 엔터키를 입력할 때까지 대기하고 있다가 엔터 키를 입력하면 실행 결과를 출력한다.

 

Set Term[out] { off | on }

SQL 명령문 실행 결과를 화면에 출력할 지 여부를 지정하기 위한 시스템 변수

스크립트(*.sql) 파일에 의해 실행된 여러 개의 SQL 명령문의 출력 결과를 확인 할 필요가 없는 경우 유용하게 사용된다.

off : SQL 명령문의 실행 결과가 화면에 출력되지 않는다.

on : SQL 명령문의 실행 결과를 화면에 출력한다.

 

Set Ti[me] { off | on }

SQL  프롬프트 앞에 시스템의 현재 시간을 함께 표시하도록 설정하는 시스템 변수

on : SQL 프롬프트 앞에 시간 정보가 함께 표시된다.

off : 시간 정보를 출력되지 않도록 설정한다.

 

Set Timing { off | on }

Timing  변수는 SQL 명령문을 실행하는데 소요된 시간을 출력하기 위한 시스템 변수이다.

시간은 '시:분:초.밀리초' 형식으로 출력된다.

on : SQL 명령문을 실행하는데 소요된 시간을 출력한다,

off : 소요된 시간 정보가 출력되지 않는다.

 

Set Und[erline] { - | c | on | off }

컬럼 제목과 데이터간의 구분 기호를 설정하기 위한 시스템변수이다.

c : 모든 문자

on : 구분기호 사용

off : 구분기호 사용하지 않음

 

Set Verify { on | off }

SQL 명령문이나 PL/SQL에서 &를 이용한 치환 변수등을 사용할 때 치환되기 전 후의 자세한 값을

보일 건지의 여부를 결정한다. 기본값은 On이다

 

Set Serveroutput { on | off }

PL/SQL 문에서 dbms_output.put_line() 프로시저를 사용

출력을 SQL*Plus 에서 보려면 Set Serveroutput on 을 먼저 실행해야 한다.

 

Set Colsep { text }

컬럼이 표시될때 컬럼의 구별 문자

열 사이에 출력되는 문자를 설정

Default Value : 공백

 

▣ SQL*Plus 기타 명령어

 

Show { system_variable | all }

Show 명령문은 현재 세션에 설정된 시스템 변수를 확인하기 위한 명령어이다.

Show all을 할 경우 현재 설정된 모든 환경 변수값을 확인 할수 있다.

 

Help 명령어

SQL 명령어를 모를 경우 사용

 

 

▣ 형식 명령어

 

Column { column | alias } [ option ] [ Format ]

Column 명령어는 SQL 명령문의 실행 결과로 출력되는 칼럼 제목이나 컬럼 데이터에 대한 출력 형식을 다양하게 지정하기 위한 명령어이다.

[ option ]

Cle[ar] : 컬럼 형식 해제

For[mat] fromat : 컬럼 데이터의 출력 형식 지정

Hea[ding] text : 컬럼 제목 설정, text 내의 수직(|)바는 컬럼 제목을 여러 줄로 출력 할 경우

                       EnterKey 역활

Jus[tify] { align } : 컬럼 제목을 왼쪽, 가운데 또는 오른쪽 정렬

Nopri[nt] : 컬럼 숨기기

pri[nt] : 컬럼 출력하기

Nul[l] text : null값에 대한 출력 문자 지정

[ Format ]

An : 문자 형식 컬럼의 출력 크기를 n폭으로 설정

9 :  단일 zero-suppression (0억제) 숫자

      example >> 999999 -> 1234

0 : 지정된 길이만큼 숫자 앞에 0 추가

      example >> 009999 -> 001234

$ : 숫자 앞에 달러 기호 삽입

      example >> $9999 -> $1234

L : 숫자 앞에 지역 화폐단위 삽입

      example >> L9999  -> $1234

. :  소숫점 위치 지정

      example >> 9999.99  -> 1234.00

, : 1000 자리마다 ',' 구분자 삽입

      example >> 9,999 -> 1,234

 

 

SQL> help variable

 VARIABLE
 --------

 Declares a bind variable that can be referenced in PL/SQL, or
 lists the current display characteristics for a single variable
 or all variables.

VAR[IABLE] [variable [type]]

 where type represents one of the following:

     NUMBER         CHAR          CHAR (n [CHAR|BYTE])
     NCHAR          NCHAR (n)     VARCHAR2 (n [CHAR|BYTE])
     NVARCHAR2 (n)  CLOB          NCLOB
     REFCURSOR      BINARY_FLOAT  BINARY_DOUBLE

 

 

▣ 편집 명령어

 

A[ppend] text : SQL 버퍼의 현재 라인 끝에 text 추가

C[hange]/old/new : 현재 라인의 old text를 new text로 변경

C[hange]/text/ : 현재 라인에서 text 삭제

Cl[ear] Buff[er] : 모든 라인 삭제

Del : 현재 라인 삭제

Del n : n 번째 라인 삭제

Del m n : m 번째 라인에서 n 라인까지 Text 삭제

I[nput] : 현재 라인 다음에 text 추가

I[nput] text : 현재 라인 다음에 text 추가

L[ist] : 모든 라인 출력

L[ist] n : n번째 라인의 text 출력

L[ist] m n : m번째 라인부터 n 라인까지 text 출력

n : n 번째 라인으로 이동

n text : n 번째 라인 내용으로 text 변경

0 text : 1번째 라인 앞에 text 추가

 

▣ 파일 조작 명령어

 

Sav[e] filename : 현재 SQL 버퍼의 내용을 파일에 저장

Get filename :  Save 명령어로 저장한 파일을 SQL 버퍼에 읽어 옴

Sta[rt] filename : 파일을 일고 즉시 실행

@filename : 파일을 읽고 즉시 실행

Ed[it] filename : 저장된 파알 내용을 편집

Spo[ol] [filename | off | on ] : 파일에 출력 결과를 저장

                                            off 는 spool 파일을 닫음

                                            on 은 spool 파일을 닫고 프린터로 파일 전송

반응형
Posted by [PineTree]
ORACLE/INSTALL2009. 9. 4. 09:44
반응형
오라클 DB에서 한글을 사용하다보면 정렬에 관한 문제가 발생하는 경우가 있다. 특히 동양권(한국/일본) 언어에서는 자국에 원어이외에 한자를 사용하고 있으므로 인해 여러가지 문제가 발생하는 경우가 있다.
 
KO16KSC5601에서 한글 정렬
KO16KSC5601 에서는 한글 2350자의 바이너리 정렬 순서가 한글의 언어적 정렬 방식과 동일하다. 따라서, 단순히 Order by 명령만으로 정렬의 효과를 거둘 수 있다. 한자의 경우 한글 뒤에 한자의 음에 맞게 정렬이 된다.
이것은 단지 한글 2350자들과 한자 4888자의 정렬일뿐이며, 나머지 글자들에 대해서는 입출력도 불가능하다.
 
UTF8/AL32UTF8에서 한글 정렬
UTF8 데이터베이스의 경우, 한글만을 고려하면 별다른 정렬 옵션이 필요없다. 왜냐하면 한글 11172자의 정렬 순서와 바이트 코드 정렬 순서가 일치하기 때문이다.
그러나 한자를 포함한다면 한자->한글 식으로 정렬이 된다.
 
KO16MSWIN949에서 한글 정렬
KO16MSWIN949 는 KO16KSC5601에서 지원되지 않는 8822자의 한글을 추가적으로 지원한다는 점에서 KO16KSC5601의 대안으로 자주 이용되는 Character Set이다. 하지만, 총 11172자의 한글의 바이트 코드가 한글의 언어적 정렬 순서와 불일치 한다.
 
NLS_SORT
UTF8과 KO16MSWIN949에서는 원하는 형태의 정렬이 일어나지 않는다. 이럴 때 NLS_SORT 값을 활용하여 원하는 형태의 정렬을 구현할 수 있다.
NLS_SORT='KOREAN_M'
  -  한글은 단순히 유니코드 바이트 정렬에 의존한다.
  - 모든 한글은 한자에 우선한다.
  - 한자는 발음 순서대로 정렬된다.
한마디로 KO16KSC5601에서 사용되던 정렬 방식으로 모든 한글과 한자를 정렬하겠다는 방법이다.
 
NLS_SORT='UNICODE_BINARY'
이 방법을 사용하면 각각의 문자에 대응하는 이진코드값을 기준으로 정렬된다. 이때는 한자->한글 순이다.
즉, 한글과 한자를 사용하는 경우에는 NLS_SORT='KOREAN_M'을 사용해야 한다.
반응형
Posted by [PineTree]
ORACLE/INSTALL2009. 9. 4. 09:41
반응형
NLS_LANG
오라클에서는 많은 환경변수 값을 사용하고 있다. 그렇지만 지금은 한글에 관한 이야기를 하고 있으므로 NLS_LANG만 가지고 설명한다.
오 라클 DB 서버와 클라이언트간 NLS_LANG 값을 동일하게 하여 사용하는 경우가 99%가량이다. 이렇게 사용하는 이유는 Oracle Client 프로그램을 이용하여 직접 오라클 DB에 접속하여 작업하는 경우가 대부분이기 때문이다.
그러나 NLS_LANG 변수의 값은 오라클 DB 환경변수 값이 아나라, 사용자 자신이 속해 있는 환경을 오라클 DB 서버에 알려주는 역할을 하는 환경변수이다.
 
            NLS_LANG = [언어]_[영역].[캐릭터셋]
언어 : 현재 사용자가 사용하는 언어적 특성을 결정짓는 값
영역 : 현재 사용자가 위치한 영역의 특성을 결정짓는 값
캐릭터셋 : 현재 사용자의 시스템이 인식할 수 있는 캐릭터 셋의 값
 
만 약 Windows Client에서 한국어 환경을 사용하는 경우 NLS_LANG 값을 'KOREAN_KOREA.KO16MSWIN949"로, 유닉스 클라이언트에서 한국어를 입출력한다면 'KOREAN_KOREA.KO16KSC5601'로 NLS_LANG를 설정할 것이다.
 
오라클 서버 CharacterSet과 클라이언트 CharacterSet을 동일하게 설정해야 하는 경우
앞서 이야기 했지만 NLS_LANG 값은 클라이언트 값이기 때문에 오라클 DB 서버와 동일하게 설정할 필요는 없지만 작업 및 그 동안 관습에 따라 오라클 DB서버와 NLS_LANG 변수 값을 동일하게 설정하는 경우가 많다.
그러나 오라클에서 아래에 나열한 작업이 필요할 경우 꼭 오라클 DB와 NLS_LANG 값을 동일하게 하는 것을 권장하고 있다.
- 데이터베이스로부터 데이터를 export 받을 때
- export 받은 데이터베이스와 같은 CharacterSet을 가진 DB로 export된 파일을 import할 때
- 기타 다국어 지원 애플리케이션에서 목적에 따라 사용할 때
 
NLS_LANG 관련 주요 변수
- NLS_TERRITORY : 영역 설정 - NLS_LANG 변수 값에 의해 자동 설정
    * 설정 방법 예> ALTER SESSION SET NLS_TERRITORY = 'KOREA'
- NLS_LANGUAGE : 언어 설정 - NLS_LANG 변수 값에 의해 자동 설정되는 초기화 변수
     * 설정 방법 예> ALTER SESSION SET NLS_LANGUATE = 'KOREAN'
- NLS_LANG : 언어, 영역, 캐릭터셋 설정 - 기본 값은 'AMERICAN_AMERICA.US7ASCII'
      * 설정 방법 예> OS 환경변수로 설정
- NLS_COMP : SQL에서의 비교 방식(<, >, =) 설정 - BINARY값으로 비교
      * 설정 방법 예> ALTER SESSION SET NLS_COMP = ''
- NLS_SORT : 문자열 정렬방식 설정 -  NLS_LANGUAGE 값에 따라 결정
      * 설정 방법 예> ALTER SESSION SET NLS_SORT = 'KOREAN_M'
 
- NLS_TERRITORY 변수에 따라 그 값이 결정되는 변수
    * NLS_CREDIT(대차대조표 '대변' 항목의 금액표기를 위한 기호. 보통 '공백' 문자)
    * NLS_CURRENCY
    * NLS_DATE_FORMAT
    * NLS_DEBIT(대차대조표 '차변' 항목의 금액표기를 위한 기호. 보통 '마이너스' 문자)
    * NLS_ISO_CURRENCY
    * NLS_LIST_SEPARATOR(숫자를 가로로 나열할 때 각 숫자를 구분하는 기호로,
       우리나라의 경우 콤마다)
    * NLS_MOMETARY_CHARACTERS(금액 표기시 금액을 읽기 쉽게 나누는 문자로
      우리나라에서는 3자리마다 ","를 추가)
    * NLS_NUMERIC_CHARACTERS(소수점 기호와 숫자 그룹핑을 위한 문자 설정.
      우리나라에서는 '.,'이다(dot와 comma).
    * NLS_TIMESTAMP_FORMAT
    * NLS_TIMESTAMP_TZ_FORMAT
    * NLS_DUAL_CURRENCY(유로화 변경 기간 동안의 혼란을 막기 위해 만들어진 매개변수.
      9iR2와 그 이후로는 EU의 유로화 변경이 완료된 상태로 NLS_CURRENCY와 값이 동일하다.
      다만 미래에 다른 지역에서도 통화기호의 변경이 일어나면 사용될 수 있음)
 
NLS_LANGUAGE 변수에 따라 그 값이 결정되는 변수
    * NLS_DATE_LANGUAGE
    * NLS_SORT
    * NLS_
반응형
Posted by [PineTree]
ORACLE/INSTALL2009. 9. 4. 09:40
반응형
US7ASCII
오라클 DB를 사용하는 곳을 보면 아직도 US7ASCII을 Character Set으로 사용하는 곳이 많이 있는 곳으로 알고 있다. 언뜻 보기에는 US7ASCII도 한글을 지원하는 것처럼 보이지만, 사실은 한글이 저장되는 것이 아니고, 한글을이진코드 형태로 변환하여 저장 및 출력하는 형태다.
 
한글을 지원하는 Character Set
현재까지 오라클 DB에서 한글을 사용하려면 Character Set을 "KO16KSC5601", "KO16MSWIN949", "UTF8", "AL32UTF8"만 사용할 수 있다.
 
KO16KSC5601
한글 완성형 코드와 일치하며 일반적으로 많이 사용되는 2350자의 한글, 4888자의 한자와 히라카나, 카타카나, 그리고 영문 및 각종 기호들을 포함하고 있다.
 
KO16MSWIN949
Windows-949 Character Set은 MS사의 Windows Codepage 949번, 즉 한글 코드 페이지를 따른 코드셋이다. 이는 완성형(KO16KSC5601)을 그대로 포함하고 있으며, 추가로 현대 한글 조합으로 표현할 수 있는 모든 가짓수에 해당하는 8822자의 한글을 추가해 포함하고 있다. 그러니까 "Windows-949 Character Set은 KSC5601의 수퍼셋(SuperSet)"이 되며, 따라서 "KO16MSWIN949 또한 KO16KSC5601의 수퍼셋"이 된다.
 
UTF8/AL32UTF8
UTF8 은 유니코드를 구현한 Character Set 중에 가변결이 인코딩 방식을 택하고 있는 Character Set이다. 가변 길이를 위해 일종의 플래그 비트를 각 바이트마다 포함시켜야 하다보니, 한 글자를표현하는데 필요한 바이트의 길이가 최대 3바이트(AL32UTF의 경우 6바이트)까지 늘어날 수 있다.
 
한글지원 Character Set 비교표
                        KO16KSC5601         KO16MSWIN949        UTF8                 AL32UTF8
한글지원 상태        2350자                   11172자                11172자                11172자
캐릭터셋/인코딩   한글완성형             한글조합형      8.1.6이전:Unicode 2.1  9iR1 : Unicode 3.0
버전                                                                     8.1.7이후:Unicode 3.0 9iR2 : Unicode 3.1
                                                                                                          10gR1 : Unicode 3.2
                                                                                                          10gR2 : Unicode 4.0
한글바이트              2Bytes                  2Bytes                  3Bytes                  3Bytes
지원버전                 7.x                      8.0.6 이상               8.0이상                  9iR1이상
National Char-        불가능                  불가능                   가능                      불가능
acterSet으로
설정 가능 여부
 
National CharacterSet
National CharacterSet은 유니코드를 지원하지 않는 CharacterSet을 가진 데이터베이스에서 유니코드를 지원하기 위해 부가적으로 설정할 수 있는 CharacterSet이다.
즉, 하나의 데이터베이스 인스턴스는 "CharacterSet"과 "National CharacterSet"을 가진다. 처음 시스템 구축 당시와는 달리, 한글 이외의 다른 언어를 급히 저장해야 할 필요성이 있는 경우 National CharacterSet을 적절히 활용할 수 있다.
National CharacterSet이 가능한 CharacterSet은 단 두가지로, UTF8과 AL16UTF16(기본값)이다.
Nation CharacterSet을 사용하기 위해서는 특정 타입으로 테이블읠 컬럼 또는 PL/SQL 변수를 선언해야 한다. CHAR와 VARCHAR2, CLOB에 대응되는 National CharacterSet 기반의 타입으로는 NCHAR, NVARCHAR2, NCLOB이 있다.
즉, KO16MSWIN949 데이터베이스에서 다음과 같이 테이블을 생성할 경우,
                 Create Table test_table (
                      varchar_value VARCHAR2(2000),
                      nvarchar_value NVARCHAR2(2000) );
"varchar_value" 컬럼에는 KO16MSWIN949에 속하는 글자들만 저장할 수 있는 반면, nvarchar_value 칼럼에는 유니코드에 속한 모든 글자들을 저장할 수 있다. 약간의 부가적인 코드가 필요할 뿐 실제 프로그래밍 방식은 거의 동일한다.
 
CharacterSet 선택의 원칙
- 한글 지원을 위해서는 반드시 위의 네가지 CharacterSet 중에 하나를 선택해야 함
- 한국에서만 사용하는 시스템이라면 KO16MSWIN949를 선택한다.
- 한국어뿐 아니라 중국어, 일본어, 러시아어 등 다양한 언어로 된 데이터를 저장해야 한다면
   UTF8, AL32UTF8을 선택한다. 인코딩 변환으로 한국어 기반의 CharacterSet에 비해 속도의 저하가
   있다고 알려져 있음
- 대부분이 한글이며, 일부 외국어가 필요하다면, 한국어 기반의 CharacterSet(KO16MSWIN949)을
   사용하되, National CharacterSet을 이용한 칼럼에 외국어를 저장한다.
반응형

'ORACLE > INSTALL' 카테고리의 다른 글

Oracle과 한글 그리고 UTF-8 <네번째>  (0) 2009.09.04
Oracle과 한글 그리고 UTF-8 <세번째>  (0) 2009.09.04
Oracle과 한글 그리고 UTF-8 <첫번째>  (0) 2009.09.04
LINUX ORACLE 10G 패키지  (0) 2009.08.04
LINUX ORALCE 10G설치  (0) 2009.08.04
Posted by [PineTree]
ORACLE/INSTALL2009. 9. 4. 09:38
반응형
DBA가 프로젝트를 시작하면서 가장 먼저 결정해야 할 것은 Oracle Database Character Set이다.
오 라클 DBA로서 개발자나 현업 담당자들에게 UTF-8을 권장하지만, 강권하지 못하는 실정이다. 이유는 현업 담당자들은 기존에 거의 대부분 KO16KSC5601을 사용했거나 일부 사용자들은 US7ASCII를 사용하고 있었기 때문에 UTF-8을 사용할 경우 막연한 불안감이 있으며, 개발자들은 UTF-8로 갈 경우 기존에 가지고 있던 개발 프로그램의 문자열 처리 및 기타 여러가지 수정사항이 많이 발생하기 때문에 반대하는 경우가 허다하다.
 
그래서 오라클과 한글, 특별히 UTF-8을 중점적으로 Oracle Character Set에 관해 알아보자.
 
Oracle Database 한글판?
오라클 데이터베이스를 설치하려고 할 때, 명확한 이해를 못하는 사람들은 "한글판의 설치"를 강하게 주장하는 경우가 있다. 답답한 마음을 든다.
오라클은 M$-Windows처럼 한글판, 영문판 등으로 구분되지 않고, DB의성격 및 크기 그리고 추가적인 기능으로 구분된다. 즉 Oracle DBMS는 언어별 제품 구분이 없다는 야그다.
 
Oracle DBMS에서 다국어 지원
앞 서 언급했듯이 오라클 DBMS는 처음부터 다국어 지원을 목적으로 설계된 일종의 RDBMS 소프트웨어다. 이렇게 다국어를 지원하는 소프트웨어는 몇가지 규칙을 가지고 다국어를 지원하고 있으며, 오라클도 마찬가지로 나름대로 다국어 지원 규칙이 있다.
 
1. 영역(Territory)별 지원
" 영어"를 모국어로 사용하고 있는 나라들도 사용되는 날짜 표기 방법이 다르다. 즉 영국에서는 "일/월/연도"로 표기하는 반면, 미국에서는 "월/일/연도"로 표기한다. 물론 사용하는 통화기호 또한 "파운드"와 "달러"로 각가 다르다. 이 같이 동일 언어를 사용한다고 하더라도 서로 다른 지리적, 사회적 특성으로 말미암아 서로 차이점을 가지게 된다. 이러한 차이점을 반영하는 방법이다.
- 달력 설정 방법 : 어떤 나라는 한 주의 첫번째 요일을 일요일로, 다른 나라는 월요일로 생각함
- 날짜 포맷 : 같은 날짜를 표기하는데 각 지역마다 고유의 방식이 있음
- 통화 기호 : 각 지역마다 통화기호와 금액 표기 방식이 다름
- 숫자 그룹 : 소수점 기호나 숫자를 그룹핑하는 방법이 지역마다 다름
 
2. 언어(Language)적 지원
언어별로 달리 지원을 하는 특성은 다음과 같은 것이 있다.
- Character Set : 각 언어가 저장될 수 있는 Character Set을 대부분 지원함.
   한국어의 경우 KO16KSC5601과 KO16MSWIN949가 있음
- 정렬 방식 : 각 언어별로 정렬하는 규칙이 다름
- 날짜 표기에 사용되는 기호 : 날짜를 표시할 때 사용하는 month, day, day of week, year 같은
   정보를 그 나라에 맞게 번역하여 제공
- 에러메시지 및 UI번역 : 사용자들의 불편을 최소화하기 위해 각 언어별로 번역된 에러 메시지와
   사용자 인터페이스를 제공(에러 메시지의 출력은 전적으로 OS의 언어와 관련이 있음)
 
Oracle과 한국어
한글은 세종대왕께서 천지인을 바탕으로 창제하신 아주 훌륭한 문자다. 그러나 막상 IT업계 종사자들은 비 라틴계언어가 아닌 이상은 한글이건 중국어건, 일어건 다 처리하기 어렵고 짜증나는 언어임에는 틀림없다.
오라클에서 한글을 사용하고 싶을 때 가장 쉬운 방법은 오라클 DBMS를 설치할 때 실행언어에 한국어를 추가하면 아주 쉽게 끝낼 수 있다. 다만 너무 지나친 속도로 마우스 클릭만을 하지 않으며 된다.
설치 단게에서 "한국어"를 선택하면 한국에 관련된 일종의 언어팩과 같은 추가적인 기능이 더 설치된다.
- 번역된 메시지 : 오라클 DBMS와 함께 제공되는 애플리케이션 중, iSQL*Plus나 자바, ADF 기반의 웹 애플리케이션의 경우에는 "언어선택"과 관계없이 번역된 작업 환경이 제공된다. 하지만, SQL*Plus와 같은 기존 애플리케이션은 오라클의 번역 메시지 리소스에 의존하며 이들 파일은 각 언어별로 따로 제공된다. 만일 설치 때에 "한국어"를 선택하지 않으면 한국어 메시지 파일은 설치되지 않는다.
- 폰트 : 오라클 ADF(UIX 혹은 CABO) 기반의 애플리케이션의 경우, "확인", "취소" 등의 버튼이 이미지로 제공되는 경우가 많다. 이런 이미지들은 번역된 메시지를 바탕으로 UIX 엔진에 의해 동적으로 생성된다. 이 이미지가 제대로 생성되기 위해서는 반드시 특정 폰트를 필요로 하게 되는데, 이 폰트는 "한국어"를 선택하지 않을 경우 설치되지 않는다. 이 특정 폰트는 한국어, 중국어(간체, 번체) 그리고 일본어에 대해 각각 제공되므로, 만일 한국어 이외에 이들 언어도 지원해야 할 경우 필수적으로 그 언어들을 선택해야 할 것이다.
- 로케일 정보 : 번역 뿐만 아니라 오라클 DBMS가 다양한 로케일 정보를 가진 클라이언트들과 제대로 통신하기 위해서는 각 국가별, 언어별로 특색있는 로케일 정보를 지니고 있어야 한다. 이들은 날짜 형식("2050-04-14", "Jul 9, 2005" 등), 통화 코드($) 등의 정보를 포함하고 있다. 한국어에 관한 로케일 정보를 위해 반드시 "한국어"를 선택해야 한다.
 
즉, 오라클 DBMS 설치 과정 중 실행환경에서 선택하는 "한국어"와 오라클 DB에서 한국어 저장 및 출력은 아무 상관이 없다는 이야기다. 한국어의 저장과 출력은 Oracle DBMS 설치 과정중 Character set 선택과정에서 무엇을 선택했냐에 따라 결정되는 것이다.
반응형

'ORACLE > INSTALL' 카테고리의 다른 글

Oracle과 한글 그리고 UTF-8 <세번째>  (0) 2009.09.04
Oracle과 한글 그리고 UTF-8 <두번째>  (0) 2009.09.04
LINUX ORACLE 10G 패키지  (0) 2009.08.04
LINUX ORALCE 10G설치  (0) 2009.08.04
solaris10 oracle install 9i 설정값  (0) 2009.05.27
Posted by [PineTree]