Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can't create an Oracle 12 docker container with different charset

Leandro LimaDec 1 2017 — edited Jan 19 2018

Hi there, folks.

The title is pretty explanatory, I'm having a hard time trying to create a container with Oracle 12.2.01 using a different charset.

The official oracle image has AL32UTF8 as charset, but I need it to be WE8MSWIN1252.  After some researche I found a variable called ORACLE_CHARACTERSET so I gave it a try:

docker run -it --name oradocker -p 1521:1521 -e ORACLE_CHARACTERSET=WE8MSWIN1252 store/oracle/database-enterprise:12.2.0.1

But it didn't work, the container was created with no errors but the database itself still had AL32UTF8 as charset.  The said parameter was simply ignored.  Later I realized that this option was for a specific (non-official) source image from github.

A little more research and found the real charset variable is called NLS_LANG.  So I tried it too:

docker run -it --name oradocker -p 1521:1521 --env NLS_LANG=WE8MSWIN1252 store/oracle/database-enterprise:12.2.0.1

And things went terrible.  The container gave me several weird errors when installing/configuring the database, like:

Enter password for SYS:

create pdb : ORCLPDB1

Error 19 initializing SQL*Plus

Invalid NLS character set for this OS environment

Reset Database parameters

Error 19 initializing SQL*Plus

Invalid NLS character set for this OS environment

@lz@@KKKTNSLSNR for Linux: Version 12.2.0.1.0 - Production

@@@@l

@@@@l

@z@l@z@l

@@l@@@````````````````````````@@@@@@@@@@@@@@@@@@@@@l@@@@@@@@@@@@@@@@@@@l@@@@@@@@@@@@@@@@@l@@@@@@@@@@@@@@@@@@@@l@@l@K@l@K@l@@@@@@@@@@@@@@@@@l@@@@@@@@@@@@@@@@@@l@@@@@@@@@@@@@@@@@@@@@@l@@@@@l@@@@@@@@@@@l@@KKK  l

  l

@@@@@@@

(Actual output from terminal)

I thought things were improving since the install now tried to use the parameter.  I just had to figure out the correct one, and I eventually did: the NLS_LANG parameter need the full spec with the language and the country.  So I tried again:

docker run -it --name oradocker -p 1521:1521 --env NLS_LANG=ENGLISH_CANADA.WE8MSWIN1252 store/oracle/database-enterprise:12.2.0.1

Not a single error creating the container, the database was correctly installed and configured, absolutely no errors nor warnings.  So I logged on the database to check the charset and voilà:

SQL> select userenv('LANGUAGE') from dual;

USERENV('LANGUAGE')

----------------------------------------------------

AMERICAN_AMERICA.AL32UTF8

The damn thing did not used the value on the parameter.  Why???  If I put anything else it fails, but an acceptable value seems to be skipped for no reason.

Does anybody ever tried this?  Although Docker is not that new I my researches returned nothing about this specific problem.

Any insights or tips?

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2018
Added on Dec 1 2017
6 comments
5,739 views