CA Service Management

 View Only

CA SDM how to delete location? 

Oct 29, 2015 09:34 AM

The first thing what you need know: VERY Important! Using pdm_load can be destructive so always back up your database before you perform apdm_load, and use pdm_userload unless instructed to use pdm_load.

 

Important! Make a backup copy of the database before running pdm_load with this option. After old database records are removed, you must restore the CA SDM database with this backup copy if you want to recover any deleted records, use pdm_extract for this procedure.


1. BACKUP

BACKUP COMMAND - pdm_extract
pdm_extract ca_location > ca_location.txt

 

2. Structure table

bop_sinfo -dq loc

 

 

 

Factory loc < ca_location, usp_location >

Attributes:

   id <location_uuid>   UUID UNIQUE

   producer_id          LOCAL STRING(20)

   persistent_id        LOCAL STRING(60)

   last_mod_by last_update_user STRING(64)

   last_mod_dt last_update_date DATE

   version_number       INTEGER

   creation_user        STRING(64)

   creation_date        DATE

   exclude_registration INTEGER

   delete_time          DATE

   name location_name   STRING(100) REQUIRED

   delete_flag inactive SREL -> actbool.enum REQUIRED

   description comment<comments> STRING(255)

   site site_id         SREL -> site.id

   address1 address_1   STRING(50)

   address2 address_2   STRING(50)

   address3 address_3   STRING(50)

   address4 address_4   STRING(50)

   address5 address_5   STRING(50)

   address6 address_6   STRING(50)

   mail_address_1       STRING(50)

   mail_address_2       STRING(50)

   mail_address_3       STRING(50)

   mail_address_4       STRING(50)

   mail_address_5       STRING(50)

   mail_address_6       STRING(50)

   pri_phone_number     STRING(40)

   fax_number           STRING(40)

   city                 STRING(50)

   state                SREL -> state.id

   primary_contact primary_contact_uuid SREL -> cnt.id SERVICE_PROVIDER_ELIGIBLE

 

 

   zip                  STRING(20)

   country              SREL -> country.id

   county               STRING(50)

   contact_address_flag INTEGER

   parent_location_uuid UUID

   location_type_id     INTEGER

   service_groups       BREL <- lrel_svc_locs_svc_groups.loc (LREL cnt) {loc = ?

}

   service_chgcat       BREL <- lrel_svc_locs_svc_chgcat.loc (LREL chgcat) {loc

= ?}

   service_pcat         BREL <- lrel_svc_locs_svc_pcat.loc (LREL pcat) {loc = ?}

 

 

   service_isscat       BREL <- lrel_svc_locs_svc_isscat.loc (LREL isscat) {loc

= ?}

   audit_userid         LOCAL SREL -> cnt.id TENANCY_UNRESTRICTED

   tenant               SREL -> tenant.id

   timezone             SREL -> tz.code

   linked_id_usp_location id<location_uuid> UUID UNIQUE

 

 

 

 

 

 

 

 

3. Standard for Load file

Structure load: pdm_extract ca_location

TABLE ca_location

  address_1 address_2 address_3 address_4 address_5 address_6 city comment   contact_address_flag country county creation_date creation_user delete_time

  exclude_registration fax_number geo_coord_type geo_coords id inactive last_update_date   last_update_user location_name location_type_id mail_address_1 mail_address_2   mail_address_3 mail_address_4 mail_address_5 mail_address_6 parent_location_uuid   pri_phone_number primary_contact_uuid site_id state tenant version_number   zip

  { "" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"10/29/2015 10:07:20",   "servicedesk" ,"" ,"" ,"" ,"" ,"" ,"96108EB985E9194D88D4F84A8E6078EE" ,"0",   "10/29/2015 10:07:29" ,"servicedesk" ,"delete" ,"" ,"" ,"" ,"" ,"" ,"" ,"",   "" ,"" ,"" ,"" ,"" ,"C6F2D388395F734EBC4C6AEEBCBF68E4" ,"1" ,"" }

 

You need looking for related objects, therefore follow some tables where possibility exists some link for the register where you need to delete.

 

SQL Commands - ca_location

select * from ca_location

select * from ca_company where location_uuid =?

select * from ca_contact where location_uuid =?

select * from ca_link_company_location where location_uuid =?

select * from ca_location where location_uuid =?

select * from ca_organization where location_uuid =?

select * from ca_owned_resource where location_uuid =?

select * from usp_location where location_uuid =?

select * from View_Contact_Full where location_uuid =?

select * from View_Contact_to_Environment where location_uuid =?

select * from View_Group where location_uuid =?

select * from View_Group_to_Contact where location_uuid =?

 

 

4. Delete procedure

.Description

pdm_extract -f "select * from ca_location where location_name='location for deleting'" > delete_location.txt

1. Create file to delete, how to do?

using pdm_extract command, it's necessary looking for exactly what you need delete.


It's simple and dangerous like commented on begins.


On example it's looking for location name running a pdm_extract searching by "location for deleting" - it was a name for location.

 



2. pdm_load -r  -f delete_location.txt

 

 

CA SDM Loading groups pdm_load

CA SDM Loading contacts pdm_load

DEREF - pdm_deref - Everthing do you need know

CA SDM Load department using pdm_load - dept - ca_resource_department

CA Service Desk Manager Load Category using pdm_load - pcat - Prob_Category - User view Prob_Ctg Category.xlsx

CA SDM Loading group members pdm_load

Statistics
0 Favorited
4 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Oct 29, 2015 01:06 PM

Very nice.

Related Entries and Links

No Related Resource entered.