解决oracle数据表中文显示框框或者乱码的问题

字符集导致,修改字符集

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 5049942016 bytes
Fixed Size                  8631096 bytes
Variable Size            1191185608 bytes
Database Buffers         3841982464 bytes
Redo Buffers                8142848 bytes
Database mounted.
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

System altered.

SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;

System altered.

SQL>  alter database open;

Database altered.

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup; 
ORACLE instance started.

Total System Global Area 5049942016 bytes
Fixed Size                  8631096 bytes
Variable Size            1191185608 bytes
Database Buffers         3841982464 bytes
Redo Buffers                8142848 bytes
Database mounted.
Database opened.
SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@cnbugs1 ~]$ vim .bash_profile 
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
source .bash_profile 

重新再去创建或者导入表后,显示正常!

发表评论

后才能评论