What to do if linux oracle data is garbled

藏色散人
Release: 2021-11-24 11:11:15
Original
3822 people have browsed it

Solutions to garbled linux oracle data: 1. Check the default language of linux; 2. Check the client's language encoding settings; 3. Modify the default language of the linux oracle database to UTF8.

What to do if linux oracle data is garbled

The operating environment of this article: linux5.9.8 system, Oracle Database 20c, Dell G3 computer.

What to do if Linux oracle data is garbled?

#Linux oracle Chinese garbled problem solution

The root cause of the garbled problem is characters Set modification

1. Check the default language of linux

What to do if linux oracle data is garbled

2. Check the client’s language encoding settings

Configuration in the configuration file: cat ~/.bash_profile

Pay attention to modify the configuration information:

export PATH export ORACLE_HOME=/usr/lib/oracle/11.2/client64/ export LD_LIBRARY_PATH=:$ORACLE_HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH:. export TNS_ADMIN=$ORACLE_HOME export PATH=$PATH:$ORACLE_HOME/bin: export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
Copy after login

After configuring, check whether the configuration is successful, sql statement: select userenv('language') from dual

3. Check the encoding used by the database: modify the default language of the linux oracle database

linux The default language for installing oracle is:

AMERICAN_AMERICA.WE8MSWIN1252
Copy after login

The Chinese display bit in this language is garbled.

After logging in to the Linux system through oracle, perform the following operations:

Modification method (taking changing to UTF8 as an example)

Log in to sqlplus with system DBA authority

$ sqlplus / as sysdba; select userenv('language') from dual;
Copy after login

For example: AMERICAN_AMERICA.WE8MSWIN1252

Modification:

SQL> shutdown immediate; SQL> startup mount; SQL> alter system enable restricted session; SQL> alter system set job_queue_processes=0; SQL> alter database open; SQL> alter database character set internal_use AL32UTF8; 或者 ALTER DATABASE character set INTERNAL_USE ZHS16GBK; SQL> shutdown immediate; SQL> startup SQL>alter system disable restricted session;
Copy after login

4. After modification, errors may occur in the original data in the database, and the table needs to be deleted and the data re-imported. . . . . . . .

Recommended learning: "linux video tutorial"

The above is the detailed content of What to do if linux oracle data 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
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!