Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

MIS Systems Do you use SIMs or similar? Try and ease your woes here.

Go Back   EduGeek.net Forums > Technical > MIS Systems
Reply
 
LinkBack Thread Tools Search Thread
Sponsored Links
Old 21-10-2009, 10:49 PM   #1
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Smile SIMS Tidy Backups - SQL 2008 - Autumn release

Hi All,

As you are all hopefully aware, Capita will be releasing SIMS Autumn release on the 9th November, with any lucky. Included in this is support for MSSQL 2008. There are a number of changes that will affect your setups, such as transaction log being replaced with Simple recovery model, so no more shrinking the log file! However on a more negative point you will lose tidy backups from System Manager and more importantly, compression from the backups. (See Resource: 16028)

I know this may sound bad, however, I think is a positive step. Have you ever had a problem in SIMS and you've had the head or such breathing down your neck to fix it, so you log a call with Capita or your Local Authority only to have them say, it's a known bug and there is a patch. So you decide to do it during the day, only to have dbupgrade take what seems like a lifetime to run a ruddy backup, and it appears to have crashed, at this stage you start to ask yourself, do I quit and use the /nobackup option? Well if you've ever looked into this, Capita did a while ago create a patch that removes compression, and OMG, it does help, I've seen backups take seconds (if the database is loaded in RAM and you have fast discs).

So this is good right? We'll how many of you routinely check you MSSQL\backup folder? Now you need start to look at compression as well. Lovely. Well I didn't like the idea of doing this, so I've created a program that will do this for you. I've uploaded it onto SupportNet, ID 688, failing that, it's attached on here too.

Overview.
It's entirely written in C#, hopefully well. It contains a built-in ZIP library - SharpZip, which in my opinion appears to be quicker then the Microsoft ZIP library. It only requires .NET Framework 2.0 - or it should . It's a small little app, 134KB in total, digitally signed to ensure it's unmodified. It will only compress uncompressed MSSQL backups (.bak) and will only delete compressed files (.zip) and MSSQL backups (.bak). It deletes before it compresses, so you don't waste time compressing only to delete. You can set the maximum age of the backup and it will delete them older then the date specified, it uses the date created. Compression is optional, and if you do choice to, it will set the creation date to the same as the MSSQL backup (.bak).

Usage
Download the program, save it to the local disc on the (SIMS) MSSQL server, I generally say create a batch file, but you can do whatever, run from command line…

Tidybackups.exe /PATH:[PATH TO YOUR MSSQL\BACKUP] /DAYS:[NO OF DAYS] [/ARCHIVE]

For example:
Tidybackups.exe /PATH:"C:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup" /DAYS:30 /ARCHIVE

This will delete any compressed files (.zip) and MSSQL backups (.bak) over 30 days old, any remaining MSSQL backups will be compressed, and the uncompressed version deleted.

If you want to do logging, you can ofcourse redirect the output to a file, so add >>log.txt
This will write any files that are compressed and\or deleted.

Once you have create a batch file, I would then schedule it to run, daily, just to keep on top of things. Hopefully you'll find this useful, just remember it's not just limited to SIMS!

Matt
Attached Files
File Type: zip tidybackups.zip (59.1 KB, 15 views)
  Reply With Quote
10 Thanks to matt40k:
Arthur (23-10-2009), bossman (22-10-2009), Grommit (10-11-2009), Jobos (22-10-2009), Rawns (06-11-2009), Sivadam (21-10-2009), sjatkn (08-11-2009), skunk (22-10-2009), timzim (09-11-2009), vikpaw (24-10-2009)
Old 21-10-2009, 10:57 PM   #2
 
Sivadam's Avatar
 
Join Date: Feb 2009
Location: Dronfield - Derbyshire
Posts: 393
uk uk yorkshire
Thanks: 39
Thanked 49 Times in 38 Posts
Rep Power: 9 Sivadam has a spectacular aura about Sivadam has a spectacular aura about Sivadam has a spectacular aura about
Default

This sounds good Matt.

'Cos I ain't technically minded (well not to any great degree) I'll alert my colleague, who is, so that he can look into this for us.

I would have thought that Capita would have been provided something similar though.
  Reply With Quote
Old 22-10-2009, 08:45 AM   #3
 
ittech's Avatar
 
Join Date: Mar 2007
Location: Reading, UK
Posts: 875
england
Thanks: 80
Thanked 35 Times in 29 Posts
Rep Power: 13 ittech has a spectacular aura about ittech has a spectacular aura about
Default

Quote:
Originally Posted by matt40k View Post
However on a more negative point you will lose tidy backups from System Manager and more importantly, compression from the backups.
Eugh
  Reply With Quote
Old 22-10-2009, 09:44 AM   #4
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Default

Tidy backups still needed you to do it manually and compression was rubbish. They used Dynazip, and the company that made it went under, it couldn't support anything over 4gb and made the whole backup process waaay longer that it needed to be.
  Reply With Quote
Old 22-10-2009, 10:21 AM   #5
 
DMcCoy's Avatar
 
Join Date: Oct 2005
Location: Isle of Wight
Posts: 2,674
uk uk isle of wight
Thanks: 6
Thanked 300 Times in 254 Posts
Rep Power: 69 DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future DMcCoy has a brilliant future
Default

Ah yes, my archives are corrupt if I let system manager do it. I just have an export running from MSSQL instead. That file then goes on to tape each day. Just one file that gets overwritten, I do make a copy when running patches or dangerous operations though.

What I'd really like to see is working auditing.
  Reply With Quote
Old 22-10-2009, 10:29 AM   #6
 
Sivadam's Avatar
 
Join Date: Feb 2009
Location: Dronfield - Derbyshire
Posts: 393
uk uk yorkshire
Thanks: 39
Thanked 49 Times in 38 Posts
Rep Power: 9 Sivadam has a spectacular aura about Sivadam has a spectacular aura about Sivadam has a spectacular aura about
Default

SM Backups and Tidying Backups works ok for me.
And YES they are viable backups.
They regularly get sent down to Capita for UAT purposes and I fully working for me when I get there!
  Reply With Quote
Old 22-10-2009, 11:52 AM   #7
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Default

@Sivadam
Re-read my first post, Tidy backups is going in Autumn as part of SQL 2008, as per Jon Wood's presentation at the SIMS Update Semiar, you can get the sides from SupportNet -16028.

The issue DMcCoy is refering to is an known bug with large database files or the issue with the CRC. Both issues with Dynazip, which Capita will iron out by removing it.
  Reply With Quote
Old 06-11-2009, 05:24 PM   #8
 
Rawns's Avatar
 
Join Date: Jun 2009
Location: Somerset
Posts: 71
uk uk england
Thanks: 18
Thanked 2 Times in 2 Posts
Rep Power: 2 Rawns is on a distinguished road
Default

Hi Matt40k,

First off, this looks like it will be very useful! However, while testing, I have come across an issue.

It seems that compressing the file does not function correctly. A zip file of the same name as the *.bak file is created, but the *.bak file is not added to the zip file before it is deleted. It leaves us with no *.bak file and a zip file 1k in size. When ran from a command line, the script completes in second, not near long enough to compress a file.

Example from my test:

Code:
C:\Backup>tidybackups.exe /PATH:"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup" /DAYS:7
 /ARCHIVE
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ccsfms_20091022_140740.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ccsfms_20091022_143508.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\master_20091022_140735.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\master_20091022_141333.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\master_20091022_143501.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\master_20091022_144008.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\msdb_20091022_140738.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\msdb_20091022_141334.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\msdb_20091022_143503.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\msdb_20091022_144010.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\sims_cp361_mnw_20091016_093113.zip
Compressed - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ccsfms_20091106_143508.bak
Deleted - C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ccsfms_20091106_143508.bak
Any advice you could offer to get this working would be appreciated as I would really like to use this!
  Reply With Quote
Old 06-11-2009, 05:49 PM   #9
 
Stuart_C's Avatar
 
Join Date: Nov 2007
Location: Rotherham
Posts: 451
uk uk yorkshire
Thanks: 16
Thanked 28 Times in 24 Posts
Rep Power: 10 Stuart_C has a spectacular aura about Stuart_C has a spectacular aura about
Default

Never had a proble with compression or the length of time it took to create them. I am not happy backup compression has gone
  Reply With Quote
Old 07-11-2009, 06:46 PM   #10
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Default

Quote:
Originally Posted by Stuart_C View Post
Never had a proble with compression or the length of time it took to create them. I am not happy backup compression has gone
Glad it's gone, backups now take seconds not hours. Compression can be done later when the system is not use.


@Rawns

So you have a file called ccsfms_20091106_143508.bak and a file called ccsfms_20091106_143508.zip? Mmm... not actually thought of this scenario as it shouldn't happen automatically, I assume someone has uncompressed the file from the zip. I'll have a think how I can deal with this and make new release. Thanks for the feedback.
  Reply With Quote
Old 08-11-2009, 11:49 PM   #11
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Talking

Updated version
  • Output date\time (good if your logging)
  • If .bak exists and a same named .zip exists, it'll search inside the zip for the same file, if it has the .bak already, it'll just delete the .bak. Otherwise it'll .zip it. (For example, you extract the .bak file and forget to clean up afterwards)
  • I've added the source code as well
Attached Files
File Type: zip tidybackups_source.zip (172.3 KB, 13 views)
File Type: zip tidybackups.zip (58.3 KB, 16 views)
  Reply With Quote
Thanks to matt40k from:
Rawns (09-11-2009)
Old 08-11-2009, 11:58 PM   #12
 
Jobos's Avatar
 
Join Date: Apr 2007
Location: Leicester
Posts: 574
uk uk leicestershire
Thanks: 79
Thanked 13 Times in 12 Posts
Rep Power: 9 Jobos will become famous soon enough
Default

Can't open the zips, both files are corrupt.
  Reply With Quote
Old 09-11-2009, 09:42 AM   #13
 
creese's Avatar
 
Join Date: Feb 2009
Posts: 42
south africa uk england
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 5 creese will become famous soon enough
Default

Quote:
Originally Posted by Jobos View Post
Can't open the zips, both files are corrupt.
Same here.
  Reply With Quote
Old 09-11-2009, 10:17 AM   #14
 
matt40k's Avatar
 
Join Date: Jun 2008
Posts: 1,682
uk uk england
Thanks: 119
Thanked 175 Times in 143 Posts
Rep Power: 36 matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold matt40k is a splendid one to behold
Default

Works ok here???
  Reply With Quote
Old 09-11-2009, 10:29 AM   #15
 
creese's Avatar
 
Join Date: Feb 2009
Posts: 42
south africa uk england
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 5 creese will become famous soon enough
Default

Is it geographical?
  Reply With Quote
Reply

EduGeek.net Forums > Technical > MIS Systems

Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrate SIMS database to SQL 2008 speckytecky MIS Systems 8 10-10-2009 09:43 AM
SIMS SQL 2008 migration matt40k MIS Systems 0 08-08-2009 12:08 AM
SIMS 2008 May Re-Release - 21/05/08 tech-man MIS Systems 47 09-06-2008 08:58 AM
SIMS Backups with SQL 2005 WithoutMotive MIS Systems 5 17-01-2008 10:55 AM
Error Doing Tidy Backups in Sims.Net tech_guy MIS Systems 0 07-01-2008 02:58 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:09 PM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright EduGeek.net




website uptime

© 2005 - 2009 EduGeek.net
SERVER: 4
no new posts