My Oracle Support Banner

Error messages in alert.log contains garbage characters when NLS_CHARCTERSET differs from OS character set (Doc ID 2545929.1)

Last updated on JUNE 04, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 to 18.5.0.0.0 [Release 11.2 to 18]
Information in this document applies to any platform.

Symptoms

Language of RDBMS (Error) messages is determined by NLS_LANGUAGE parameter/setting and
encoding of the localized message depends on the NLS_CHARCTERSET.
When NLS_CHARCTERSET is different from OS locale/character set, the error messages in
alert log which is encoded in NLS_CHARACTERSET cannot be shown properly because OS expects
the messages to be encoded in OS character set.   

This situation can occur more often for customers running localized version
of Windows operating system. For example, locale (code page) in Japanese Windows
is set to 932 (SJIS) by the system, and the default NLS_LANGUAGE setting is
JA16SJIS. AL32UTF8 database generates the localized error messages in alert.log using UTF-8
encoding. These messages appears as garbage characters because of different
character encoding.

Here is a sample testcase runinng on AL32UTF8 database/Japanse Windows operating system:

Windows Operating system - System locale setting is ja-JP
Database setting (default)
  NLS_CHARACTERSET : AL32UTF8
  NLS_LANGUAGE : JAPANESE
  NLS_TERRITORY : JAPAN

$ sqlplus / as sysdba

SQL> alter session set events '0600 trace name ERRORSTACK level 1';

SQL> DECLARE
2   my_error EXCEPTION;
3   PRAGMA EXCEPTION_INIT(my_error, -0600);
4   BEGIN
5   RAISE my_error;
6   END;
7   /
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [600], [], [], [], [], [], [], [],
[], [], [], []
ORA-06512: at line 5


The localized (Japanese) error message "internal error code, arguments"  
written in alert.log is encoded in database character set (NLS_CHARACTERSET).
The message appears as garbage since OS character set is JA16SJIS,
different from database character set.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.