shutdown immediate;SQL> startup mount;SQL> alter system..."."/> shutdown immediate;SQL> startup mount;SQL> alter system...".">

Home  >  Article  >  Operation and Maintenance  >  How to deal with garbled characters in oracle linux

How to deal with garbled characters in oracle linux

藏色散人
藏色散人Original
2020-02-04 09:58:431981browse

How to deal with garbled characters in oracle linux

Linux oracle Chinese garbled problem solution

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

1. Check the default language of linux

Recommended: "Linux Tutorial"

How to deal with garbled characters in oracle linux

2. Check the client’s language encoding settings

Configuration in the configuration file: cat ~/.bash_profile

Pay attention to modifying 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

After configuration, 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

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;

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;

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.

The above is the detailed content of How to deal with garbled characters in oracle linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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