473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 4042
"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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.