ORACLE 11G XMLTYPE 迁移切换

xmltype 迁移切换的过程 着实让我郁闷了很久,但是最终解决还是好的,方案已经验证OK了,

针对 xmltype的表 导出的时候有诸多的限制,因为xml的内容格式还是比较多样,oracle 官方也经常修修补补,但还是有漏网之鱼,所以 以后想要迁移xmltype的表,优先建议的步骤是:
一、先转成clob字段,
    例如: create table xxx_clob_tab as select t.xmltypecol.getclobval() xxx_clob  from sourceXMLTab

二、expdp/impdp the xxx_clob

三、convert to xmltype
   注意:在转换之前必须建创建的session 设置一下:

Disable BINARY XML storage and switch to CLOB based storage. The following event can be set at the destination host:
1、alter system set events '31156 trace name context forever, level 0x400'; 

then covert it to xmltype
2 、create table xxx_xml as  select sys.xmltype.createXML(clob column)  as  xmlcol from xxx_clob_tab