Backups taking a looooooong time
JackieNuby
Posts: 7 New member
in SQL Backup
I've noticed recently my backups are taking a very long time. It seems to be related to the option to delete files older than 30 days. If I uncheck that option, the diffs are done in 5 minutes. If the option is checked, they're still running the next morning. Any ideas?
Tagged:
Best Answer
-
JackieNuby Posts: 7 New memberThere ended up being an issue with inherited permissions on the database folders created for each database. Once i turned on inherited permissions for each database folder, the file cleanup now works.
Answers
One way to reduce the amount of files is to split the backups by database name and backup type if you have not already done so. So instead of storing all backups in the same folder e.g. TO DISK = [\\share\backups\...] or COPYTO = [\\share\backups\], use TO DISK = [\\share\backups\<instance>_<database>\<type>\...] or COPYTO = [\\share\backups\<instance>_<database>\<type>\].
Another option, if space is not at a premium, would be to delete the old backups in a separate job, separate from the backup e.g.
See this page for the ERASE command details.
- are the backup files password protected?
- do the backup files belong to the same server/instance you are running the deletion from?
- are the backups that were not deleted full database backups?
- do the backup files belong to the same server/instance you are running the deletion from? - Yes, but I only have 1 SQL server, so how is that an issue?
- are the backups that were not deleted full database backups? - No. I still have full backups in the folder older than 30 days.
- belonging to the same server/instance as the server/instance you are running the command from
- for the specified database (DATA_01)
- for the specified backup type (FULL_BACKUPS)
- older than the retention period (30)
If all these criteria match the backup files that were suppose to be deleted but were not, could you please post the results of running a RESTORE SQBHEADERONLY command for any one of the backups that should be have deleted but was not? E.g.
EXEC master..sqlbackup '-sql "RESTORE SQBHEADERONLY FROM DISK = [<filename>]"'
You can send me the details at peter.yeoh@red-gate.com if you prefer not to post it here.
then you should try to use the latest server.
Thanks