SQL Queries - Common SQL Queries - Corruptions - Corruptions on application - How to get the list applications and their modules that have different names across the Triplet

Purpose of Query

This query lists the applications and their modules that have different names across the triplet.

Applicable CAST Version
Release
Yes/No
8.3.x(tick) 
8.2.x(tick) 
8.1.x(tick) 
8.0.x(tick) 
Applicable RDBMS
RDBMS
Yes/No
Oracle Server(question) 
Microsoft SQL Server(question) 
CSS2(tick) 
Query for CSS
SELECT    cicl.object_name       AS kb_name, 
          cicl.service_unique_id AS kb_site_id, 
          cicc.object_name       AS cb_name, 
          cicc.service_unique_id AS cb_site_id, 
          cpa.object_id          AS appli_id, 
          cpa.object_name        AS appli_name, 
          doa.object_id          AS cb_appli_id, 
          doa.object_name        AS cb_appli_name, 
          doa.object_full_name   AS cb_appli_full_name, 
          cpm.object_id          AS module_id, 
          cpm.object_name        AS module_name, 
          k.idkey                AS kb_module_id, 
          k.keynam               AS kb_module_name, 
          dom.object_id          AS cb_module_id, 
          dom.object_name        AS cb_module_name, 
          dom.object_full_name   AS cb_module_full_name, 
          cpm.definitiontype     AS module_type, 
          cst.internal_timestamp 
FROM      <mngt_base>.cms_portf_module cpm 
JOIN      <mngt_base>.cms_dynamicfields cdfm 
ON        cdfm.object_id = cpm.object_id 
AND       cdfm.field_guid = 'entry' 
JOIN      <mngt_base>.cms_portf_application cpa 
ON        cpa.object_id = cpm.application_id 
JOIN      <mngt_base>.cms_dynamicfields cdfa 
ON        cdfa.object_id = cpa.object_id 
AND       cdfa.field_guid = 'entry' 
JOIN      <mngt_base>.cms_sync_translation cst 
ON        cst.adapterclass = 'com.castsoftware.pmc.actions.module.ModuleLocalAdapter' 
AND       cst.entryobjpmc = cdfm.field_value 
JOIN      <mngt_base>.cms_sync_translation csta 
ON        csta.adapterclass = 'com.castsoftware.pmc.actions.centralservice.PortfolioCentralAdapter'
AND       csta.entryobjpmc = cdfa.field_value 
LEFT JOIN <mngt_base>.cms_sync_translation cstm 
ON        cstm.adapterclass = 'com.castsoftware.pmc.actions.centralservice.ModulePortfolioCentralAdapter'
AND       cstm.entryobjpmc = cdfm.field_value 
AND       cstm.entryservice = csta.entryservice 
LEFT JOIN <local_base>.keys k 
ON        k.idkey = cst.idobjservice 
JOIN      <central_base>.dss_objects doa 
ON        doa.object_id = csta.idobjservice 
LEFT JOIN <central_base>.dss_objects dom 
ON        dom.object_id = cstm.idobjservice 
JOIN      <mngt_base>.cms_dynamicfields cdfl 
ON        cdfl.field_guid = 'entry' 
AND       cdfl.field_value = cst.entryservice 
JOIN      <mngt_base>.cms_inf_css_localdb cicl 
ON        cicl.object_id = cdfl.object_id 
JOIN      <mngt_base>.cms_dynamicfields cdfc 
ON        cdfc.field_guid = 'entry' 
AND       cdfc.field_value = csta.entryservice 
JOIN      <mngt_base>.cms_inf_css_centraldb cicc 
ON        cicc.object_id = cdfc.object_id 
WHERE     cst.idobjservice IN 
          ( 
                   SELECT   cst.idobjservice 
                   FROM     <mngt_base>.cms_sync_translation cst 
                   WHERE    cst.adapterclass = 'com.castsoftware.pmc.actions.module.ModuleLocalAdapter'
                   GROUP BY cst.idobjservice 
                   HAVING   count(1) > 1 );
Query result example
kb_namekb_site_idcb_namecb_site_idappli_idappli_namecb_appli_idcb_appli_name cb_appli_full_name module_id module_namekb_module_idkb_module_namecb_module_id cb_module_namecb_module_full_namemodule_type internal_timestamp
local_base441711622central_base499025798 1433 application_name_1 6 application_name_2application_name_2  1483 application_name1 426 application_name_17application_name_1application_name_1UserDefinedModuleType2017-10-05 07:39:33.541
Query result interpretation

 The query above shows that the application of name "application_name_1" have the name  "application_name_2" under the central base and those which retain the name  "application_name_1" under the KB

 

Note that as for now, there is no way to clean this corruption, this corruption was never been reproduced and can be due to a wrong manipulation.

The solution is to rebuild the analyzed application from scratch

Query for Oracle
Enter the SQL query
Query result example
 
Query result interpretation
 
Query for SQL server
Enter the SQL query
Query result example
 
Query result interpretation
 
Notes/comments
 

 

 

Related Pages