massextract utility

The massextract utility uses a query against a database to extract selected subsets of data from the database into an XML document. The data to be extracted from the database is specified in an extraction-filter XML document. The function of the massextract utility is opposite that of the mass load utility. Use the massextract utility to extract selective subsets of data from the WebSphere Commerce database in the form of XML files. For example, you can extract data on products that are related to an upcoming holiday. You can also extract information from a consolidated database for use with other systems.

Note: If your schema contains generated columns, review the following information:
  • If you use the massextract utility to extract data and then use massload to load the data back, ensure that the extracted data file does not contain generated column data. Manually remove generated column data from the data file before you run mass load. Failing to remove generated column data results in exception errors.

File names that are specified as parameters for this utility can be preceded by relative or absolute paths. Relative paths must be relative to the directory from which you run the massextract utility.

In addition to the trace log and message log for the loading utilities, this utility produces the following log file:

  • SolarisDB2LinuxAIXWindows WC_installdir/logs/massextract.db2.log
  • For IBM i OS operating systemDB2Feature Pack 5 or laterWC_instance_root/logs/massextract.db2.log
  • Oracle WC_installdir/logs/massextract.oracle.log
  • WebSphere Commerce Developer No additional log files are produced.

SolarisLinuxAIX Run this utility as the non-root WebSphere Commerce user ID. Do not run this command as root.

massextract utility syntax diagram. See the list that is called Parameter values for the applicable parameters.

Utility command

The massextract utility has the following file name:

  • For IBM i OS operating systemSolarisLinuxAIXmassextract.sh
  • Windows massextract.cmd
  • WebSphere Commerce Developer massextract.bat

Parameter values

-filter
Name of the extraction-filter file
-outfile
Name for the output XML file where the utility is to store the extracted data
-dbname
  • Apache DerbyWebSphere Commerce Developer Do not specify this parameter.
  • SolarisLinuxAIX Name of the database from which data is being extracted.
  • Oracle The TNS name of the database from which you are extracting data.
  • For IBM i OS operating systemThe database name as displayed in the relational database directory (WRKRDBDIRE).
    Note: If your database is on a remote IASP and the database name is different from the hostname, the value of dbname that is passed to a utility is:
    -dbname "hostname/schemaName;database name=db_Name;cursor hold=false"
    
    For example,
    -dbname "TORASCAT.yourcompany.com/demo;database name=CATDB;cursor hold=false"
DB2Note: For DB2 UDB databases, the DB2 Type 4 JDBC driver is used, where the Type 4 database name is prefixed with the database server and port. For example, db_server:db_port/db_name.
-dbuser
  • Apache DerbyWebSphere Commerce Developer Do not specify this parameter.
  • SolarisLinuxAIXWindows Database user name for the database from which data is being extracted.
  • For IBM i OS operating system This parameter value is usually the same as the instance user name.
-dbpwd
  • Apache DerbyWebSphere Commerce Developer Do not specify this parameter.
  • Password that is associated with the user name for the database from which data is being extracted
-customizer
Name of the customizer property file to be used for your WebSphere Commerce database. When you specify the customizer property file with this parameter, omit the ".properties" file extension.

Specify one of the following customizer values:

  • WebSphere Commerce Developer Do not specify this parameter when you extract data from the development database.
  • SolarisLinuxAIXWindows (Not required) Do not specify this parameter if you are using DB2 Universal Database on AIX, Linux, Solaris, or Windows operating systems.
  • For IBM i OS operating system Required: Specify one of the following customizer files:
    ISeries_EXTWCSDTA_Customizer
    Specify this customizer value if you are using the native JDBC driver.

    When you specify this value, the massextract utility uses the values specified in the following file:

    WC_installdir/properties/ISeries_EXTWCSDTA_Customizer.properties

    Note:
    If you are using a remote database, you must use Toolbox_EXTWCSDTA_Customizer instead of ISeries_EXTWCSDTA_Customizer.
    Toolbox_EXTWCSDTA_Customizer
    Specify this customizer value if you are using the IBM Toolbox for Java JDBC driver.

    When you specify this value, the massextract utility uses the values that are specified in the following file:

    WC_installdir/properties/Toolbox_EXTWCSDTA_Customizer.properties

    If you specify this customizer value, you must specify the hostname as the -dbname parameter. The following is an example of invoking the massextract utility:

    
    ./massextract.sh -dbname MY.HOSTNAME.COM -dbuser instance -dbpwd
    mypass -filter
    /path/filter.xml -outfile /path/file.xml -customizer
    Toolbox_EXTWCSDTA_Customizer
    

    This customizer properties file location is in the WC_installdir/properties directory.

  • DB2If you are using the DB2-390 database this customizer parameter is required: DB2390ConnectionCustomizer

    Specify this customizer only if you are using DB2-390. When you specify this value, the massextract utility uses the values that are specified in the following file:

    WC_installdir/properties/DB2390ConnectionCustomizer.properties

  • OracleRequired: OracleConnectionCustomizer

    Specify this customizer if you are using Oracle. When you specify this value, the massextract utility uses the values that are specified in the following file:

    WC_installdir/properties/OracleConnectionCustomizer.properties.

-schemaname
Name of the database schema from which data is being extracted. This parameter is optional. If this parameter is not specified when you run the utility, the utility looks for a name=value pair in the customizer property file that specifies the value of SchemaName. If this pair is present in the property file, the utility uses the value specified. If no command-line or property-file specification for this parameter exists, the utility defaults to the schema name of the table in the database.
OracleNote: If you are using a Type 4 driver with an Oracle database, use SchemaName. If you do not specify this parameter in the command arguments, you can encounter errors.

Example

The following example extracts Member subsystem data from a database with MemberSubsystemFilter.xml as an extraction filter.

  • For IBM i OS operating systemSolarisLinuxAIX ./massextract.sh -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer OracleConnectionCustomizer
  • Windows massextract.cmd -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer OracleConnectionCustomizer