Quantcast
Channel: Software Communities : Popular Discussions - vRanger
Viewing all articles
Browse latest Browse all 1662

Purge DB T-SQL script

$
0
0

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:

  1. Make sure you are not running any tasks.
  2. IT IS STRONGLY RECOMMENDED TO HAVE YOUR vRangerPro DB BACKUP!
  3. Adjust some parameters in script (see Variables Section in script), defaults are pretty good for most cases.
  4. 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.
  5. 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.
  6. 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.


Viewing all articles
Browse latest Browse all 1662

Trending Articles