Quantcast
Channel: THWACK: Message List - Network Configuration Manager
Viewing all articles
Browse latest Browse all 8827

Re: Purge old configs from database based on the config type

$
0
0

of course if you let me know what you what to achieve I can provide scripts.

 

I dont purge via SQL, I just flag as baseline if I want to keep them, then I run the NCM purge job.

 

--select-

select * from ConfigArchive

where ConfigType = 'Running'  -- or use 'Startup'

AND DownloadTime < GETDATE()-30 -- i.e. i.e. downloaded prior to 30 days ago

 

--update--

update ConfigArchive

set Baseline = 1

where ConfigType = 'Running'  -- or use 'Startup'

AND DownloadTime < GETDATE()-30  -- i.e. downloaded prior to 30 days ago

 

I actually now keep every startup and running config taken on the 1st of every month, then purge all other configs over 3 months old that arnt marked as baseline. Just for our audit purposes.

 

select * from ConfigArchive

where (DATEPART(day,DownloadTime)=1) --and Baseline <> 1

 

update ConfigArchive

set Baseline = 1

where (DATEPART(day,DownloadTime)=1) and Baseline <> 1

 

I dont really use the baseline feature so for me this is perfect until NCM is developed to allow for better purge and archiving rules.


Viewing all articles
Browse latest Browse all 8827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>