472,954 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

SQL 2005 Backup Problems

We have a SQL 2005 server running the following backup job:

EXECUTE master.dbo.xp_create_subdir
N'\\Server\Backups\DBServerName\\DB_Name__METABASE '

GO

EXECUTE master.dbo.xp_create_subdir
N'\\server\Backups\DBServerName\\DB_Name__MSCRM'

GO

BACKUP DATABASE [db_name__metabase] TO disk = N'\\server\Backups
\DBServerName\\DB_Name__METABASE
\DB_Name__METABASE_backup_200610261158.bak' WITH differential ,
noformat , noinit , name =
N'DB_Name__METABASE_backup_20061026115839' , skip , rewind ,
nounload , stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__METABASE'
AND backup_set_id = (SELECT MAX(backup_set_id)
FROM msdb..backupset
WHERE database_name =
N'DB_Name__METABASE')

IF @backupSetId IS NULL
BEGIN
RAISERROR (N'Verify failed. Backup information for database
''DB_Name__METABASE'' not found.',16,1)
END

RESTORE verifyonly FROM disk = N'\\server\Backups\DBServerName\
\DB_Name__METABASE\DB_Name__METABASE_backup_200610 261158.bak' WITH
FILE = @backupSetId , nounload , norewind

GO

BACKUP DATABASE [db_name__mscrm] TO disk = N'\\server\Backups
\DBServerName\\DB_Name__MSCRM\DB_Name__MSCRM_backu p_200610261158.bak'
WITH differential , noformat , noinit , name =
N'DB_Name__MSCRM_backup_20061026115839' , skip , rewind , nounload ,
stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCRM'
AND backup_set_id = (SELECT MAX(backup_set_id)
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCRM')

IF @backupSetId IS NULL
BEGIN
RAISERROR (N'Verify failed. Backup information for database
''DB_Name__MSCRM'' not found.',16,1)
END

RESTORE verifyonly FROM disk = N'\\server\Backups\DBServerName\
\DB_Name__MSCRM\DB_Name__MSCRM_backup_200610261158 .bak' WITH FILE =
@backupSetId , nounload , norewind

This job was set up long before i started here and the problem is that
the backup file itself has grown to be over 230 GB. It does not
appear that the backup job is pruning the file. is there a way to
view the contents of this file and then prune it so we keep no more
then two weeks worth of data.

Thanks

Mar 13 '07 #1
1 4023
"Bryan" <bs*****@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
We have a SQL 2005 server running the following backup job:
I'd do several things here.

I'd probably rewrite the entire thing.

For one it has a date hard coded, which obviously will cause confusion.

Anyway, try

RESTORE FILELISTONLY from disk =
N'\\server\Backups\DBServerName\\DB_Name__METABASE \DB_Name__METABASE_backup_200610261158.bak'
I'd probably copy this file someplace else and start over with daily and
transactional bakcups.

In fact I'd make a full backup right away.

It looks like you're only doing differential backups. Without a full to
base these off of, they're basically useless.

(and at this point that means you have 230 GB of useless backups.)

As for pruning, I recommend using a single backup file per file and simply
deleting the older ones.

EXECUTE master.dbo.xp_create_subdir
N'\\Server\Backups\DBServerName\\DB_Name__METABASE '

GO

EXECUTE master.dbo.xp_create_subdir
N'\\server\Backups\DBServerName\\DB_Name__MSCRM'

GO

BACKUP DATABASE [db_name__metabase] TO disk = N'\\server\Backups
\DBServerName\\DB_Name__METABASE
\DB_Name__METABASE_backup_200610261158.bak' WITH differential ,
noformat , noinit , name =
N'DB_Name__METABASE_backup_20061026115839' , skip , rewind ,
nounload , stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__METABASE'
AND backup_set_id = (SELECT MAX(backup_set_id)
FROM msdb..backupset
WHERE database_name =
N'DB_Name__METABASE')

IF @backupSetId IS NULL
BEGIN
RAISERROR (N'Verify failed. Backup information for database
''DB_Name__METABASE'' not found.',16,1)
END

RESTORE verifyonly FROM disk = N'\\server\Backups\DBServerName\
\DB_Name__METABASE\DB_Name__METABASE_backup_200610 261158.bak' WITH
FILE = @backupSetId , nounload , norewind

GO

BACKUP DATABASE [db_name__mscrm] TO disk = N'\\server\Backups
\DBServerName\\DB_Name__MSCRM\DB_Name__MSCRM_backu p_200610261158.bak'
WITH differential , noformat , noinit , name =
N'DB_Name__MSCRM_backup_20061026115839' , skip , rewind , nounload ,
stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCRM'
AND backup_set_id = (SELECT MAX(backup_set_id)
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCRM')

IF @backupSetId IS NULL
BEGIN
RAISERROR (N'Verify failed. Backup information for database
''DB_Name__MSCRM'' not found.',16,1)
END

RESTORE verifyonly FROM disk = N'\\server\Backups\DBServerName\
\DB_Name__MSCRM\DB_Name__MSCRM_backup_200610261158 .bak' WITH FILE =
@backupSetId , nounload , norewind

This job was set up long before i started here and the problem is that
the backup file itself has grown to be over 230 GB. It does not
appear that the backup job is pruning the file. is there a way to
view the contents of this file and then prune it so we keep no more
then two weeks worth of data.

Thanks


--
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com
Mar 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: R.A.M. | last post by:
Hello, I am learning SQL Server 2005. I would like to write a procedure making database backup using SMO. According to my book I should write such code: using...
8
by: RAM | last post by:
Hello, I am learning SQL Server 2005. I need to know how to make a backup of a database. I tried (according to my book): BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServer.bak" But I got...
1
by: Leszekwl | last post by:
Hi My company buys new server( HP Proliant ML 570 with HP LTO ULTRIUM 232 Tape Drive. OS (Windows 2003 Enterprise - SP1) see it correctly (nt backup works, diagnostic tools don't report problems)...
2
by: m19peters | last post by:
We have a script that I had to rework a little bit for 2005 that does a full backup for every database on the server... For some reason on some nights the script does not backup all databases......
5
by: Steve | last post by:
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. ...
2
by: Oonz | last post by:
Hi Friends, Is there any tool or assistant to upgrade SQL 2000 to SQL 2005. Thanks, Arunkumar
10
by: =?Utf-8?B?UHVuaXQgS2F1cg==?= | last post by:
Hi, I am developing a windows application in VS.NET 2005. The application is database driven and I need to deploy it on a client's pc. How should I go about developing such an application. I...
0
by: Jens | last post by:
Hi! I'm trying to do a log backup of a SQL Server 2005 database with Backup Exec v11d (incl. SQL agent). But I get the following error: The item server.domain.local\DATABASE in use - skipped....
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.