SQL Queries - CAST Central Base - Queries on Objects - How to count the number of added deleted and modified objects betweeen two snapshots
Purpose of Query
To get the count of added objects in the current snapshot the following query can be run on the central repository.
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
| 8.1.x | ✅ |
| 8.0.x | ✅ |
| 7.3.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ✅ |
| CSS2 | ✅ |
Query for CSS, SQL Server, Oracle
select count(doi1.OBJECT_ID) as "Deleted",
count(doi2.OBJECT_ID) as "Added",
count(doi1.OBJECT_ID + doi2.OBJECT_ID) as "Modified"
from (select doi1.OBJECT_ID,
doi1.OBJECT_CHECKSUM
from DSS_OBJECT_INFO doi1
where doi1.SNAPSHOT_ID = [1st snapshot ID]
) doi1
full join
(select doi2.OBJECT_ID,
doi2.OBJECT_CHECKSUM
from DSS_OBJECT_INFO doi2
where doi2.SNAPSHOT_ID = [2nd snapshot ID]
) doi2
on doi1.OBJECT_ID = doi2.OBJECT_ID
where doi1.OBJECT_ID is null
or doi2.OBJECT_ID is null
or doi1.OBJECT_CHECKUM !=
doi2.OBJECT_CHECKSUM;
Query result example
0;0;0
Query result interpretation
In this example, there are no added, deleted nor modified objects in the two snapshots. The objects are identical.
Notes/comments
Related Pages