oracle 11g 将字符集从WE8MSWIN1252修改为ZHS16GBK过程
1、查看相关参数配置
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252
SQL> show parameter AQ_TM_PROCESSES
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 1
SQL> show parameter job
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
job_queue_processes integer 10
2、重启数据库到mount,修改参数,开启受限模式,并打开数据库
shutdown immediate
startup mount
ALTER SYSTEM enable restricted session;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
alter database open;
3、使用INTERNAL_USE参数修改字符集
ALTER DATABASE CHARACTER SET ZHS16GBK
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
Database altered.SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
4、重启数据库到mount,关闭受限陌生,并改回参数,打开数据库
shutdown immediate
startup mount
alter system set job_queue_processes =10 scope=both;
alter system set aq_tm_processes=1 scope=both;
alter system disable restricted session;
SQL> alter database open;Database altered.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
--转自