文中使用的Oracle版本为11g
原字集:
SQL> select * from NLS_DATABASE_parameters;
PARAMETER VALUE
------------------------------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.1.0.7.0
执行以下脚本进行切换:
sql>shutdown immediate;
sql>startup mount;
sql>alter system enable restricted session;
sql>alter system set JOB_QUEUE_PROCESSES=0;
sql>alter system set AQ_TM_PROCESSES=0;
sql>ALTER DATABASE OPEN;
sql>alter database character set INTERNAL_USE UTF8;
执行命令说明:
- 先关闭数据库;
- 启动挂载命令;
- 切换至受限模式;
- 将job队列可启动进程数设置为0(JOB_QUEUE_PROCESSES=0);
- 关闭队列监视协调器(AQ_TM_PROCESSES=0);
- 提交修改并打开数据库;
- 将字符集改为UTF8;