본문 바로가기
Oracle

ORA-12705: Cannot access NLS data files or invalid environment specified

by Matae0712 2024. 2. 17.

 

ORA-12705: Cannot access NLS data files or invalid environment specified

 

Cause: Either an attempt was made to issue an ALTER SESSION command with an invalid NLS parameter or value; or the environment variable(s) NLS_LANG, ORA_NLSxx, or ORACLE_HOME was incorrectly specified, therefore the NLS data files cannot be located.


Oracle 데이터베이스에 접속할 때 National Language Support(NLS) 설정과 관련된 문제가 발생합니다.

Action: Check the syntax of the ALTER SESSION command and the NLS parameter, correct the syntax and retry the statement, or specify the correct directory path/values in the environment variables.

Oracle 클라이언트 또는 서버에 있는 sqlnet.ora 파일에서 NLS 관련 설정이 올바르게 구성되었는지 확인해야합니다.

이후 DB 설정 확인 

SELECT * FROM NLS_DATABASE_PARAMETERS;

 

 

해당 에러의 원인은 다양합니다.

 

1. ORA-12705 with incorrectly specified NLS_LANG

2. ORA-12705 with incorrectly specified ORA_NLSx

3. ORA-12705 due to Installation Issues

4. ORA-12705 when using Special Charactersets

5. ORA-12705 when connecting via SQL*Net

6. ORA-12705 during Migration

7. ORA-12705 when connecting with SVRMGRL and SQLPLUS

8. ORA-12705 when connecting with Precompiler Aplications

9. ORA-12705 during Export/Import

 

9개의 에러 원인중 대부분은 1번에서 해결이 됩니다.

 

보통 Oracle DBMS 설치 시 ORACLE_HOME에 AMERICA.AMERICAN 또는 KOREA.KOREAN 이런식으로 NLS_LANG 이 설정이 되어집니다. 그러나 OS 적인 부분에서는 NLS_LANG이 설정이 되지 않아 엑셀데이터 또는 어플리케이션 데이터 인서트 시 해당 ERROR 가 발생할 수 있습니다.

 

아래와 같이 .bash_profile 또는 .profile 에 아래와 같이 설정을 해주고 bash 파일 적용 후에 DB를 실행시켜 보면 다시 접속이 원활이 되는 것을 볼 수 있습니다.

 

환경변수 설정

NLS_LANG = KOREAN_KOREA.KO16MSWIN949