<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[『AskWan』]]></title> 
<link>http://www.askwan.com/index.php</link> 
<description><![CDATA[Related About My Life,Unix,Linux,System Architecture,Mysql,PostgreSQL,Oracle Etc ]]></description> 
<language>en-US</language> 
<copyright><![CDATA[『AskWan』]]></copyright>
<item>
<link>http://www.askwan.com/post//</link>
<title><![CDATA[imp导入数据到ORACLE遭遇ORA-12899错误]]></title> 
<author>askwan &lt;askwan@yahoo.cn&gt;</author>
<category><![CDATA[DataBase]]></category>
<pubDate>Tue, 26 May 2009 15:32:14 +0000</pubDate> 
<guid>http://www.askwan.com/post//</guid> 
<description>
<![CDATA[ 
	错如信息：<br/><div class="code">IMP-00019: row rejected due to ORACLE error 12899<br/>IMP-00003: ORACLE error 12899 encountered<br/>ORA-12899: value too large for column &quot;JRGAZX&quot;.&quot;DTLMB&quot;.&quot;CC&quot; (actual: 66, maximum: 50)</div><br/>初步断定是字符集问题，中文在UTF-8里占3个字节，ZHS16GBK里占2个字节,而源dmp文件字符集是ZHS16GBK的库到出来的，现在要导入到目标字符集为UFT-8的库里。<br/><div class="quote"><div class="quote-title">Quotation</div><div class="quote-content">SQL>SHUTDOWN IMMEDIATE<br/>SQL>STARTUP MOUNT <br/>SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION <br/>SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;<br/>SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;<br/>SQL>ALTER DATABASE OPEN </div></div><br/><div class="code">SQL&gt; ALTER DATABASE CHARACTER SET ZHS16GBK ;<br/>ALTER DATABASE CHARACTER SET ZHS16GBK<br/>*ERROR at line 1:<br/>ORA-12712: new character set must be a superset of old character set</div>报字符集不兼容，此时下INTERNAL_USE指令不对字符集超集进行检查： <br/><div class="quote"><div class="quote-title">Quotation</div><div class="quote-content">SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK <br/>SQL>SHUTDOWN IMMEDIATE<br/>SQL>STARTUP</div></div><br/><br/>再次用imp导入，就没有问题了。<br/><div class="code">oracle@server$ imp jrgazx/jrgazx file=/opt/jrgazx1/jrgazx1.dmp&nbsp;&nbsp;fromuser=jrgazx TABLES=CWFXZB,CXQK,DQBGYYPLSJB,DQTZSM,DSYP,DTLMB</div><div class="quote"><div class="quote-title">Quotation</div><div class="quote-content">Import: Release 10.2.0.1.0 - Production on Wed May 27 01:22:54 2009<br/><br/>Copyright (c) 1982, 2005, Oracle.&nbsp;&nbsp;All rights reserved.<br/><br/>Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production<br/>With the Partitioning, OLAP and Data Mining options<br/><br/>Export file created by EXPORT:V10.02.01 via conventional path<br/>import done in US7ASCII character set and AL16UTF16 NCHAR character set<br/>import server uses ZHS16GBK character set (possible charset conversion)<br/>export client uses ZHS16GBK character set (possible charset conversion)<br/>. importing JRGAZX's objects into JRGAZX<br/>. importing JRGAZX's objects into JRGAZX<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CWFXZB"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57197 rows imported<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CXQK"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8471 rows imported<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"DQBGYYPLSJB"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;30593 rows imported<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "DQTZSM"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;11173 rows imported<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "DSYP"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4906 rows imported<br/>. . importing table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"DTLMB"&nbsp;&nbsp;&nbsp;&nbsp; 390372 rows imported<br/>Import terminated successfully without warnings.</div></div>---------END-----------<br/>Tags - <a href="http://www.askwan.com/tags/oracle/" rel="tag">oracle</a> , <a href="http://www.askwan.com/tags/ora-12899/" rel="tag">ora-12899</a> , <a href="http://www.askwan.com/tags/imp/" rel="tag">imp</a> , <a href="http://www.askwan.com/tags/utf-8/" rel="tag">utf-8</a> , <a href="http://www.askwan.com/tags/zhs16gbk/" rel="tag">zhs16gbk</a>
]]>
</description>
</item><item>
<link>http://www.askwan.com/post//#blogcomment</link>
<title><![CDATA[[Comments] imp导入数据到ORACLE遭遇ORA-12899错误]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[Comments]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.askwan.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>