SQL Queries - CAST Central Base - Queries on applications - How to get the Number of Files by Snapshot for an Application
Purpose of Query
This document provides a query to get the Number of Files by Snapshot for an Application.
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ❓ |
| CSS | ✅ |
Query for CSS
SELECT DSSO.OBJECT_NAME AS APPLICATION ,
DSSS.SNAPSHOT_NAME AS SNAPSHOT ,
m.METRIC_NUM_VALUE AS "Number of Files"
FROM DSS_METRIC_RESULTS m
JOIN DSS_OBJECTS DSSO
ON DSSO.OBJECT_ID=m.OBJECT_ID
JOIN DSS_SNAPSHOTS DSSS
ON DSSS.SNAPSHOT_ID=M.SNAPSHOT_ID
WHERE M.SNAPSHOT_ID = <SNAPSHOT_ID> -- here 2
AND M.OBJECT_ID = <APPLICATION_ID> -- here 3
AND m.METRIC_ID = 10154
Query result example
“App1”;“V2-COBOL-1APP-2016-MR2-11082016”;1043
Query result interpretation
Snapshot “V2-COBOL-1APP-2016-MR2-11082016” of Application “App1” contains 1043 files
Query for Oracle
SELECT DSSO.OBJECT_NAME AS APPLICATION ,
DSSS.SNAPSHOT_NAME AS SNAPSHOT ,
m.METRIC_NUM_VALUE AS "Number of Files"
FROM DSS_METRIC_RESULTS m
JOIN DSS_OBJECTS DSSO
ON DSSO.OBJECT_ID=m.OBJECT_ID
JOIN DSS_SNAPSHOTS DSSS
ON DSSS.SNAPSHOT_ID=M.SNAPSHOT_ID
WHERE M.SNAPSHOT_ID = <SNAPSHOT_ID> -- here 98
AND M.OBJECT_ID = <APPLICATION_ID> -- here 468616
AND m.METRIC_ID = 10154
Query result example
APPLICATION SNAPSHOT Number of Files
App2 App2 01/12/2016 10:50:50 18
1 record(s) selected [Fetch MetaData: 0/ms] [Fetch Data: 0/ms]
[Executed: 03/02/17 09:44:22 GMT ] [Execution: 536/ms]
Query result interpretation
Snapshot “App2 01/12/2016 10:50:5” of Application “App2” contains 18 lines of code.
Notes/comments
Related Pages