2
votes

I tried to connect to oracle db 11 in docker (https://hub.docker.com/r/sath89/oracle-xe-11g/).

Started docker with command:

docker run -d -p 8080:8080 -p 1521:1521 -e DEFAULT_SYS_PASS=sYs-p@ssw0rd sath89/oracle-xe-11g

From this description: hostname: localhost port: 1521 sid: xe username: system password: oracle

made an url - jdbc:oracle:thin:@192.168.99.100:1521:xe

With squirrel-sql have an error: class java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-12705: Cannot access NLS data files or invalid environment specified

But if I try to connect with SQLplus thats ok:

docker exec -ti oracle_id sqlplus bash

sqlplus
2
dba-oracle.com/t_ora_12705_error.htm might be helpful. You might need to export some environment variables.yamenk

2 Answers

0
votes

The SquirrelSQL needs to have some NLS variables set before logging in. For the Docker connection, note that you have "bash" at the end of your command. This not only tells the connection that you'll be using bash shell, it sets up the environment to connect using the bash_rc, (and possibly a profile, too). You're coming from your local machine vs. an SSH, so the local machine is being used instead of the SSH.

I believe there is a squirrel-sql.bat file that could unset and then set the environment or better yet, let's just unset it in the registry and let the local connection take its course: On your Windows maching:

Do a search for an NLS_LANG subkey in the registry: \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, rename it, save the change, reboot and retry.

0
votes

I’m not familiar with Squirrel SQL, but you may also be missing a proper set up of the jar files. Look and see if your jar files are configured correctly, depending on your version, its going to look something like this:

%Oracle_\jdbc\lib\ojdbc.jar