Home > Database > Oracle > body text

What to do if the oracle database is garbled

藏色散人
Release: 2021-12-15 14:41:52
Original
16715 people have browsed it

Oracle database garbled solution: 1. Log in to the database and execute the "select userenv('language') from dual;" statement; 2. Add the system environment variable "NLS_LANG" and match its value with the database encoding The settings remain consistent.

What to do if the oracle database is garbled

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

What should I do if the oracle database is garbled?

Solution to the problem of garbled data display in Oracle database

1. Problem description:

Importing data export files from other databases locally When creating a new database, the imported data is all garbled. Generally, the values ​​of the columns in the data table are similar to "?????", that is, most of the content is in the form of ?. The initial judgment is that the encoding of the Oracle client and the database are inconsistent. Garbled code problems are common in many places in various technologies, and the root cause is mainly caused by inconsistent data encoding. According to its principles, troubleshooting data encoding can basically solve the problem of garbled characters.

2. Solution:
Step 1: For Oracle database, you can use the sqlplus tool or PL/SQL tool. After logging in to the database, execute select userenv('language') from dual; statement, which can query the encoding format used by the current database. Here, use sqlplus to log in to the database and execute the above query statement, as shown in the following figure:

Step 2: Add the system environment variable NLS_LANG and keep its value with the database encoding setting Consistent, that is, the query result of the previous step is SIMPLIFIED CHINESE_CHINA.ZHS16GBK. Just click Save.

Step 3: Close the current client query tool, reopen it to check and verify whether the normal Chinese encoding has been restored.

Related recommendations: oracle database learning tutorial

The above is the detailed content of What to do if the oracle database is garbled. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!