Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of ORA-01756 error reporting

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Today, I would like to talk to you about the solution to the error report of ORA-01756. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Today, when trying to execute a script containing Chinese characters, the following error occurred: "ora-01756:quoted string not properly terminated".

After checking the script, no common problems such as mismatch of quotation marks were found; no error was reported when copying the statements reported in the script to the sqlplus environment. To sum up, the preliminary conclusion is related to the database character set.

Troubleshooting:

1. View Linux system environment variabl

[root@localhost Desktop] # echo $NLS_LANG

SIMPLIFIED CHINESE_CHINA.ZHS32GB18030

[root@localhost Desktop] #

two。 View the userenv of the database

SQL > select userenv ('language') from dual

USERENV ('LANGUAGE')

SIMPLIFIED CHINESE_CHINA.AL32UTF8

SQL >

3. View the NLS_LANG of the database

SQL > show parameter NLS_LANG

NAME TYPE VALUE

Nls_language string SIMPLIFIED CHINESE

SQL >

We found that the character set of the database is inconsistent with the character set set by Linux. Next, we need to modify the Linux character set to be consistent with the database character set.

Solution:

Modify the NLS_LANG settings in .bash _ profile for root users and oracle users. Take root users as an example, the modification method is as follows:

1. Modify the NLS_LANG setting in ~ / .bash_profile.

[root@localhost Desktop] # vim ~ / .bash_profile

If [- f ~ / .bashrc]; then

. ~ / .bashrc

Fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

Export PATH

Export ORACLE_SID=orcl

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Export PATH=$ORACLE_HOME/bin:$PATH

Export NLS_LANG= "SIMPLIFIED CHINESE_CHINA.ZHS32GB18030"

Umask 022

Change the red part to:

Export NLS_LANG= "SIMPLIFIED CHINESE_CHINA.AL32UTF8"

two。 Reload the modified .bash_profile file

[root@localhost oracle] # source ~ / .bash_profile

Note:

It is strongly recommended to restart the operating system after modifying the configuration

After reading the above, do you have any further understanding of the solution to the error report of ORA-01756? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report