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.
- 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:
- WC_installdir/logs/massextract.db2.log
- WC_instance_root/logs/massextract.db2.log
- WC_installdir/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 utility is to store the extracted data
-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). 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:
For example,-dbname "hostname/schemaName;database name=db_Name;cursor hold=false"
-dbname "TORASCAT.yourcompany.com/demo;database name=CATDB;cursor hold=false"
Note: 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
-
- Do not specify this parameter.
- Database user name for the database from which data is being extracted.
- This parameter value is usually the same as the instance user name.
-dbpwd
-
- 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:
- Do not specify this parameter when you extract 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 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 useToolbox_EXTWCSDTA_Customizer
instead ofISeries_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.
- If 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
- Required:
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.Note: 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.
- ./massextract.sh -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer OracleConnectionCustomizer
- massextract.cmd -filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml -dbname mall -dbuser myname -dbpwd mypassword -customizer OracleConnectionCustomizer