docker-oracle-xe-11g icon indicating copy to clipboard operation
docker-oracle-xe-11g copied to clipboard

Customize Database Character Set

Open kylescott opened this issue 7 years ago • 7 comments

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?

kylescott avatar Jun 15 '18 00:06 kylescott

I think an initial script will help.

wnameless avatar Jun 15 '18 01:06 wnameless

Add the following to the Dockerfile to set UTF8:

ENV NLS_LANG .AL32UTF8

agustisanchez avatar Dec 31 '18 22:12 agustisanchez

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

gustavoramos00 avatar Jan 29 '19 16:01 gustavoramos00

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.

rponte avatar May 16 '19 17:05 rponte

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;

hieplq avatar Jan 03 '20 20:01 hieplq

i final resolves it with other docker

  1. check out jaspeen to folder [oracle-11g]
  2. go back 1 commit (use commit c1b3f721 because latest public install of oracle 11 is 11.2.0.2, but latest commit is for 11.2.0.4 a private update version for oracle CUSTOMER)
  3. download oracle 11.2.0.2.0 from oracle-database-software-downloads and unzip to [oracle-11g]/install we has [oracle-11g]/install/database
  4. open [oracle-11g]/assets/dbca.rsp find CHARACTERSET="AL32UTF8" and change to your characterset. mine is CHARACTERSET="TH8TISASCII"
  5. build docker docker build -f [oracle-11g]/Dockerfile -t oracle11/local [oracle-11g]
  6. run docker and it will install database for you docker run --privileged --name oracle11 -p 1523:1521 -v /mnt/data/1Dev/project/docker/oracle-11g/install:/install oracle11/local

hieplq avatar Jan 07 '20 08:01 hieplq

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.

tomaszalusky avatar Mar 05 '21 15:03 tomaszalusky