Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Regarding point 4 of this question (which is in reference to MS SQL Server):

  1. VARCHAR does not store Unicode characters.
  2. NVARCHAR does store Unicode characters.
  3. Today's applications should always be Unicode compatible.
  4. NVARCHAR takes twice the amount of space to store it.
  5. Point 4 doesn't matter because storage space is extremely inexpensive.

Is the same true for Oracle database as well?

share|improve this question
    
Actually, disk space isn't the problem. See another SO question: stackoverflow.com/questions/35366/… –  gbn Sep 8 '11 at 17:50

3 Answers 3

Twice the amount of what? If we assume that the Character Set is an 8 bit one like we8iso8859p1 and the National Character Set is the default al16utf16 then yes (mostly).

share|improve this answer

Yes - if you're using AL32UTF8 for your character set, and using AL16UTF16 for your national character set, and your data is mostly in ASCII.

AL16UTF16 always requires 2 bytes per character, AL32UTF8 is backwards compatible with ASCII and will only use 1 byte for ASCII characters.

But for some languages AL16UTF16 may be more efficient than AL32UTF8.

share|improve this answer

Not exactly. Oracle accommodates both byte semantics and character semantics for VARCHAR. The default for character types is byte semantics; a column defined as VARCHAR2(10) holds 10 bytes, which might not be the same as 10 characters. The default for new columns is controlled by the parameter NLS_LENGTH_SEMANTICS.

But in a UTF-8 database, you can define a column as VARCHAR2(10 CHAR), which will hold 10 characters. Even if five of them are single-byte characters and five of them are multi-byte characters, all 10 will fit.

NCHAR and NVARCHAR2 always use character semantics. A column of NVARCHAR(20) will hold 20 characters, but it might take 60 bytes to hold all of them.

NVARCHAR2 is limited to 4000 bytes, which is 4000 single-byte characters, but only a third that many multi-byte characters. (Assuming a maximum of three bytes per character.)

Disk space is much less expensive than it used to be. But you still have to get data off the disk for it to be useful. More bytes, more time; more time, more expense. IME, cost of disk space doesn't matter only to people who don't have to pay for it.

More details in Oracle Database Concepts.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.