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.
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
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
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
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. . . . . . . .
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!