oracle数据库字符编码utf-8改为ZHS16GBK

首先查看服务端字符集
select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET'
NLS_CHARACTERSET WE8MSWIN1252
然后用sys用户进行修改
>sqlplus 
>conn /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 ZHS16GBK;
ORA-12712: new character set must be a superset of old character set
RROR at line 1:
结果报错,提示新字符集必须是老字符集的超集。
于是强制转换
>ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
>shutdown immediate;
>STARTUP;
问题解决。
 
INTERNAL_USE是没有写在文档中的参数,用于强制完成字符集转化

你可能感兴趣的:(oracle)