Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize Database Character Set #96

Open
kylescott opened this issue Jun 15, 2018 · 7 comments
Open

Customize Database Character Set #96

kylescott opened this issue Jun 15, 2018 · 7 comments

Comments

@kylescott
Copy link

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?

@wnameless
Copy link
Owner

I think an initial script will help.

@agustisanchez
Copy link

Add the following to the Dockerfile to set UTF8:

ENV NLS_LANG .AL32UTF8

@gustavoramos00
Copy link

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

@rponte
Copy link

rponte commented May 16, 2019

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.

@hieplq
Copy link

hieplq commented Jan 3, 2020

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
Copy link

hieplq commented Jan 7, 2020

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

@tomaszalusky
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants