The solution of ORA-01756 error reporting
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.