CA Service Management

  • 1.  pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Sep 20, 2011 10:48 AM
    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





    ****Below are the immages that are attached to this post***


  • 2.  RE: pdm_extract what????  A Crash Course in the pdm_extract command!

     
    Posted Sep 20, 2011 11:59 AM
    Thanks for the great tip Jon! Check it out folks!

    Chris


  • 3.  RE: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Sep 20, 2011 04:13 PM
    Great stuff Jon! Thank you!


  • 4.  RE: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Oct 05, 2011 09:18 PM
    thanks very much Jon
    a useful tip there
    regards
    Donna
    (now enjoying spring!)


  • 5.  RE: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Jan 22, 2012 10:23 PM
    Further information on pdm_extract.


    1. https://support.ca.com has 78 Knowledge Documents on pdm_extract. For example:

    Document ID: TEC428520
    Title: How to extract data by date range using pdm_extract
    https://comm.support.ca.com/?legacyid=TEC428520


    Document ID: TEC471268
    Title: What does pdm_backup do? What is the difference between pdm_backup and pdm_extract?
    https://comm.support.ca.com/?legacyid=TEC471268


    Document ID: TEC481497
    Title: Extracting Contact Data for Service Desk r11 and above with pdm_extract
    https://comm.support.ca.com/?legacyid=TEC481497

    2. The Service Desk Manager product documentation, in particular the PDF files, contain syntax and usage.
    The Administrator Guide has the main reference. See p927 for "pdm_extract--Extract Data from Database" for all supported switches and examples. (The -X switch to exclude tables is not listed.)

    TIP Use Cntrl + F in Adobe Acrobat and point to the Service Desk documentation folder to find all instances of a keyword.

    3. Additional documentation exists at support.ca.com with examples outside of Knowledge Documents or the product PDF, such as the "CA Service Desk Manager Green Book" and the "CA Unicenter Service Desk Integrations" guide, which may be useful for some scenarios.


  • 6.  Re: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Aug 22, 2017 09:33 AM

    Hi Jon_Israel,

     

    Thanks for this insightful post.

     

    I was wondering if you could advise me on whether my pdm_extract statement below is correct.

     

    I'm trying to get all incidents that are assigned to my Service Desk group where the configuration item's class is "Discovered Hardware" (ca_resource_class.id = 2). Please advise if I'm on the wrong or right bus because I'm getting the error of

     

    Error in fetch. Error = 1
    Error in fetch. Error = 1
    Call_Req
       rows:0

    Everything works until I get to the affected_rc.class.id

    pdm_extract -f "select id,ref_num,group_id from Call_Req where group_id = U'A68E49BE56123B47BF8272AB1ED9FBC4' and active_flag = 1 and type = 'I' and affected_rc.class.id = 2" > test_extract.txt

    Do I need to do a join?

     

    Kind regards,

    Mo



  • 7.  Re: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Aug 22, 2017 09:51 AM

    Hi Mo,

    You would have to do several joins because again, when you use the -f and a where clause, its going against SQL and not the object layer (where joins are automatically existing).  I am not super well versed in doing joins, but yes, since this is SQL, you would need to join several tables including call_req, ca_owned_resource (for the CI), and the table holding the classes.  Since the class is not tied directly to the request object but is actually two tables away from that so to speak... meaning the request object is related to the group and the CI by the UUID, however the class of that CI is not stored in the request object directly so you would need to join the tables to gather that data.  The query would be pretty complex. 

    For something like what you are looking for, customers would typically use reporting to pull that info rather than a pdm_extract.

    Hope this helps a bit.

    Thanks,

    Jon I.



  • 8.  Re: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Aug 22, 2017 11:17 AM

    There you go :

     

    select
    CR.id,
    CR.ref_num
    from call_req CR
    inner join ca_contact GRP
    on GRP.contact_uuid=CR.group_id
    inner join ca_owned_resource NR
    on NR.own_resource_uuid=CR.affected_rc
    inner join ca_resource_class GRC
    on GRC.id=NR.resource_class

    where
    GRC.name = 'Name of your class here'
    AND
    GRP.last_name = 'Name of your group here'



  • 9.  Re: pdm_extract what????  A Crash Course in the pdm_extract command!

    Posted Aug 23, 2017 03:31 AM