Open kylescott opened 6 years ago
I think an initial script will help.
Add the following to the Dockerfile
to set UTF8
:
ENV NLS_LANG .AL32UTF8
Not working here.
# Dockerfile
FROM wnameless/oracle-xe-11g
ADD init.sql /docker-entrypoint-initdb.d/
ENV NLS_LANG .WE8MSWIN1252
Then after build and run:
SELECT * FROM nls_database_parameters WHERE parameter LIKE '%CHARACTERSET%';
NLS_CHARACTERSET AL32UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
If I'm not wrong Oracle 11G XE for Linux supports only UTF-8
as character-set. So unfortunately you can't change it at all!
But if you still want to change it to another character-set different from UTF-8
you must use another edition, like Standard Edition 2 and Enterprise Edition.
you can try this docker https://hub.docker.com/r/babim/oracledatabase/
with standard version i saw we can set ORACLE_CHARACTERSET
or try to change (need to carefull, it can make database corruption and can't rollback)
alter system enable restricted session;
ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII;
alter system disable restricted session;
i final resolves it with other docker
docker build -f [oracle-11g]/Dockerfile -t oracle11/local [oracle-11g]
docker run --privileged --name oracle11 -p 1523:1521 -v /mnt/data/1Dev/project/docker/oracle-11g/install:/install oracle11/local
I successfully changed default charset for Oracle docker image of 11g using this SO answer (see comment for how exactly to apply it). I didn't check applicability to wnameless
image, however.
It does not seem that there is a way to set the character set of the database upon creation or I just don't understand how to do so with the setup. Is there a way to install the database with a custom database character set?