473,811 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL 2005 Backup Problems

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

EXECUTE master.dbo.xp_c reate_subdir
N'\\Server\Back ups\DBServerNam e\\DB_Name__MET ABASE'

GO

EXECUTE master.dbo.xp_c reate_subdir
N'\\server\Back ups\DBServerNam e\\DB_Name__MSC RM'

GO

BACKUP DATABASE [db_name__metaba se] TO disk = N'\\server\Back ups
\DBServerName\\ DB_Name__METABA SE
\DB_Name__METAB ASE_backup_2006 10261158.bak' WITH differential ,
noformat , noinit , name =
N'DB_Name__META BASE_backup_200 61026115839' , skip , rewind ,
nounload , stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__META BASE'
AND backup_set_id = (SELECT MAX(backup_set_ id)
FROM msdb..backupset
WHERE database_name =
N'DB_Name__META BASE')

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

RESTORE verifyonly FROM disk = N'\\server\Back ups\DBServerNam e\
\DB_Name__METAB ASE\DB_Name__ME TABASE_backup_2 00610261158.bak ' WITH
FILE = @backupSetId , nounload , norewind

GO

BACKUP DATABASE [db_name__mscrm] TO disk = N'\\server\Back ups
\DBServerName\\ DB_Name__MSCRM\ DB_Name__MSCRM_ backup_20061026 1158.bak'
WITH differential , noformat , noinit , name =
N'DB_Name__MSCR M_backup_200610 26115839' , skip , rewind , nounload ,
stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCR M'
AND backup_set_id = (SELECT MAX(backup_set_ id)
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCR M')

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

RESTORE verifyonly FROM disk = N'\\server\Back ups\DBServerNam e\
\DB_Name__MSCRM \DB_Name__MSCRM _backup_2006102 61158.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 4058
"Bryan" <bs*****@gmail. comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.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\Back ups\DBServerNam e\\DB_Name__MET ABASE\DB_Name__ METABASE_backup _200610261158.b ak'
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_c reate_subdir
N'\\Server\Back ups\DBServerNam e\\DB_Name__MET ABASE'

GO

EXECUTE master.dbo.xp_c reate_subdir
N'\\server\Back ups\DBServerNam e\\DB_Name__MSC RM'

GO

BACKUP DATABASE [db_name__metaba se] TO disk = N'\\server\Back ups
\DBServerName\\ DB_Name__METABA SE
\DB_Name__METAB ASE_backup_2006 10261158.bak' WITH differential ,
noformat , noinit , name =
N'DB_Name__META BASE_backup_200 61026115839' , skip , rewind ,
nounload , stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__META BASE'
AND backup_set_id = (SELECT MAX(backup_set_ id)
FROM msdb..backupset
WHERE database_name =
N'DB_Name__META BASE')

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

RESTORE verifyonly FROM disk = N'\\server\Back ups\DBServerNam e\
\DB_Name__METAB ASE\DB_Name__ME TABASE_backup_2 00610261158.bak ' WITH
FILE = @backupSetId , nounload , norewind

GO

BACKUP DATABASE [db_name__mscrm] TO disk = N'\\server\Back ups
\DBServerName\\ DB_Name__MSCRM\ DB_Name__MSCRM_ backup_20061026 1158.bak'
WITH differential , noformat , noinit , name =
N'DB_Name__MSCR M_backup_200610 26115839' , skip , rewind , nounload ,
stats = 10

GO

DECLARE @backupSetId AS INT

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCR M'
AND backup_set_id = (SELECT MAX(backup_set_ id)
FROM msdb..backupset
WHERE database_name = N'DB_Name__MSCR M')

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

RESTORE verifyonly FROM disk = N'\\server\Back ups\DBServerNam e\
\DB_Name__MSCRM \DB_Name__MSCRM _backup_2006102 61158.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
4349
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 Microsoft.SqlServer.Management.SMO; public static void MakeBackup() { Server server = new Server("localhost"); Backup backup = new Backup();
8
4290
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 error: Incorrect syntax near 'G:\DemoSQLServer.bak'. Please help. Thank you very much. /RAM/
1
3337
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) But SQL Server 2005 - SP1 don't see this tape drive ( MS SQL Server Management Studio Backup Devices is empty and I can't add new Tape Backup Device (this option is unavaible). Also sys.backup_devices and sys.dm_io_backup_tapes show nothing....
2
21139
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... Its like it skips over it for some reason... Output of the script below on the night in question was: Executed as user: NT AUTHORITY\SYSTEM. master (Message 0) Status is ONLINE dbname / dbdevice = master / SQLBUmaster (Message 0) Processed...
5
34050
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. My company has two identical web sites. One copy is for our customer, and one copy is for us to test our code changes on. We developed a hard to isolate bug in the copy of the web stie for our
2
6316
by: Oonz | last post by:
Hi Friends, Is there any tool or assistant to upgrade SQL 2000 to SQL 2005. Thanks, Arunkumar
10
6105
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 remember I did something once long back .. like including .mdf files into my project in the solution explorer of VS 2005 and then used Click Once deployment tool ... to make sure that the database and tables were created when the client installed my...
0
1800
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. Backup- server.domain.local V-79-57344-33938 - An error occurred on a query to database DATABASE.
0
9728
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10648
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.