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

Run container and entrypoint scripts in UTF-8 by default #109

Closed
mdahm opened this issue May 24, 2022 · 2 comments
Closed

Run container and entrypoint scripts in UTF-8 by default #109

mdahm opened this issue May 24, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mdahm
Copy link

mdahm commented May 24, 2022

We have added scripts to import data at startup containing umlauts and other special characters.
However, this cause corrupt data in the tables. The reason is that that the NLS settings in the Oracle server do not
correspond with the ones of the (Linux container) client.

We were able to fix that with a Dockerfile like this:

FROM gvenzl/oracle-xe:21-slim

# Fix encoding issue on import
ENV LANG        "de_DE.UTF-8"
ENV NLS_LANG    "german_germany.utf8"

You should consider to merge this fix into the default settings...

See https://stackoverflow.com/questions/58394515/how-to-handle-umlaute-like-%C3%84-%C3%96-%C3%9C-in-coldfusion-sql-query-to-insert-into-database

@gvenzl gvenzl self-assigned this Jun 12, 2022
@gvenzl gvenzl added the enhancement New feature or request label Jun 13, 2022
@gvenzl
Copy link
Owner

gvenzl commented Jun 13, 2022

Hi @mdahm,

Thanks a lot, I will get the UTF-8 as default in the container and for the database instance but I'm afraid the GERMAN_GERMANY part is not really a fix that would work for everybody as anybody who doesn't want to have Germany as their territory would now have issues.

The good news is that these environment variables can be set dynamically, so everybody can opt to override them without having to build a new image. Even you can do so now, just pass the two environment variables on with, for example, the -e flag:

docker run --name test -e ORACLE_PASSWORD=LetsTest1 -e LANG=de_DE.UTF-8 -e NLS_LANG=german_germany.utf8 gvenzl/oracle-xe:21-slim
docker exec -ti test bash

bash-4.4$ set | grep -i lang
LANG=de_DE.UTF-8
NLS_LANG=german_germany.utf8

bash-4.4$ sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Mo Jun 13 00:26:21 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Verbunden mit:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> show parameter nls

NAME				     TYPE			       VALUE
------------------------------------ --------------------------------- ------------------------------
nls_calendar			     string			       GREGORIAN
nls_comp			     string			       BINARY
nls_currency                         string                            €
nls_date_format 		     string			       DD.MM.RR
nls_date_language		     string			       GERMAN
nls_dual_currency                    string                            €
nls_iso_currency		     string			       GERMANY
nls_language			     string			       GERMAN
nls_length_semantics		     string			       BYTE
nls_nchar_conv_excp		     string			       FALSE
nls_numeric_characters		     string			       ,.
nls_sort			     string			       GERMAN
nls_territory			     string			       GERMANY
nls_time_format 		     string			       HH24:MI:SSXFF
nls_timestamp_format		     string			       DD.MM.RR HH24:MI:SSXFF
nls_timestamp_tz_format 	     string			       DD.MM.RR HH24:MI:SSXFF TZR
nls_time_tz_format		     string			       HH24:MI:SSXFF TZR

Note how both the Linux OS and the database have received these parameters.

@gvenzl gvenzl changed the title container-entrypoint-startdb.d scripts do not regard umlauts and the like Run container and database in UTF-8 by default Jun 13, 2022
@gvenzl gvenzl changed the title Run container and database in UTF-8 by default Run container and entrypoint scripts in UTF-8 by default Jun 19, 2022
gvenzl added a commit that referenced this issue Jun 19, 2022
Signed-off-by: gvenzl <[email protected]>
@gvenzl
Copy link
Owner

gvenzl commented Jun 19, 2022

Fixed

@gvenzl gvenzl closed this as completed Jun 19, 2022
gvenzl added a commit that referenced this issue Jun 19, 2022
* Enable Diag and Tuning packs (and EM Express) #112

Signed-off-by: gvenzl <[email protected]>

* Disable audit log

Signed-off-by: gvenzl <[email protected]>

* Update ImageDetails.md

Signed-off-by: gvenzl <[email protected]>

* Fix for #109

Signed-off-by: gvenzl <[email protected]>

* Reorder references

Signed-off-by: gvenzl <[email protected]>
gvenzl added a commit that referenced this issue Dec 2, 2024
* Update tests and retries

Signed-off-by: gvenzl <[email protected]>

* Update all references to REGULAR images

Signed-off-by: gvenzl <[email protected]>

* Clean zip files in lib dir

Signed-off-by: gvenzl <[email protected]>

* Remove not needed deps from fortran runtime

Signed-off-by: gvenzl <[email protected]>

* Remove inventory directory

Signed-off-by: gvenzl <[email protected]>

* Move zip file to ORACLE_BASE for host-only vols

Signed-off-by: gvenzl <[email protected]>

* Use SHRINK SPACE for TEMP files

Signed-off-by: gvenzl <[email protected]>

* Exit SQL*Plus on SQL errors

Signed-off-by: gvenzl <[email protected]>

* Add tag and upload scripts

Signed-off-by: gvenzl <[email protected]>

* Remove XDB

Signed-off-by: gvenzl <[email protected]>

* Remove Oracle Text

Signed-off-by: gvenzl <[email protected]>

* Remove Spatial

Signed-off-by: gvenzl <[email protected]>

* Escape $ signs

Signed-off-by: gvenzl <[email protected]>

* Fix rm ctx typo

Signed-off-by: gvenzl <[email protected]>

* Create new TEMP tablespace for SEED

Signed-off-by: gvenzl <[email protected]>

* Shrink UNDO tablespaces

Signed-off-by: gvenzl <[email protected]>

* Intro Artifactory uploads

Signed-off-by: gvenzl <[email protected]>

* Add fully qualified tags

Signed-off-by: gvenzl <[email protected]>

* Update ReadMe

Signed-off-by: gvenzl <[email protected]>

* Undo retention no longer required

Signed-off-by: gvenzl <[email protected]>

* Further reduce 11g slim image

Signed-off-by: gvenzl <[email protected]>

* No longer needed due to new UNDO tablespace creation

Signed-off-by: gvenzl <[email protected]>

* Remove OJVM and Java Packages + Multimedia and XDK dependencies

Signed-off-by: gvenzl <[email protected]>

* Update ReadMe

Signed-off-by: gvenzl <[email protected]>

* Introduce tests for ORACLE_PASSWORD and ORACLE_RANDOM_PASSWORD

Signed-off-by: gvenzl <[email protected]>

* ER #16: provide APP user variables

Signed-off-by: gvenzl <[email protected]>

* Add Ora pwd, random pwd and app user/pwd tests

Signed-off-by: gvenzl <[email protected]>

* Remove workspace manager

Signed-off-by: gvenzl <[email protected]>

* Remove OLAP

Signed-off-by: gvenzl <[email protected]>

* Update package dependencies removal

Signed-off-by: gvenzl <[email protected]>

* Make removal messages consistent

Signed-off-by: gvenzl <[email protected]>

* Fix Java Packages removal

Signed-off-by: gvenzl <[email protected]>

* ER #22: provide GitHub Actions snippet

Signed-off-by: gvenzl <[email protected]>

* Remove Java Package leftovers

Signed-off-by: gvenzl <[email protected]>

* Do not remove SLAX, used for PL/SQL

Signed-off-by: gvenzl <[email protected]>

* Remove Oracle Text, produce SLIM image

Signed-off-by: gvenzl <[email protected]>

* Update dep removal

Signed-off-by: gvenzl <[email protected]>

* Add 18c slim tests

Signed-off-by: gvenzl <[email protected]>

* Do not remove LDAP folder

Signed-off-by: gvenzl <[email protected]>

* Update test descriptions

Signed-off-by: gvenzl <[email protected]>

* SQLPlus: fail on error

Signed-off-by: gvenzl <[email protected]>

* Remove OJVMSYS leftover

Signed-off-by: gvenzl <[email protected]>

* ER #23: Support ORACLE_DATABASE

Signed-off-by: gvenzl <[email protected]>

* Add checkpoint after UNDO switch

Signed-off-by: gvenzl <[email protected]>

* Remove GPX, standalone, can be downloaded

Signed-off-by: gvenzl <[email protected]>

* Update container test run script

Signed-off-by: gvenzl <[email protected]>

* Update ReadMe for OARCLE_DATABASE 18c only

Signed-off-by: gvenzl <[email protected]>

* Update ReadMe with SLIM image

Signed-off-by: gvenzl <[email protected]>

* Add slim images to upload scripts

Signed-off-by: gvenzl <[email protected]>

* Remove Spatial

Signed-off-by: gvenzl <[email protected]>

* Remove Oracle R

Signed-off-by: gvenzl <[email protected]>

* Remove Cluster Ready Services (crs)

Signed-off-by: gvenzl <[email protected]>

* Remove Clsuter Verification Utility

Signed-off-by: gvenzl <[email protected]>

* Remove deinstall directory

Signed-off-by: gvenzl <[email protected]>

* Remove Oracle Database Provider for Distributed Relational Database Architecture (DRDA)

Signed-off-by: gvenzl <[email protected]>

* Remove install directory

Signed-off-by: gvenzl <[email protected]>

* Update ReadMe

Signed-off-by: gvenzl <[email protected]>

* Remove 'ord' and 'ordim' directories

Signed-off-by: gvenzl <[email protected]>

* Remove Universal Installer

Signed-off-by: gvenzl <[email protected]>

* Remove additional components

Signed-off-by: gvenzl <[email protected]>

* update option flag for build script

Signed-off-by: gvenzl <[email protected]>

* Fix typo in sqlnet.ora

Signed-off-by: gvenzl <[email protected]>

* disable netca

Signed-off-by: gvenzl <[email protected]>

* Register new PDB with Listener

Signed-off-by: gvenzl <[email protected]>

* set shared servers to 0

Signed-off-by: gvenzl <[email protected]>

* Fix cleanup for non-localhost bulid containers

Signed-off-by: gvenzl <[email protected]>

* Remove unnecessary bianries and libraries

Signed-off-by: gvenzl <[email protected]>

* Doc: Remove unnecessary bianries and libraries

Signed-off-by: gvenzl <[email protected]>

* Add backup for old images

Signed-off-by: gvenzl <[email protected]>

* use fully qualified image urls

Signed-off-by: gvenzl <[email protected]>

* invoke backup of old images by default

Signed-off-by: gvenzl <[email protected]>

* Add users to ReadMe

Signed-off-by: gvenzl <[email protected]>

* List RPM package removal alphabetically

Signed-off-by: gvenzl <[email protected]>

* List RPM package removal alphabetically

Signed-off-by: gvenzl <[email protected]>

* Gracefully stop listener (now that listener is started manually)

Signed-off-by: gvenzl <[email protected]>

* Fix typo in RPM package removal

Signed-off-by: gvenzl <[email protected]>

* Introducing 21c-full

Signed-off-by: gvenzl <[email protected]>

* Fixing minor Doc bug

Signed-off-by: gvenzl <[email protected]>

* Add image users

Signed-off-by: gvenzl <[email protected]>

* Add 21c supported tags

Signed-off-by: gvenzl <[email protected]>

* Explain persistent containers

Signed-off-by: gvenzl <[email protected]>

* Update 18c to '18c and onwards'

Signed-off-by: gvenzl <[email protected]>

* Add cleanup to 21c images

Signed-off-by: gvenzl <[email protected]>

* Add jOOQ as image user

Signed-off-by: gvenzl <[email protected]>

* Introducing 21c regular

Signed-off-by: gvenzl <[email protected]>

* Fix static ora* location scripts

Signed-off-by: gvenzl <[email protected]>

* Add 21c images for upload

Signed-off-by: gvenzl <[email protected]>

* Update Readme with 21c tags

Signed-off-by: gvenzl <[email protected]>

* Add artifactory upload

Signed-off-by: gvenzl <[email protected]>

* Adding Container Example Start/Creation Script

* Incorporated feedback and fixes from pull request in example script

* Fix for #43

Signed-off-by: gvenzl <[email protected]>

* Remove Oracle Memory Speed (OMS) PMEM binaries

Signed-off-by: gvenzl <[email protected]>

* Remove MLE

Signed-off-by: gvenzl <[email protected]>

* Added PWgen check

* Clean lastlog

Signed-off-by: gvenzl <[email protected]>

* Add 21c backups

Signed-off-by: gvenzl <[email protected]>

* Fix typo for 21 tests

Signed-off-by: gvenzl <[email protected]>

* Fix for #50, set exec permissions for shell scripts

Signed-off-by: gvenzl <[email protected]>

* Add utPLSQL as users

Signed-off-by: gvenzl <[email protected]>

* Better GitHub Actions documentation as per #45

Signed-off-by: gvenzl <[email protected]>

* Document Upscheme user (#56)

Signed-off-by: gvenzl <[email protected]>

* Update RPM package uninstall for new OL image

Signed-off-by: gvenzl <[email protected]>

* Introducing 21c-slim

Signed-off-by: gvenzl <[email protected]>

* Remove ore.so in 18c

Signed-off-by: gvenzl <[email protected]>

* Move REDO resize to other resize operations to avoid 'checkpoint incomplete' during setup

Signed-off-by: gvenzl <[email protected]>

* Resize REDO logs at end to avoid 'checkpoint incomplete' during setup

Signed-off-by: gvenzl <[email protected]>

* Add Sqitch to users as per #46

Signed-off-by: gvenzl <[email protected]>

* 21-slim GA ready

Signed-off-by: gvenzl <[email protected]>

* Put Docker.io login as first step

Signed-off-by: gvenzl <[email protected]>

* Remove Examples folder from main ReadMe

Signed-off-by: gvenzl <[email protected]>

* Assign variable values before input check

Signed-off-by: gvenzl <[email protected]>

* Fix example script 'pwgen' check

Signed-off-by: gvenzl <[email protected]>

* Introduce fix for #64 (Increase SGA_TARGET on high CPU count)

Signed-off-by: gvenzl <[email protected]>

* Remove Replay Upgrade feature

Signed-off-by: gvenzl <[email protected]>

* Clean up METASTYLESHEET LOBs

Signed-off-by: gvenzl <[email protected]>

* Rebuild pdbsync indexes

Signed-off-by: gvenzl <[email protected]>

* Clean up fed blocks

Signed-off-by: gvenzl <[email protected]>

* Shrink CDB SYSTEM tablespace datafile

Signed-off-by: gvenzl <[email protected]>

* List Ruby packages users (#66)

Signed-off-by: gvenzl <[email protected]>

* Shrink 21c CDB TEMP datafile

Signed-off-by: gvenzl <[email protected]>

* Shrink 18c TEMP datafile

Signed-off-by: gvenzl <[email protected]>

* Remove OLAP library

Signed-off-by: gvenzl <[email protected]>

* Do not increase SGA_TARGET for 11g (fixes #71) (#72)

Oracle Database 11g XE is restricted to use no more than 1 GB of memory. The
fix for #64 sets the memory to 1.5 GB, so that the database fails to start with
the error:

ORA-47500: XE edition memory parameter invalid or not specified

* Update note for #72

Signed-off-by: gvenzl <[email protected]>

* ER #60: introduce container minimum memory check

Signed-off-by: gvenzl <[email protected]>

* ER #61: introduce container minimum memory check

Signed-off-by: gvenzl <[email protected]>

* Update utPLSQL references as per #77

Signed-off-by: gvenzl <[email protected]>

* Provide TDE setup script example as per #70

Signed-off-by: gvenzl <[email protected]>

* More solid fix for #64

Signed-off-by: gvenzl <[email protected]>

* Enhance documentation for secrets (#69)

Signed-off-by: gvenzl <[email protected]>

* Document HitHub Action container label usage (#81)

Signed-off-by: gvenzl <[email protected]>

* Fix doc bug for APP_USER

Signed-off-by: gvenzl <[email protected]>

* Add CREATE SYNONYM permission to APP_USER. (#94)

* Externalise script createAppUser (#103)

Closes #102

* Modularize app user creation

Signed-off-by: gvenzl <[email protected]>

* Update image users

Signed-off-by: gvenzl <[email protected]>

* Fix typo

Signed-off-by: gvenzl <[email protected]>

* Fix #104

Signed-off-by: gvenzl <[email protected]>

* Inlcude pam package for OS based auth (#57)

Signed-off-by: gvenzl <[email protected]>

* Generic fix for #64

Signed-off-by: gvenzl <[email protected]>

* Include 21-slim in backups

Signed-off-by: gvenzl <[email protected]>

* Pre-create container init folders (#108)

Signed-off-by: gvenzl <[email protected]>

* Enable Diag and Tuning packs (and EM Express) #112

Signed-off-by: gvenzl <[email protected]>

* Disable audit log

Signed-off-by: gvenzl <[email protected]>

* Update ImageDetails.md

Signed-off-by: gvenzl <[email protected]>

* Fix for #109

Signed-off-by: gvenzl <[email protected]>

* Reorder references

Signed-off-by: gvenzl <[email protected]>

* Update references

Signed-off-by: gvenzl <[email protected]>

* Document Apple M chips (#63)

Signed-off-by: gvenzl <[email protected]>

* Implemented --nowait (#119)

Signed-off-by: gvenzl <[email protected]>

* Fix missing link for colima install

Signed-off-by: gvenzl <[email protected]>

* Introduce faststart images ER #36

Signed-off-by: gvenzl <[email protected]>

* Introduce faststart images (ER #36)

Signed-off-by: gvenzl <[email protected]>

* Provide images on GHCR (ER #131)

Signed-off-by: gvenzl <[email protected]>

* fix #144

Signed-off-by: gvenzl <[email protected]>

* Include -faststart images in backup

Signed-off-by: gvenzl <[email protected]>

* Document recursive init scripts, make output a bit more readable

Signed-off-by: gvenzl <[email protected]>

* Fix #142, use default memory for BUILDKIT

Signed-off-by: gvenzl <[email protected]>

* #157: Futher specify faststart image use not being for persistency

Signed-off-by: gvenzl <[email protected]>

* Fix typo #168

Signed-off-by: gvenzl <[email protected]>

* #171 Allow mounting external volume for oradata subfolders (#172)

Signed-off-by: Loïc LEFEVRE <[email protected]>

* Fix #171: do not delete directory structure

Signed-off-by: gvenzl <[email protected]>

* Make init script against XE more prominent in README

Signed-off-by: gvenzl <[email protected]>

* Add 'find' utility for 11.2 build

Signed-off-by: gvenzl <[email protected]>

* Add details for enabling In-Memory Columnar processing on XE #188 (#189)

* 21c multiple layers

Signed-off-by: gvenzl <[email protected]>

* multiple layers faststart

Signed-off-by: gvenzl <[email protected]>

* Multiple layers 18c

Signed-off-by: gvenzl <[email protected]>

* Update faststart for 11g

Signed-off-by: gvenzl <[email protected]>

* harmonize Dockerfiles

Signed-off-by: gvenzl <[email protected]>

* multi-layer 11g

Signed-off-by: gvenzl <[email protected]>

* Use user- / group name for chown

Signed-off-by: gvenzl <[email protected]>

* Document -x buildContainerImage.sh parameter

Signed-off-by: gvenzl <[email protected]>

* use env vars instead of literal

Signed-off-by: gvenzl <[email protected]>

* Remove unnecessary timezone files

Signed-off-by: gvenzl <[email protected]>

* Remove unecessary binaries

Signed-off-by: gvenzl <[email protected]>

* Update ImageDetails with timezone files

Signed-off-by: gvenzl <[email protected]>

* Cleanup comments

Signed-off-by: gvenzl <[email protected]>

* Remove old timezone info 18c

Signed-off-by: gvenzl <[email protected]>

* Further remove binaries in 18c

Signed-off-by: gvenzl <[email protected]>

* Use 7z for data files uncompress

Signed-off-by: gvenzl <[email protected]>

* Don't shasum faststart image build

Signed-off-by: gvenzl <[email protected]>

* Run ORACLE_DATABASE case insensitive tests

Signed-off-by: gvenzl <[email protected]>

* Use docker.io login

Signed-off-by: gvenzl <[email protected]>

* Update Quarkus Reference

Signed-off-by: gvenzl <[email protected]>

* Migrate Benthos

Signed-off-by: gvenzl <[email protected]>

* Migrate Hibernate Reactive

Signed-off-by: gvenzl <[email protected]>

* Healthcheck PDB status for 18c+

Signed-off-by: gvenzl <[email protected]>

* Update resetPassword param documentation

Signed-off-by: gvenzl <[email protected]>

* Update Spring Data reference

Signed-off-by: gvenzl <[email protected]>

* Update .bash_profile variables

Signed-off-by: gvenzl <[email protected]>

* Backport healthcheck from Free images (#215)

Signed-off-by: gvenzl <[email protected]>

* Use XEPDB1 as default

Signed-off-by: gvenzl <[email protected]>

* Update jOOQ reference and 'sqlplus'

Signed-off-by: gvenzl <[email protected]>

* Fix #202, /oradata permissions

Signed-off-by: gvenzl <[email protected]>

* Provide user warning of old images

Signed-off-by: gvenzl <[email protected]>

* Update Ruby on Rails ActiveRecord user

Signed-off-by: gvenzl <[email protected]>

* Provide FREE,FREEPDB1 service names (ER #238)

Signed-off-by: Gerald Venzl <[email protected]>

* Update readme

Signed-off-by: Gerald Venzl <[email protected]>

* Update labels

Signed-off-by: Gerald Venzl <[email protected]>

* Fix for #57

Signed-off-by: Gerald Venzl <[email protected]>

* Upgrade 7zip

Signed-off-by: Gerald Venzl <[email protected]>

* Update ReadMe and docker startup script

Signed-off-by: Gerald Venzl <[email protected]>

---------

Signed-off-by: gvenzl <[email protected]>
Signed-off-by: Loïc LEFEVRE <[email protected]>
Signed-off-by: Gerald Venzl <[email protected]>
Co-authored-by: Daniel Haanpaa [Lab0] <[email protected]>
Co-authored-by: cedric-v3 <[email protected]>
Co-authored-by: Simon Potter <[email protected]>
Co-authored-by: Neil Crow <[email protected]>
Co-authored-by: Loïc LEFEVRE <[email protected]>
Co-authored-by: Loïc LEFEVRE <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants