You are on page 1of 3

A Crash Course in the pdm_extract

command!
Jon_Israel

20/09/2011 14:55

Hello All,
Last week I discussed the use of the pdm_extract command, specifically when it includes a
where clause with a UUID value to search for. As I promised you all in my post last week, I
wanted to give a quick crash-course in using the pdm_extract and pdm_load
functions/commands with Service Desk. There are many options or flags that can be used
with these commands, many of which I will list here and give examples of.
Lets start with the pdm_extract command. This command is used to pull or extract data
from the mdb.
Here is a breakdown diagram for the parts of the pdm_extract command:

A: the base command itself


B: Flags these are used to specify different functions/actions while doing a
pdm_extract
C: Table Name this section is where you specify the name of the table you are
extracting the data from
D: A greater-then symbol is used to tell pdm_extract to output the data to a file
E: The directory you want the pdm_extract output file to be saved in, and the
name of the file to save it as
Usage of the pdm_extract command:
You can do basic, simple extracts such as extracting the contact table (ca_contact) by using
the following:
pdm_extract ca_contact
To have the output of the extract written to a text file, simply use the > at the end of your
command and then add the directory and filename where you would like the extract file to
go:
pdm_extract ca_contact > c:\data_extracts\ca_contact_backup.txt
Any file that is generated via this type of command can later be loaded back into the mdb
by using the pdm_load commands.
Available Flags and Options for using the pdm_extract command:

Now here are some examples of using the above flags:


Doing a pdm_extract with a select statement to pull a specific record:
pdm_extract f select * from ca_contact where userid=jdoe > c:\ jdoe_contact_record.txt
This example shows that we are doing an extract with a select statement against the
contact table to return all rows where the userid of the contact is jdoe and will pipe it
out to a file in the c:\ drive called jdoe_contact_record.txt
Doing a pdm extract with the -X flag to have the command extract ALL data with the
exception of the tables listed after the flag:
pdm_extract -X Prority, Urgency, Impact, Severity >
c:\extract_all_except_pri_urg_imp_sev.txt
This example shows that we are doing an extract of ALL tables in the database used by
Service Desk with the exception of the specified tables (Priority, Urgency, Impact, and
Severity) as listed after the -x flag.
So, as you see, you can use the pdm_extract commands and functionality to extract data
from the MDB right from the Service Desk application server without having to go into SQL
or Oracle tools to do so from the database side.
I hope this has answered some questions for some folks out there!
Happy Extracting,
Jon Israel

Sr. Support Engineer


CA Technologies

You might also like