千家信息网

ORACLE 11G XMLTYPE 迁移切换

发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,xmltype 迁移切换的过程 着实让我郁闷了很久,但是最终解决还是好的,方案已经验证OK了,针对 xmltype的表 导出的时候有诸多的限制,因为xml的内容格式还是比较多样,oracle 官方也经
千家信息网最后更新 2024年09月22日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


0