0

On Linux Open SuSE I have my env variable set properly, meaning NLS_LANG is set to WE8ISO8859P1, and it is all started and exported in ~/.bashrc However when the system starts and connects to Oracle the session always starts as US7ASCII

What am I missing?

SQL Developer Connection Status query

sh4rk
  • 3
  • 4
  • 1
    What do you mean by 'the system starts and connects to Oracle'? when you boot the system? when you login? what process is trying to connect? – gsalem Dec 23 '19 at 14:20
  • When the Oracle Client-Server session is established it is established as a US7ASCII session. See image.... – sh4rk Dec 23 '19 at 15:03
  • it would have helped greatly if you had shown the query that generated the result set that you show. Also better to paste directly into your message rather than posting a link. That said, it _appears_ that you are looking at v$session_connect_info. The documentation says that CLIENT_CHARSET is "Client character set as specified in the NLS_LANG environmentvariable or in the OCIEnvNlsCreate() call; " So it appears your client is overriding your environment variable. – EdStevens Dec 23 '19 at 16:26
  • The `CLIENT_CHARSET` in `V$SESSION_CONNECT_INFO` view is not reliable. SQLDeveloper is JDBC/Java based which does not use the `NLS_LANG` variable, see [Database JDBC Developer's Guide - Globalization Support](https://docs.oracle.com/database/121/JJDBC/global.htm#JJDBC28643): *Starting from Oracle Database 10g, the NLS_LANG variable is no longer part of the JDBC globalization mechanism. The JDBC driver does not check NLS environment. So, setting it has no effect.* – Wernfried Domscheit Dec 23 '19 at 18:07
  • This was the query used the get the result set in image: `select * from v$session_connect_info where sid = ANY(select sid from v$session where module like '%pcname%');` @EdStevens why is the client overriding its own environment variable? And what needs to be changed so the client starts with the charset as set in environment variable? – sh4rk Dec 23 '19 at 22:34
  • @WernfriedDomscheit SQL Developer was only used to read the status out of the database. The client ist using Oracle instant client to connect to the database, but it's overrriding/not using the set environment variables. – sh4rk Dec 23 '19 at 22:42
  • What is the exact value of NLS_LANG? – Wernfried Domscheit Dec 24 '19 at 08:12
  • @WernfriedDomscheit `NLS_LANG=german_austria.WE8ISO8859P1` – sh4rk Dec 24 '19 at 08:36
  • What do you mean by "*when the system starts and connects to Oracle*"? What is the application which connects to Oracle? – Wernfried Domscheit Dec 24 '19 at 11:31
  • @WernfriedDomscheit when the system which has the Oracle Client(oracle instant client 12) installed starts and connects to the database, it always connects with the wrong client_charset, even though the environment variable(on the client system) is set correctly. – sh4rk Dec 24 '19 at 12:33
  • 1
    You still did not tell us what is you client app. Is it running on the system you're configuring with .bashrc? Do you connect manually or is it a job started by cron or something like that? – gsalem Dec 24 '19 at 12:40
  • Again, what is "the system"? – Wernfried Domscheit Dec 24 '19 at 12:43
  • Why do you think your client runs on `US7ASCII`? As I wrote the `CLIENT_CHARSET` column is useless. Do you have any problem with special characters? – Wernfried Domscheit Dec 24 '19 at 14:50
  • @WernfriedDomscheit yes exactly, some special characters are being lost when being written into the database which makes me believe that the client is actually running the `US7ASCII` `CLIENT_CHARSET` There are actually 16 different systems connecting to the database, and all are shown "correctly" in the `CLIENT_CHARSET` entry, which makes me to believe that the column has the right information. – sh4rk Dec 24 '19 at 18:18

0 Answers0