The procedure for copying a database includes three basic steps:

The base class for the ATG database copying facility is atg.adapter.gsa.DBCopier. It is important to note that DBCopiers use vendor-specific bulk copy and SQL utilities for speed, rather than using JDBC. This is accomplished by executing these commands in separate processes.

If the native bulk copy program operates on one table at a time, the DBCopier imports table data in the order in which the tables are specified and deletes table data in the reverse order. Thus, if there are foreign key constraints among the tables, the copy operation can still work if the tables are specified in dependency order. The various subclasses of DBCopier implement copying for different database vendors, using different vendor tools.

To use a DBCopier, follow these steps:

  1. Create a DBCopier component. See Creating a DBCopier Component.

  2. Configure DBConnectionInfo components for your source and destination databases. See Configuring the DBConnectionInfo.

  3. Configure the DBCopier component as described in Configuring the DBCopier.

  4. Set the SQL environment variables as described in Setting the Native SQL Environment.

  5. Run the DBCopier by invoking its copy() method. For an example, see Transferring Product Catalog and Price List Data Using Copy and Switch section of the Configuring and Populating a Production Database chapter in the ATG Commerce Programming Guide.

loading table of contents...