Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NLS_LENGTH_SEMANTICS=CHAR and column storage size
Maxim Demenko schrieb:
> Laurenz Albe schrieb:
>
>> My company considers using UNICODE databases with >> NLS_LENGTH_SEMANTICS=CHAR to avoid problems inserting a value like >> 'Länge' into a CHAR(5) or VARCHAR2(5) column. >> >> Now I am concerned about space requirements of such a database >> because I don't understand enough about the storage of such columns. >> >> DATA_LENGTH for a CHAR(5) or VARCHAR2(5) column will be 20. >> >> - Does that mean that there will be 20 bytes reserved for this column >> in each row? >> - Is it possible that migrated databases might grow by a factor 4? >> - Is there documentation how such columns are stored in Oracle? >> >> Thank you, >> Laurenz Albe
I would like to correct myself regarding the calculation for space
required for char allocation. In opposite to single byte databases the
amount of space allocation for char can vary, because it depends on the
data stored.
It means char(5 char) will require 20 bytes *only* if you store there a
string of 5 fourbytes characters. In case you store strings which are
shorter than maximum length defined , the space will be the byte
representation of *blank padded* data, i.e. 'ä' will require 6 bytes in
a char(5 char) column ( assumed 'ä' needs 2 bytes) and not 20.
Best regards
Maxim Received on Wed Nov 02 2005 - 11:29:04 CST