SQL Queries - CAST Central Base - Queries on Objects - How to get the LoC associated with an object in a specific snapshot

Purpose of Query

This page lists the SQL queries required to get the LoC associated with an object in the central base.

Applicable CAST Version

ReleaseYes/No
8.3.x
8.2.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS3
CSS2

Query for CSS

Identify the object id from the full name and the snapshot id

SELECT dos.object_id 
FROM   dss_objects dos 
JOIN   dss_object_info doi 
ON     doi.object_id = dos.object_id 
WHERE  dos.object_full_name = '<ObjectFullName>' 
AND    snapshotid =<snapshot_id>

Query result example

2757

Query result interpretation

The query returns the object id

Run the following query to get associated LoC

SELECT metric_num_value 
FROM   dss_metric_results dmr 
JOIN   dss_object_info dos 
ON     dos.object_id = dmr.object_id 
JOIN   typ 
ON     idtyp = dos.object_type_id 
WHERE  dmr.metric_id = 10151 
AND    dmr.snapshot_id = 2 
AND    dos.snapshot_id = dmr.snapshot_id 
AND    dmr.metric_value_index= 1 
AND    dos.object_id = <object_id>

Query result example

154

Query result interpretation

The query returns the LOC of the object

Query for Oracle

To be done

Query for SQL server

To be done

Notes/comments

Related Pages