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

How to solve the garbled code of linux oracle data

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to solve linux oracle data garbled". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to solve linux oracle data garbled.

Solutions to linux oracle data garbled: 1, view the default language of linux; 2, view the language coding settings of the client; 3, modify the default language of linux oracle database to UTF8.

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

What about the garbled linux oracle data?

Solving the problem of garbled codes in Linux oracle

The root of the garbled problem is the modification of the character set.

1. View the default language of linux

two。 View the language encoding settings of the client

Configuration in the configuration file: cat ~ / .bash_profile

Note that the configuration information is modified:

Export PATHexport 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_HOMEexport PATH=$PATH:$ORACLE_HOME/bin:export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

After the configuration is completed, check whether the configuration is successful. Sql statement: select userenv ('language') from dual

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

The default language for linux installation oracle is:

AMERICAN_AMERICA.WE8MSWIN1252

The Chinese display bits of this language are garbled.

After logging in to the linux system through oracle, do the following:

Modify the method (take UTF8 as an example)

Log in to sqlplus with system DBA privileges

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

For example: AMERICAN_AMERICA.WE8MSWIN1252

Modify:

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; or ALTER DATABASE character set INTERNAL_USE ZHS16GBK;SQL > shutdown immediate;SQL > startupSQL > alter system disable restricted session

4. After modification, there may be errors in the original data in the database, and you need to re-delete the table to re-import the data.

Thank you for your reading, the above is the content of "how to solve linux oracle data garbled". After the study of this article, I believe you have a deeper understanding of how to solve this problem of linux oracle data garbled, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Servers

Wechat

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

12
Report