SAND CDBMS Tools Reference Guide
Data Loader (ndlm)

 

Previous Topic:
Exporting Data with ndlm
Chapter Index
Next Topic:
Transferring Data via Named Pipes

 

Exporting Data to an SCT File


Data can be exported from a database directly to SCT Files. If the SCTEXPORT keyword appears at the beginning of the specification script, ndlm is instructed to copy data from the database, compress it, and load it into the specified SCT File.


Creating an SCTEXPORT Specification Script

The format for the SCTEXPORT specification script is as follows:

SCTEXPORT @SCT-path
{
TABLE:[schema-name.]Table-name
SELECT-statement;
}

SCTEXPORT
Instructs ndlm to perform an SCT export operation. Make sure a space character separates the SCTEXPORT keyword and the @ symbol.

@SCT-path
Specifies the SCT File that will be created during the export operation. The path and file name cannot exceed 260 characters, and must be prefixed by the "at" symbol ( @ ). Note that if the path contains any spaces, it must be enclosed in double quotation marks: "<path with spaces>". If a path is not supplied, the specified SCT File will be created in the current directory.

The resulting SCT File can contain at most 2,147,483,648 (231) rows. If the export operation attempts to load more than this amount into the file, it will fail. Therefore, when a very large amount of data is to be archived, multiple export operations should be devised to partition the total data set and create multiple SCT Files.

TABLE:[schema-name.]Table-name
The TABLE parameter specifies the name of the table that will be stored in the SCT File, optionally preceded by the name of the schema.

SELECT-statement;
The SELECT statement is used to filter or manipulate the data that is being exported from the database. It must be terminated with a semicolon.

Note that if more than one SELECT statement is included (each terminating with a semicolon), only the first will be processed, and no error or warning message will be issued.


Executing the SCT Export Operation

To create an SCT File from an existing database:

  1. Start an instance of the database from which data will be exported.
  2. Create a load specification file that describes an SCTEXPORT operation. For example:

SCTEXPORT @C:\Public\sct\x1.sct
{
TABLE:s1.x1tab
SELECT col1, col2, col3 FROM s1.x1tab WHERE col1 > 0;
}

  1. Execute the load operation with ndlm. Use the following invocation syntax:

ndlm connection-name instance-name user-name[/user-password] spec-file-name


When the load operation concludes, the resulting SCT File will be in the location specified in the specification file.

 

Previous Topic:
Exporting Data with ndlm
Chapter Index
Next Topic:
Transferring Data via Named Pipes