You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

RTC 6.0.4:变更集是否可能不关联任何组件?

Understanding Unassociated Change Sets in RTC 6.0.4 (Database Perspective)

Great question! Let’s break down how to identify change sets that aren’t linked to any component directly in the RTC database, building on what you’ve already discovered with the Plain Java API and REST endpoint.

Key RTC Database Tables to Know

First, let’s map the core tables related to change sets and components:

  • CM.AUDITABLE: Stores all auditable items in RTC, including change sets. Each change set is an entry here with a specific item type.
  • CM.ITEM_TYPE: Acts as a lookup table to filter auditable items by type. We’ll use this to target only change sets (type com.ibm.team.scm.ChangeSet).
  • CM.COMPONENT_CHANGESET: The junction table that links change sets to their associated components. If a change set has no entry here, it’s not tied to any component.

SQL Query to Find Unassociated Change Sets

Below is a database-agnostic query (adjust syntax slightly for DB2, Oracle, or SQL Server as needed) to retrieve change sets with no component associations:

-- Retrieve change sets not linked to any component
SELECT 
    a.AUDITABLE_ID AS change_set_db_id,
    a.UUID AS change_set_uuid,
    a.NAME AS change_set_name,
    a.DESCRIPTION AS change_set_description
FROM CM.AUDITABLE a
INNER JOIN CM.ITEM_TYPE it 
    ON a.ITEM_TYPE_ID = it.ITEM_TYPE_ID
WHERE 
    it.NAME = 'com.ibm.team.scm.ChangeSet'
    AND NOT EXISTS (
        SELECT 1 
        FROM CM.COMPONENT_CHANGESET cc
        WHERE cc.CHANGESET_ID = a.AUDITABLE_ID
    );

What This Query Does

  • Filters for only change set entries using CM.ITEM_TYPE to avoid other auditable items like work items or comments.
  • Uses NOT EXISTS to exclude any change sets that have a matching entry in the component-change set junction table.
  • Returns key details like the internal database ID, external UUID, name, and description of unassociated change sets.

Context on Unassociated Change Sets

In most cases, change sets should be linked to a component, but there are edge cases where unassociated ones might exist:

  • Early system-generated change sets from initial RTC setup.
  • Change sets created before a component was properly configured (rare, but possible in older versions like 6.0.4).
  • Orphaned change sets from deleted components (though RTC usually cleans these up, it’s not guaranteed in all scenarios).

Your observation about the REST endpoint (/ccm/rpt/repository/scm?fields=scm/changeSet/*) returning all change sets aligns with this—this endpoint pulls from the same underlying CM.AUDITABLE table, including unassociated entries.

内容的提问来源于stack exchange,提问作者shiva

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:51:46