Monday, 2 June 2014

To export the data from the database in Websphere using Massextract utility.

We can use the massextract utility to extract the data from the database into an XML document. This utility makes use of an XML file which can be called as the extraction filter  which is an XML document having the query to extract the data.

Command to execute -
massextract.cmd -filter SampleFilter.xml -outfile SampleExtracted.xml -dbname <dbname> -dbuser <dbuser> -dbpwd <dbpassword


Log -    WC_installdir/logs/massload.oracle.log

Note - 
  • We can use the custom table in the same extraction filter along with the WCS tables to extract the data.
  • There can be only one table need to be defined for the schemaentity and no complex joins allowed.
  • Unquie id needs to be defied for each <functionDef />

SampleFilter.xml 

 <sqlx>
<functionDef id="Product" description="Extract Product"
schemaentity="site">
       <body>
        select * from site
      </body>
 </functionDef>

    <execute id="Product" description="Extract Product"
schemaentity="site">
      </execute>

</sqlx>


SampleExtracted.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE import [
<!ELEMENT  import  (  site  )*>
<!ELEMENT    site    EMPTY>
<!ATTLIST    site
    databasevendor    CDATA    #IMPLIED
    edition    CDATA    #IMPLIED
    version    CDATA    #IMPLIED
    release    CDATA    #IMPLIED
    mod    CDATA    #IMPLIED
    fixpack    CDATA    #IMPLIED
    compname    CDATA    #IMPLIED
    optcounter    CDATA    #IMPLIED
>
]>

<import>
<site
    databasevendor="IBM"
    edition="ENT"
    version="7"
    release="0"
    mod="0"
    fixpack="7"
    compname="BASE"
    optcounter="7"
/>
</import> 


Ref -

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.data.doc/tasks/tml_extract.htm?lang=en

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.data.doc/refs/rml_extract_filter_example.htm?lang=en

No comments:

Post a Comment