ORA-12899: value too large for column (actual: 27, maximum: 20)错误解决

ORA-12899: value too large for column (actual: 27, maximum: 20)错误解决

  oracle11g导入数据时报以下错误,这是因为原来数据库的编码是GBK的,每个汉字两个字节,但新数据库是UTF-8的,每个汉字是三个字节的,导致超过长度了。

  解决方法:

  打开cmd命令窗口,输入“sqlplus /nolog”,进入“SQL>”的输入符下,按照下面给出的命令一次执行就可以了。

SQL>connect username/password as SYSDBA;
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 ZHS16GBK ;
ALTER DATABASE CHARACTER SET ZHS16GBK;
*ERROR at line 1:
ORA-12712: new character set must be a superset of old character set

此时报错,不必慌张。提示新字符集必须是超集,此时INTRENAL_USE指令不对字符集超集进行检查。输入以下命令即可:

SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
SQL>SHUTDOWN IMMEDIATE;
SQL>STARTUP;

此时完成字符集转换。

你可能感兴趣的:(oracle)