When CA Service Desk Manager (CA SDM) 12.7 is integrated with CA Service Catalog 12.8, the pdm_tenant_delete command fails due to constraints on Service Catalog Tables

Document ID : KB000048347
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Part of the documented process for running pdm_tenant_delete is to drop the constraints using this file on the Service Desk Server:

"C:\Program Files (x86)\CA\Service Desk Manager\samples\views\SQLServer\SQLDropConstraints.sql"

This SQL script does not include a couple of constraints on the Service Catalog tables.

Solution:

  1. Add the following content to the SQLDropConstraints.sql script prior to running it in SQL:

       ------------------- Drop Service Catalog Constraints ----------------   ALTER TABLE ca_asset DROP CONSTRAINT FKca_asset_tnt   GO    ALTER TABLE usm_tenant_ext DROP CONSTRAINT XFKusm_tenant_ext4   GO   -------------------------------------------------------------------------------

  2. Add the following content to the SQLAddConstraints.sql script:

       -------- Add Service Catalog Constraints Back --------------------   ALTER TABLE [dbo].[ca_asset]     ADD CONSTRAINT [FKca_asset_tnt]       FOREIGN KEY ( [tenant] )                REFERENCES [ca_tenant] ( [id] );   GO   -------------------------------------------------------------------------------   ALTER TABLE [dbo].[usm_tenant_ext]     ADD CONSTRAINT [XFKusm_tenant_ext4]       FOREIGN KEY ( [ca_tenant_uuid] )       REFERENCES ca_tenant ( [id] );   GO

  3. In SQL run the Drop Constraints Script: SQLDropConstraints.sql

  4. Run the pdm_tenant_delete as documented, for example:

       C:\PROGRA~2\CA\SERVIC~1\log>pdm_tenant_delete -t TenantB

    Are you sure you want to delete data for tenant 'TenantB'? (yes/no) yes

    Are the constraints dropped ? (yes/no) yes

  5. Run the Add Constraints script in SQL: SQLAddConstraints.sql