Is there a way to purge old configs specifying the config type - eg startup or running, etc.?
Thanks
Hi mezdem, I got Solarwinds tech update an my case and SQL queries to purge configs from database based on the config type. I thought you might find this helpful for your task.
Here is the email from the tech
_______________________________
We have the queries which should help you. You need to run all four of them, it is possible to do it one by one.ATTENTION!Before deploying them please make sure you have up to date FULL BACKUP of your database.Instructions:These queries are examples for Cisco EW-4506E devices, you need to modify the expression between apostrophes after "NodeCaption like " according to pattern which you can use to specify which devices' startup configs need to be deleted. NodeCaption in database means Name of the node in web console. If you want to use other criteria like IP address instead of Name, please let us know and we will modify the queries for you.Also don't hesitate to contact us in case you are not sure or you just want our assistance. We can arrange remote session and do this together.You can check that your device definition expression is correct by running following query:SELECT TOP 1000 ca.ConfigID, ca.NodeID, ca.ConfigTitle, ca.DownloadTime, ca.ConfigType, nod.NodeCaption, nod.AgentIP FROM [dbo].[ConfigArchive] ca JOIN [dbo].[Nodes] nod ON ca.NodeID = nod.NodeID WHERE ca.NodeID <> '' AND ca.NodeID = nod.NodeID AND ca.ConfigType = 'Startup' AND nod.NodeCaption like '%4506%'SQL queries for deleting startup configs:1. delete from LatestComparisonResults where ConfigType = 'Startup' and NodeID in (select NodeID from Nodes where NodeCaption like '% 4506%')2. delete from ConfigArchive where ConfigType='Startup' and NodeID in (select NodeID from Nodes where NodeCaption like '% 4506%')3. delete from ComparisonCache where CacheID in (select CacheID from CacheDiffResults where ConfigType='Startup' and NodeID in (select NodeID from Nodes where NodeCaption like '% 4506%'))4. delete from CacheDiffResults where ConfigType='Startup' and NodeID in (select NodeID from Nodes where NodeCaption like '% 4506%')
Please let me know if this helps or if you require further assistance. ________________________________________
there are various scheduled jobs in the NCM GUI you can safely run.
There should be one called 'default purge configs job', You can alter the job and tweak it to purge only the configs you want.
#
I have requested the functionality to split running and startup and a few other bits into this job - i believe this request is currently under consideration.
To get around this isssue I mark all configs i wish to keep temporaily as 'baseline' using a simple SQL script - then the purge jobs delete all the configs i have not marked etc
Thanks for the reply. This only allows to purge based on the time frame the configuration was backed up and gives an option to either purge or not purge the baseline config.
But if you want to keep startup configs and purge only running configs that are xx days old ... you don't have an option to do so.
I have opened a case with Solarwinds tech and waiting to see how that can be achived via SQL scripts.
yes that is what i mentioned above - we must all have duplicate cases open
I have created the sql scripts myself.
Could you share the sql script you created? thanks!