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 using an extraction-filter XML document. The function of the massextract utility is opposite that of the massload utility. Use the massextract utility to extract selective subsets of data from the WebSphere Commerce database in the form of XML files. You can extract data on products related to an upcoming holiday, for example, or you can extract information from a consolidated database for use with other systems.
Before running this utility, ensure that you have complete the required configuration tasks:
- Configure the environment variable setting scripts.
- Configure the massextract utility.
- Configure tracing and logging for the loading utilities.
- Create an extraction filter.
If you have added generated columns to the schema, review the following information:
- If you use the massextract utility to extract data and then use massload to load the data back, ensure the extracted data file does not contain generated column data. Manually remove generated column data from the data file before running massload. Failing to remove generated column data results in exception errors.
Filenames 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:
- WC_INSTALL/logs/massextract.db2.log
- WC_INSTALL/logs/massextract.oracle.log
- No additional log files are produced.
Run this utility as the non-root WebSphere Commerce user ID. Do not run this command as root.
Utility command
The massextract utility has the following file name:
- massextract.sh
- massextract.cmd
- massextract.bat
Parameter values
- -filter
- Name of the extraction-filter file
- -outfile
- Name for the output XML file where the extracted data will be stored
- -dbname
- Do not specify this parameter.
- Name of the database from which data is being extracted.
- The TNS name of the database from which you are extracting data.
- The database name as displayed in the relational database directory (WRKRDBDIRE).
If the database is on a remote IASP and the database name is different than 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"
- For DB2 UDB databases, the Type 2 database name is deprecated, where the database names do not contain a prefix.
That is, the DB2 Type 4 JDBC driver is used instead, where the Type 4 database name is prefixed with the database server and port. For example, db_server:db_port/db_name.
See How JDBC applications connect to a data source in the DB2 Information Center for more information.
- -dbuser
- Do not specify this parameter.
- Database user name for the database from which data is being extracted.
- This is usually the same as the instance user name.
- -dbpwd
- Do not specify this parameter.
- Password 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 the WebSphere Commerce database. When specifying the customizer property file with this parameter, omit the ".properties" file extension.
Specify one of the following customizer values:
- Do not specify this parameter when extracting data from the development database.
- (Not required) Do not specify this parameter if you are using DB2 Universal Database on AIX, Linux, Solaris, or Windows operating systems.
- Required: Specify one of the following customizer files:
- ISeries_EXTWCSDTA_Customizer
- Specify this customizer value if you are using the native i5/OS JDBC driver.
When you specify this value, the massextract utility uses the values specified in the following file:
WC_INSTALL/properties/ISeries_EXTWCSDTA_Customizer.properties
If you are using a remote database, 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 specified in the following file:
WC_INSTALL/properties/Toolbox_EXTWCSDTA_Customizer.properties
If you specify this customizer value, 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 is located in the WC_INSTALL/properties directory.
- Required: DB2390ConnectionCustomizer
When you specify this value, the massextract utility uses the values specified in the following file:
WC_INSTALL/properties/DB2390ConnectionCustomizer.properties
- Required: OracleConnectionCustomizer
When you specify this value, the massextract utility uses the values specified in the following file:
WC_INSTALL/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 running 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 neither a command-line nor a property-file specification for this parameter exists, the utility defaults to the schema name of the table in the database.
Example
The following example extracts Member subsystem data from a database using MemberSubsystemFilter.xml as an extraction filter.
- ./massextract.sh -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer MemberSubsystemCustomizer
- massextract.cmd -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer MemberSubsystemCustomizer
Related concepts
Overview of the mass load utilities
Transforming, loading, and extracting data using the WebSphere Commerce loading utilities
Related tasks
Configure the environment variable setting scripts
Related reference
massload utility (Server environment)