Configure the data load environment settings
Configure the environment variables used by the Data Load utility in an XML file called wc-dataload-env.xml.
Procedure
- Create a file called wc-dataload-env.xml. We can create this file within any directory. Ensure that any other Data Load utility configuration file that must reference this file includes the path to your new file. Sample environment configuration files are provided for different component objects within the component-specific directories within the following directory:
- (Linux) utilities_root/samples/DataLoad
(Developer) WCDE_installdir\samples\DataLoad
- Change the values of the business context attributes inside the <_config:BusinessContext> element to match the store settings:
- storeIdentifier
- The identifying name of the store that owns the object data, for example, Aurora.
- langId
- The language ID for the language of the data, for example, -1 for English.
If we are configuring the utility to load catalog data, configure the following settings:
For example:
<_config:DataLoadEnvConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../../../xml/config/xsd/wc-dataload-env.xsd" xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config"> <_config:BusinessContext storeIdentifier="Aurora" catalogIdentifier="Aurora" languageId="-1" currency="USD"> </_config:BusinessContext>
- Required: Change the attribute values inside the <_config:Database> element to match the database environment.
<_config:Database type="db2" name="name" user="user" password="password" server="server" port="port" schema="schema" />Where:
- type
- db2 or oracle
- name
- The name of the database
- user
- The database user ID.
- password
- The database password is necessary to connect to the database. For security purposes, the password is always encrypted. If the password field is empty, we are prompted to enter the password on the command line when you run the utility.
- server
- The name of the server the database is on. The server name can be the IP address or the fully qualified DNS name of the server the database is on.
- port
- The port to connect to the database.
- schema
- The name of the database schema.
- Required: (DB2) (Oracle) Encrypt the password of the database user:
- Open the command-line interface and go to the following directory:
- (Linux) utilities_root/bin
(Developer) WCDE_installdir\bin
- Enter the following command:
- (Linux) ./wcs_encrypt.sh db_password
(Developer) wcs_encrypt.bat db_password
Where db_password is the password for the database user.
- Use the encrypted password next to ASCII encrypted string as the value for the password attribute inside the <_config:Database> element.
- Find the <_config:IDResolver> element.
- Optional: Modify the cache size inside the tag. The cache size that you specify here does not apply to a specific database table, but is instead divided between all database tables that are participating in a data load.
- cacheSize
- This attribute sets the cache memory allocation for the ID resolver. The ID resolver performs faster when unique ID data in retrieved from cache memory instead of from the database.
Note: If you do not specify a <_config:IDResolver> element, the default cache size value is 0 bytes.
- Optional: Identify any database tables that are to be excluded from having IDs from those tables included within the IDresolver cache. When a table is excluded from this cache, the Data Load utility resolves the ID for business objects information directly against the database table.
Note: For Non-ATP inventory model.
If you plan to perform multiple inventory updates that include a delete and a reinsert for the same catalog entry, then you need to exclude the INVENTORY database table. Otherwise the catalog entry is not reinserted after a delete due to a IDresolver cache limitation. To exclude a table from the ID resolver cache, use the <_config:ExcludeCache> element within the <_config:IDResolver> element. Specify the table with the tableName attribute. Specify each table that is to be excluded in a separate <_config:ExcludeCache> element. For example,
<_config:IDResolver className="com.ibm.commerce.foundation.dataload.idresolve. IDResolverImpl" cacheSize="2000" > <_config:ExcludeCache tableName="BASEITEM" /> <_config:ExcludeCache tableName="CATENTRY" /> <_config:ExcludeCache tableName="INVENTORY" /> </_config:IDResolver>
- Optional: Set the data writer class. Find the <_config:DataWriter> element. Add the class name of the data writer inside the tag.
Option Description (DB2) (Oracle)
native load data writerWrites WebSphere Commerce physical objects to database loadable files. The files are specific to the selected database management system. These files must be written to the database with the native database loading utilities in a separate operation.
- (DB2) The native data writer supports both insert mode and replace mode. In insert mode, it uses the DB2 load utility to load the native loadable files. In replace mode, it uses the DB2 import utility to load the native loadable file.
- (Oracle) The native data writer supports only the insert mode. In insert mode, it uses the Oracle sqlldr utility to load these native loadable files.
Insert mode should not be used in the staging environment because the native database utilities bypass the triggers. For DB2 replace mode, it uses the DB2 import utility that can be used in the staging environment.
Use the native load data writer for faster performance than JDBC batch jobs, such as when a large amount of data is being loaded during initial loads.
<_config:DataWriter className="com.ibm. commerce.foundation.dataload.datawriter.NativeDBDataWriter" />
(DB2) (Oracle) JDBC data writer
Writes physical objects directly to a database in a JDBC batch job. The JDBC data writer has the following advantages over the native load data writer:
- The JDBC data writer supports insert, delete, and replace modes. The native load data writer supports only the insert mode.
- The native load data writer bypasses database triggers, requiring data to be loaded separately to both production and staging environments. The JDBC data writer does not bypass database triggers.
- The JDBC data writer provides more error reporting than the native load data writer.
Use the JDBC data writer for greater flexibility, such as when you replace and delete data during the same load.
<_config:DataWriter className="com.ibm. commerce.foundation.dataload.datawriter.JDBCDataWriter" />
Note: If you do not specify a <_config:DataWriter> element, the JDBC data writer is used by default.
- Save and close the configuration file.
Previous topic: Configure the XML data reader
Next topic: Configure the business object configuration file