Get the App
SLTechnology News&Howtos  ›  Servers  › 

What about the Chinese garbled code of oracle in Linux?

Shulou Source: shulou.com Published: 2022-06-03 06:33:31 09月21日 Update

What about the Chinese garbled code of oracle in Linux? I believe that there are many people do not understand, today, in order to let you know more about the solution of oracle Chinese garbled code, so give you a summary of the following content, let's look down together.

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.

The above is the Linux oracle Chinese garbled how to do a brief introduction, of course, the detailed use of the above differences have to be used by everyone to understand. If you want to know more, welcome to follow the industry information channel!

Tags: Garbled Chinese data language configuration database what to do method system code problem login different abbreviated success information content character character set customer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Shulou Information vpn Microsoft