title: How can I create an Oracle database in docker, using UTF8 as national character set?
body: <p>I have created a docker container, containing an Oracle 18 XE instance with a container database and a pluggable database. The application I want to test with this pluggable database requires the database to have national character set UTF8. I can not change this, it is just a requirement.</p>
  <p>The (empty) database is created and up and running. The character set however is AL16UTF16. I tried several options to change the national character set of both the container database and the pluggable database, all without success.</p>
  <p>The procedure I followed, is described <a href="https://blogs.oracle.com/oraclemagazine/deliver-oracle-database-18c-express-edition-in-containers" rel="nofollow noreferrer">here</a>. The docker images I downloaded from <a href="https://github.com/oracle/docker-images" rel="nofollow noreferrer">github</a>, and the installer for Oracle 18c Express Edition from <a href="https://www.oracle.com/database/technologies/xe-downloads.html" rel="nofollow noreferrer">Oracle</a>.</p>
  <p>I tried to add the parameter to the docker run command:
  <code>-e ORACLE_NLS_NCHAR_CHARACTERSET=UTF8</code>, without success.</p>
  <p>Before creating the docker image, I tried adding the setting <code>NLS_NCHAR_CHARACTERSET=UTF8</code> to the configuration file <code>oracle-xe-18c.conf</code>, without success.</p>
  <p>I tried the instructions from <a href="https://www.stechies.com/change-national-character-set-oracle-database-utf8/" rel="nofollow noreferrer">this site</a>, without success. While the database is empty, trying to change the national character set results in the message <code>ORA-12717: Cannot issue ALTER DATABASE NATIONAL CHARACTER SET when NCLOB, NCHAR or NVARCHAR2 data exists</code>. I checked columns affected by the change of national character set with <code>select owner, table_name, column_name from dba_tab_columns where (data_type = 'NCHAR' or data_type = 'NVARCHAR2' or data_type = 'NCLOB') and owner != 'SYS' and owner != 'SYSTEM';</code>, and then a <code>select *</code> on all columns found. They all contained no data.</p>
  <p>How can I create an Oracle database in docker, using the national character set UTF8?</p>