选择静默安装的安装字符集为默认的ZHS16GBK,工作中字符集为为AL32UTF8
一、登录oracle
sqlplus / as sysdba shutdown immediate;
STARTUP MOUNT;
ALTER SESSION SET SQL_TRACE=TRUE;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE character set INTERNAL_USE AL32UTF8;
ALTER SESSION SET SQL_TRACE=FALSE;
shutdown immediate;
startup;
风险分析:执行上述命令,有可能造成数据库中已有数据混乱的情况,所以在进行操作前, 要进行数据库的备份操作;
因为我是刚刚静默安装完成所有省略了备份库
二、查看当前字符集
SQL> select userenv('language') from dual; USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8 查看变更记录 SQL> SELECT parameter, value FROM v$nls_parameters WHERE parameter LIKE '%CHARACTERSET'; PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
AL32UTF8 NLS_NCHAR_CHARACTERSET
AL16UTF16