Home > Database > Oracle > If you query the character encoding of oracle

If you query the character encoding of oracle

青灯夜游
Release: 2022-03-02 18:00:02
Original
18149 people have browsed it

How to query Oracle character encoding: 1. Use the "select userenv('language') from dual;" statement to view; 2. Use the "SELECT * FROM NLS_DATABASE_PARAMETERS;" statement to view.

If you query the character encoding of oracle

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

How to check the character encoding of Oracle database

1. Query the character set of Oracle Server:

There are many ways to find out the character set of the oracle server. The more intuitive query method is the following:

SQL>select userenv(‘language’) from dual;
Copy after login

The results are as follows: AMERICAN _ AMERICA. ZHS16GBK.

2. Query the character set of the dmp file:

The dmp file exported with Oracle's exp tool also contains character set information. The second and third characters of the dmp file 3 bytes record the character set of the dmp file. If the dmp file is not large, such as only a few M or dozens of M, you can open it with UltraEdit (in hexadecimal mode), look at the contents of the second and third bytes, such as 0354, and then use the following SQL to find out its corresponding characters Set:

SQL> select nls_charset_name(to_number('0354','xxxx')) from dual;

ZHS16GBK
Copy after login

3. You can also obtain Oracle’s database character set through the following view

SELECT * FROM NLS_DATABASE_PARAMETERS;--数据库服务器字符集,来源于PROPS$
SELECT * FROM NLS_INSTANCE_PARAMETERS;--客户端字符集,来源于V$PARAMETER
SELECT * FROM NLS_SESSION_PARAMETERS;--会话字符集,来源于V$NLS_PARAMETERS,表示会话自己的设置,可能是会话的环境变量或者是由ALTER SESSION完成,如果会话没有特殊的设置,将与NLS_INSTANCE_PARAMETERS一致
4ELECT * FROM V$NLS_PARAMETERS;
SELECT * FROM SYS.PROPS$;
Copy after login

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of If you query the character encoding of oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template