Smarts NCM: the database shows more than 80 revisions for some tables; database-utility.pl prune revisions is not deleting all the requested revisions
search cancel

Smarts NCM: the database shows more than 80 revisions for some tables; database-utility.pl prune revisions is not deleting all the requested revisions

book

Article ID: 331210

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:


When running database cleanup with the following command:

> nohup ./database-utility.pl prune revisions 80 &

as follows: 


The following result is seen in the db tables after running the following check on the db (need to login to the db):

select count(device_state_id) Revision_Count, cd.device_id, (select device_idx from cm_device where device_id = cd.device_id) device_idx,(select device_name from cm_device where device_id = cd.device_id) device_name from cm_device_revisionable_state as cd where cd.comments != 'Device State Deleted'  and cd.comments != 'Device State Archived' and cd.comments != 'Device State Purged' group by device_id order by Revision_Count desc; i.e. revisions are not 80 or less as can be seen the the revision count :





Environment

VMware Smart Assurance - NCM

Cause


The script is working correctly. 

There are dependencies within the tables which prevent them from being deleted. 

Resolution

The command above:
nohup ./database-utility.pl prune revisions 80 &

has created a nohup.out log 

From the log you can see the following execution of your prune command:

Script started at Fri Aug  5 08:32:17 2016

Processing revisions for 8124 devices...
Processing 7380 device states...
Skipped 2890 device states because other device states are dependent on the revisions.

Invoking Java process to prune the revisions

***************************************
***Checking if this is a large data set.****
***************************************
Cannot determine if this is a large data set or not!
Moving on with default settings...

Java program com.voyence.migration.StoredProcedureInvoker Completed.

The script execution to perform prune revisions completed sucessfully.
Script Completed.


As you see there is the line:
"Skipped 2890 device states because other device states are dependent on the revisions"


This is why it has not reduced the revisions to 80   as there are dependencies within the tables on the tables you have requested to prune.