How to change the oracle xe character set to ZHS16GBK, xezhs16gbk
After Oracle XE runs the installation program, the simple default value is SIMPLIFIED CHINESE_CHINA.AL32UTF8. You can change it to ZHS16GBK using the following method.
The character set of the client must be the same as that of the server to correctly display non-Ascii characters of the database. The character set settings of the client exist in multiple places: session> environment variable> registry> parameter file
The character set must be consistent, but the language settings can be different. We recommend that you use English for language settings. If the character set is zhs16gbk, The nls_lang can be American.
View database character sets
/* Server Character Set */select * from nls_database_parameters; -- it comes from props $/* client Environment Character Set */select * from nls_instance_parameters; -- It comes from v $ parameter/* session Environment Character Set */select * from nls_session_parameters; -- it comes from v $ nls_parameters
Set server Character Set
/* 1 log on to sys user */SQL> connect sys/manager as sysdba;/* 2 shut down the database */SQL> shutdown immediate; the database has been closed. The database has been detached. The ORACLE routine has been disabled. /* 3 database load */SQL> startup mount; the ORACLE routine has been started. Total System Global Area 1068937216 bytesFixed Size 2260048 bytesVariable Size 788530096 bytesDatabase Buffers 272629760 bytesRedo Buffers 5517312 bytes database loaded. /* 4. Modify the data Character Set */SQL> alter system enable restricted session; the system has changed. SQL> alter system set JOB_QUEUE_PROCESSES = 0; the system has changed. SQL> alter system set AQ_TM_PROCESSES = 0; the system has changed. SQL> alter database open; the database has been changed. SQL> alter database character set internal_use ZHS16GBK; the database has been changed. /* 5. Restart the database */SQL> shutdown immediate; the database has been closed. The database has been detached. The ORACLE routine has been disabled. SQL> startup; the ORACLE routine has been started. Total System Global Area 1068937216 bytesFixed Size 2260048 bytesVariable Size 788530096 bytesDatabase Buffers 272629760 bytesRedo Buffers 5517312 bytes database loaded. The database has been opened.