Database Loader

This article contains the following topic:
This article contains the following topic:
The database loader utility, pdm_userload, adds, updates, and deletes CA SDM database records. You create a formatted ASCII input file for the pdm_userload utility and select the tables to load and the optional fields to add.
The pdm_userload utility accesses the CA SDM database and does not directly interact with application software processes. The inventory items added to the database with pdm_userload do not update the helper/selection lists until the application has been halted and restarted.
Although the pdm_userload utility can run with the application active, system performance is degraded. For best results, ensure that the background server is running but that no users are using the client interface before you run pdm_userload.
To add records with cross-referenced fields, use the pdm_deref utility pdm_deref--Dereference ASCII Data.
pdm_userload--Add, Update, and Delete Database Records
The pdm_userload utility updates a CA SDM database using an input file you specify.
You should always backup your database before you perform a pdm_userload.
Whenever you upload tickets (such as issues or requests), your ticket number should include a unique prefix or suffix in its string. CA SDM views this number as a string of characters not as a sequential number, and does not guarantee that it assigns a unique number to the uploaded tickets. As long as you assign a unique prefix or suffix using awk or another text processor, however, you can upload tickets without CA SDM writing over previously assigned numbers.
This command has the following format:
pdm_userload [-a] [-c] [-h] [-r] [-v] [-u] [-m]  - f filename
Input File Format
The input file entries follow this format:
TABLE table_name fieldname1fieldname2 . . . . fieldnameN { "value11", "value12", . . . "value1N" } { "value21", "value22", . . . "value2N" } . . . { "valueN1", "valueN2", . . . "valueNN" }
is the name of the table to be loaded, as listed in the CA SDM database schema file, which is located in $NX_ROOT/site/sch/schema.sch (UNIX) or
\site\sch\schema.sch (Windows), where $NX_ROOT or
is the directory where you installed CA SDM.
-f filename
Specifies an input ASCII file.
Updates all existing records, regardless of whether more than one existing record matches a single input record. Without this option, input records that match more than one existing record are rejected.
Use this option carefully.
Checks the input file against the database and reports on the updates that would be made, but does not make the updates.
Removes database records that match input records. The -a option can be used with the -r option.
Make a backup copy of the database before running pdm_userload with this option. old database records are removed, you must restore the CA SDM database with this backup copy if you wish to recover any deleted records.
Specifies verbose mode.
Updates existing records, but does not insert new records into the database.
Mass update. Specify when you are using pdm_userload to add or delete a large number of records. This option suppresses all client notifications of updates and sends a cache refresh message for a table when pdm_userload finishes processing the table.
Uses locale sensitive numeric input formats.
Specifies the name or UUID of tenant to associate all loaded data with the specified tenant. This argument is valid only when multi-tenancy is installed.
Pdm_userload supports new arguments on the TABLE statement, "Truncate" and "NoNewID". These arguments are specified in an optional parenthesized option after the table name. For example:
  • Truncate
    Causes pdm_userload to issue a database-specific TRUNCATE command for the table prior to loading any data. In addition, it forces pdm_userload logic to use insert-only logic regardless of command-line arguments, as all records are new.
  • NoNewID
    Causes pdm_userload to use the id value from its input control file for new rows in the table, rather than generating a new ID for inserted data.
You can run pdm_userload while CA SDM is active, but performance can become very slow. It is best to run pdm_userload when no one is using CA SDM.