Set echo on
--
declare
  logDDLOperations    varchar2(4000) := 'alter session Set events=''31098 trace name context forever''';
  enablePartitioning  varchar2(4000) := 'alter session Set events=''2321 trace name context forever, level 1''';
begin
  execute immediate enablePartitioning;
  execute immediate logDDLOperations;  
  
  dbms_xmlschema.registerSchema
  (
    schemaURL => '%SCHEMAURL%',
    schemaDoc => xdbURIType('%BASEFOLDER%/xsd/purchaseOrder.xsd').getXML(),
    local     => TRUE,
    genTypes  => TRUE,
    genTables => TRUE,
    ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
  );
end;
/
pause
--
call xdb_analyze_xmlschema.renameCollectionTable ('PURCHASEORDER','"XMLDATA"."LINEITEMS"."LINEITEM"','LINEITEM')
/
call xdb_analyze_xmlschema.renameCollectionTable ('PURCHASEORDER','"XMLDATA"."ACTIONS"."ACTION"','ACTION')
/
select TABLE_NAME, PARTITION_NAME
  from USER_TAB_PARTITIONS
/
quit
