Non-official script! Provided on 'as-is' basis.
It is recommended to have vRangerPro DB backup before running the script!
Here you can find attached T-SQL script to purge records from DB.
Ideally script should resolve a problem of GUI slowness due to overloaded DB. It is not going to help much for Ranger 5.2.x installation and DataDomain repository because in this case GUI was slow for a different reason.
Main idea behind this script is ‘Do not touch existing savepoints and all related jobs/tasks/etc! The rest can go.’ Following items can be purged: deleted (logically marked) savepoints, corresponding backup/restore tasks and jobs; replication tasks and jobs.
Instructions:
- Make sure you are not running any tasks.
- IT IS STRONGLY RECOMMENDED TO HAVE YOUR vRangerPro DB BACKUP!
- Adjust some parameters in script (see Variables Section in script), defaults are pretty good for most cases.
- Execute script either through SQL Management Studio or sqlcmd (sqlcmd -S hostname\SQLinstance -i c:\purgeDB.sql). By default script will be executed in test mode. No changes are made to DB.
- Observe output. Make sure there are no errors. At this point you can set @test_run variable to 0 and execute script one more time.
- Restart vRangerPro Service.
Any questions or comments are welcome.
================ update. October 08, 2012 ==================
A new version of the script posted. Changes:
- Minor bug has been fixed;
- SavePointXml purge optimized;
- DB shrink added.
Original script has been used multiple times and proved its functionality in the following situations:
- old failed/canceled/aborted attempts counter need to be reset;
- SQL Express database size limit reached for vRanger;
- general GUI slowness;
- excessive stored procedure calls made by Ranger JobManager should be eliminated.
Recommended usage.
Run script as is. Observe results. Set @test_run variable to 0 and re-run. All changes will be committed and DB shrunk.