Thursday, March 29, 2012
Backup Strategy
I'm finalizing a backup strategy for a production SQL Server with several
databases. I intend to use the same setup for several new production SQL
Servers. Please let me know if there are any "holes" in this plan or if you
have any suggestions.
I've been advised not to use remote backups to shares but instead to backup
locally to disk. The reasons for this:
-performance of the backups
-integrity of the backups
-faster recovery from local backups
I'm going to be using SQL Server to backup locally to disk and then using
Veritas to backup the local backup files to a remote share and then to tape
for offsite storage.
I'll be using Database Maintanence Plans for Full and Transaction Log
backups based on the requirements for each database. The files will be
automatically removed over time (as part of the Maint plan) following the
file copies to the remote share. I may use custom backup scripts in the
future if I require additional functionality not exposed through the Maint
plans. The files for the last one or two backups for each database will be
retained locally.
I'll be adding a seperate drive to each machine to seperate the location of
the backups from the data to help maximize the recoverability of the data.
I could backup directly the array containing the data however a seperate
drive seems like a better option (?)
I'm considering adding two drives in a RAID 1 configuration for the local
backups. This would provide fault tolerance for the backups until the
backups can be copied to the remote share (nightly). Is this a common
practice? Adding two seperate drives in a RAID 1 configuration for each
production SQL Server will increase cost and I'm not sure it is required -
feedback?
Thanks.
JerryYou are taking some risk with this setup...Until the backup files are copied
OFF to another server you will be unable to restore...
I prefer to back up to a file share directly ( yes it is slower), but the
window of risk has been eliminated...
If you must put your backups on the same server, use a different disk
controller than the data disks, mirroring as you suggest will give you
redundancy on the hard drives, but will not account for entire server
failures...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:O29MjifZFHA.2444@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm finalizing a backup strategy for a production SQL Server with several
> databases. I intend to use the same setup for several new production SQL
> Servers. Please let me know if there are any "holes" in this plan or if
> you have any suggestions.
> I've been advised not to use remote backups to shares but instead to
> backup locally to disk. The reasons for this:
> -performance of the backups
> -integrity of the backups
> -faster recovery from local backups
> I'm going to be using SQL Server to backup locally to disk and then using
> Veritas to backup the local backup files to a remote share and then to
> tape for offsite storage.
> I'll be using Database Maintanence Plans for Full and Transaction Log
> backups based on the requirements for each database. The files will be
> automatically removed over time (as part of the Maint plan) following the
> file copies to the remote share. I may use custom backup scripts in the
> future if I require additional functionality not exposed through the Maint
> plans. The files for the last one or two backups for each database will
> be retained locally.
> I'll be adding a seperate drive to each machine to seperate the location
> of the backups from the data to help maximize the recoverability of the
> data. I could backup directly the array containing the data however a
> seperate drive seems like a better option (?)
> I'm considering adding two drives in a RAID 1 configuration for the local
> backups. This would provide fault tolerance for the backups until the
> backups can be copied to the remote share (nightly). Is this a common
> practice? Adding two seperate drives in a RAID 1 configuration for each
> production SQL Server will increase cost and I'm not sure it is required -
> feedback?
> Thanks.
> Jerry
>|||In article <#QPCAqiZFHA.3220@.TK2MSFTNGP14.phx.gbl>,
wayne.nospam.snyder@.mariner-usa.com says...
> You are taking some risk with this setup...Until the backup files are copied
> OFF to another server you will be unable to restore...
> I prefer to back up to a file share directly ( yes it is slower), but the
> window of risk has been eliminated...
> If you must put your backups on the same server, use a different disk
> controller than the data disks, mirroring as you suggest will give you
> redundancy on the hard drives, but will not account for entire server
> failures...
The OP was talking about backups of SQL DB's not the server. I always
backup to a local drive (separate physical drive) and then backup to
tape. The backup to tape of a SQL server DB is slow and can present a
number of issues - the backup to disk is quick, gives an on-line
accessible backup, does not load the network, and can be copied to tape
quickly at any time.
In a production environment it's often a good idea to have a local
backup on the server in case you need to do a restore quickly. The
likelihood of a drive failure is slimmer than a network problem and the
performance is much higher.
--
--
spam999free@.rrohio.com
remove 999 in order to email me
Backup Strategy
I'm finalizing a backup strategy for a production SQL Server with several
databases. I intend to use the same setup for several new production SQL
Servers. Please let me know if there are any "holes" in this plan or if you
have any suggestions.
I've been advised not to use remote backups to shares but instead to backup
locally to disk. The reasons for this:
-performance of the backups
-integrity of the backups
-faster recovery from local backups
I'm going to be using SQL Server to backup locally to disk and then using
Veritas to backup the local backup files to a remote share and then to tape
for offsite storage.
I'll be using Database Maintanence Plans for Full and Transaction Log
backups based on the requirements for each database. The files will be
automatically removed over time (as part of the Maint plan) following the
file copies to the remote share. I may use custom backup scripts in the
future if I require additional functionality not exposed through the Maint
plans. The files for the last one or two backups for each database will be
retained locally.
I'll be adding a seperate drive to each machine to seperate the location of
the backups from the data to help maximize the recoverability of the data.
I could backup directly the array containing the data however a seperate
drive seems like a better option (?)
I'm considering adding two drives in a RAID 1 configuration for the local
backups. This would provide fault tolerance for the backups until the
backups can be copied to the remote share (nightly). Is this a common
practice? Adding two seperate drives in a RAID 1 configuration for each
production SQL Server will increase cost and I'm not sure it is required -
feedback?
Thanks.
Jerry
You are taking some risk with this setup...Until the backup files are copied
OFF to another server you will be unable to restore...
I prefer to back up to a file share directly ( yes it is slower), but the
window of risk has been eliminated...
If you must put your backups on the same server, use a different disk
controller than the data disks, mirroring as you suggest will give you
redundancy on the hard drives, but will not account for entire server
failures...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:O29MjifZFHA.2444@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm finalizing a backup strategy for a production SQL Server with several
> databases. I intend to use the same setup for several new production SQL
> Servers. Please let me know if there are any "holes" in this plan or if
> you have any suggestions.
> I've been advised not to use remote backups to shares but instead to
> backup locally to disk. The reasons for this:
> -performance of the backups
> -integrity of the backups
> -faster recovery from local backups
> I'm going to be using SQL Server to backup locally to disk and then using
> Veritas to backup the local backup files to a remote share and then to
> tape for offsite storage.
> I'll be using Database Maintanence Plans for Full and Transaction Log
> backups based on the requirements for each database. The files will be
> automatically removed over time (as part of the Maint plan) following the
> file copies to the remote share. I may use custom backup scripts in the
> future if I require additional functionality not exposed through the Maint
> plans. The files for the last one or two backups for each database will
> be retained locally.
> I'll be adding a seperate drive to each machine to seperate the location
> of the backups from the data to help maximize the recoverability of the
> data. I could backup directly the array containing the data however a
> seperate drive seems like a better option (?)
> I'm considering adding two drives in a RAID 1 configuration for the local
> backups. This would provide fault tolerance for the backups until the
> backups can be copied to the remote share (nightly). Is this a common
> practice? Adding two seperate drives in a RAID 1 configuration for each
> production SQL Server will increase cost and I'm not sure it is required -
> feedback?
> Thanks.
> Jerry
>
|||In article <#QPCAqiZFHA.3220@.TK2MSFTNGP14.phx.gbl>,
wayne.nospam.snyder@.mariner-usa.com says...
> You are taking some risk with this setup...Until the backup files are copied
> OFF to another server you will be unable to restore...
> I prefer to back up to a file share directly ( yes it is slower), but the
> window of risk has been eliminated...
> If you must put your backups on the same server, use a different disk
> controller than the data disks, mirroring as you suggest will give you
> redundancy on the hard drives, but will not account for entire server
> failures...
The OP was talking about backups of SQL DB's not the server. I always
backup to a local drive (separate physical drive) and then backup to
tape. The backup to tape of a SQL server DB is slow and can present a
number of issues - the backup to disk is quick, gives an on-line
accessible backup, does not load the network, and can be copied to tape
quickly at any time.
In a production environment it's often a good idea to have a local
backup on the server in case you need to do a restore quickly. The
likelihood of a drive failure is slimmer than a network problem and the
performance is much higher.
--
spam999free@.rrohio.com
remove 999 in order to email me
Backup Strategy
I'm finalizing a backup strategy for a production SQL Server with several
databases. I intend to use the same setup for several new production SQL
Servers. Please let me know if there are any "holes" in this plan or if you
have any suggestions.
I've been advised not to use remote backups to shares but instead to backup
locally to disk. The reasons for this:
-performance of the backups
-integrity of the backups
-faster recovery from local backups
I'm going to be using SQL Server to backup locally to disk and then using
Veritas to backup the local backup files to a remote share and then to tape
for offsite storage.
I'll be using Database Maintanence Plans for Full and Transaction Log
backups based on the requirements for each database. The files will be
automatically removed over time (as part of the Maint plan) following the
file copies to the remote share. I may use custom backup scripts in the
future if I require additional functionality not exposed through the Maint
plans. The files for the last one or two backups for each database will be
retained locally.
I'll be adding a seperate drive to each machine to seperate the location of
the backups from the data to help maximize the recoverability of the data.
I could backup directly the array containing the data however a seperate
drive seems like a better option (?)
I'm considering adding two drives in a RAID 1 configuration for the local
backups. This would provide fault tolerance for the backups until the
backups can be copied to the remote share (nightly). Is this a common
practice? Adding two seperate drives in a RAID 1 configuration for each
production SQL Server will increase cost and I'm not sure it is required -
feedback?
Thanks.
JerryYou are taking some risk with this setup...Until the backup files are copied
OFF to another server you will be unable to restore...
I prefer to back up to a file share directly ( yes it is slower), but the
window of risk has been eliminated...
If you must put your backups on the same server, use a different disk
controller than the data disks, mirroring as you suggest will give you
redundancy on the hard drives, but will not account for entire server
failures...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:O29MjifZFHA.2444@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm finalizing a backup strategy for a production SQL Server with several
> databases. I intend to use the same setup for several new production SQL
> Servers. Please let me know if there are any "holes" in this plan or if
> you have any suggestions.
> I've been advised not to use remote backups to shares but instead to
> backup locally to disk. The reasons for this:
> -performance of the backups
> -integrity of the backups
> -faster recovery from local backups
> I'm going to be using SQL Server to backup locally to disk and then using
> Veritas to backup the local backup files to a remote share and then to
> tape for offsite storage.
> I'll be using Database Maintanence Plans for Full and Transaction Log
> backups based on the requirements for each database. The files will be
> automatically removed over time (as part of the Maint plan) following the
> file copies to the remote share. I may use custom backup scripts in the
> future if I require additional functionality not exposed through the Maint
> plans. The files for the last one or two backups for each database will
> be retained locally.
> I'll be adding a seperate drive to each machine to seperate the location
> of the backups from the data to help maximize the recoverability of the
> data. I could backup directly the array containing the data however a
> seperate drive seems like a better option (?)
> I'm considering adding two drives in a RAID 1 configuration for the local
> backups. This would provide fault tolerance for the backups until the
> backups can be copied to the remote share (nightly). Is this a common
> practice? Adding two seperate drives in a RAID 1 configuration for each
> production SQL Server will increase cost and I'm not sure it is required -
> feedback?
> Thanks.
> Jerry
>|||In article <#QPCAqiZFHA.3220@.TK2MSFTNGP14.phx.gbl>,
wayne.nospam.snyder@.mariner-usa.com says...
> You are taking some risk with this setup...Until the backup files are copi
ed
> OFF to another server you will be unable to restore...
> I prefer to back up to a file share directly ( yes it is slower), but the
> window of risk has been eliminated...
> If you must put your backups on the same server, use a different disk
> controller than the data disks, mirroring as you suggest will give you
> redundancy on the hard drives, but will not account for entire server
> failures...
The OP was talking about backups of SQL DB's not the server. I always
backup to a local drive (separate physical drive) and then backup to
tape. The backup to tape of a SQL server DB is slow and can present a
number of issues - the backup to disk is quick, gives an on-line
accessible backup, does not load the network, and can be copied to tape
quickly at any time.
In a production environment it's often a good idea to have a local
backup on the server in case you need to do a restore quickly. The
likelihood of a drive failure is slimmer than a network problem and the
performance is much higher.
--
spam999free@.rrohio.com
remove 999 in order to email me
Sunday, March 25, 2012
Backup solution - question about transaction log
Anyway, I was going through some of the backups jobs and noticed that the transaction logs for each database were absolutely huge (in some cases bigger than the DB itself) which led me to think the log wasn't getting truncated.
The T-SQL being run in each case was
Currently, the transaction log for 6 DBs is backed up 3 times a day (and the 7th, "mission critical" DB is backed up every 15 minutes) with the following T-SQL:
BACKUP LOG <database> to <device> WITH NOINIT, NOFORMAT, NOSKIP, NOUNLOAD
5 of the 7 databases get a full backup twice a day, with the 2 larger ones getting a differential, with e.g.,
BACKUP DATABASE <database> TO <device> WITH NOINIT , NOUNLOAD , NAME = N'db', NOSKIP , STATS = 10, DESCRIPTION = N'db', NOFORMAT , MEDIANAME = N'db'DECLARE @.i INT
select @.i = position from msdb..backupset where database_name='db'and type!='F' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name='db')
RESTORE VERIFYONLY FROM <device> WITH FILE = @.i
This is then backed up to tape each night.
Looking through the documentation, those WITH commands are largely the default settings so I'm not sure why they're specified explicitly.
If I issue a
BACKUP LOG <database> to <device> WITH INIT, SKIP
then the log does get truncated. However, could someone explain the implications of that for me? As I understand it, INIT will overwrite any existing sets in the device, but considering that it will always backup anything that hasn't been committed then should it be a problem?
Alternatively could someone perhaps explain why the log wasn't getting truncated? It is my understanding that this should happen every time a full backup is completed... which is twice a day. Or does the Transaction log need to be manually shrunk every now and then?
Also, I understand the DECLARE... part in the last part of that DB backup SQL, but is it at all necessary?
Finally, does this backup strategy seem viable? Any thoughts and comments are appreciated!
Matt
By default in the backup database command if you do not specify anything it will append ,eg...
backup database xxxx to disk='F:\test\xxxx.bak' and check the bak file size
now again reissue the same command,
backup database xxxx to disk='F:\test\xxxx.bak' and once again check the bak file size.......it will be double the size
next time issue the same command using WITH INIT option,
backup database xxxx to disk='F:\test\xxxx.bak' WITH INIT now see the bak file size it will be the same size as in 1st case.........if you do not specify anything SQL server will use the default With NOINIT option..........so you need to specify them explicitly if you needed to overwrite........
the log gets truncated if you specify the command,
backup log dbname with truncate_only.........this command will be depreciated in future versions........once you issue this comand, all the committed transactions will be rolled forward and written to data file and uncommitted trans will be rolled back.......
since you have a mission critical db i suggest you go for Log shipping or Database mirroring in sql 2005.........instead of relying on your db backups.........if you have sufficient disk space go for full backup and if you feel the db is important and if you want to have db consistency you can have tran log backups and differential backups else not required........
|||Am I right about when the transaction log should get truncated - i.e., on a full database backup?|||You are right, that the transaction log should be truncated after a full backup. However, note that the contents of the log will be truncated and the physical file will maintain its size. Therefore, you may see a large transaction log file although it won't be full. In order to reduce the size of the file, you'll need to run some form of SHRINKFILE operation.
HTH!
Wednesday, March 7, 2012
Backup one server, restore to another
server. They (the servers) aren't completely identical, however. Production
has 3 logical disks for OS, data and logs while standby has only two disks.
The real problem though is the time it takes to do a restore using EM. It
seems that I have to restore the full backup then each transaction log
separately. It would be very convenient to be able to specify (using add
device) the full backup and all of the logs I want at once, then only have
to change the paths to the database and log files one time. I've read
through BOL but it is silent on this issue. Is it possible through EM? Or
should I be looking at a third-party app from e.g. Red Gate?You could write a SQL script that implements the WITH MOVE option of the
backup command. Enterprise Manager is a nice tool, but I haven't figured
out how to automate a series of mouse clicks. For repeatability, you have
to go to T_SQL scripts.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in message
news:e3vH%23OT0GHA.4648@.TK2MSFTNGP04.phx.gbl...
>I frequently restore the backups of my production server to my standby/test
> server. They (the servers) aren't completely identical, however.
> Production
> has 3 logical disks for OS, data and logs while standby has only two
> disks.
> The real problem though is the time it takes to do a restore using EM. It
> seems that I have to restore the full backup then each transaction log
> separately. It would be very convenient to be able to specify (using add
> device) the full backup and all of the logs I want at once, then only have
> to change the paths to the database and log files one time. I've read
> through BOL but it is silent on this issue. Is it possible through EM? Or
> should I be looking at a third-party app from e.g. Red Gate?
>
Backup one server, restore to another
server. They (the servers) aren't completely identical, however. Production
has 3 logical disks for OS, data and logs while standby has only two disks.
The real problem though is the time it takes to do a restore using EM. It
seems that I have to restore the full backup then each transaction log
separately. It would be very convenient to be able to specify (using add
device) the full backup and all of the logs I want at once, then only have
to change the paths to the database and log files one time. I've read
through BOL but it is silent on this issue. Is it possible through EM? Or
should I be looking at a third-party app from e.g. Red Gate?You could write a SQL script that implements the WITH MOVE option of the
backup command. Enterprise Manager is a nice tool, but I haven't figured
out how to automate a series of mouse clicks. For repeatability, you have
to go to T_SQL scripts.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Ron Hinds" < __ron__dontspamme@.wedontlikespam_garagei
q.com> wrote in message
news:e3vH%23OT0GHA.4648@.TK2MSFTNGP04.phx.gbl...
>I frequently restore the backups of my production server to my standby/test
> server. They (the servers) aren't completely identical, however.
> Production
> has 3 logical disks for OS, data and logs while standby has only two
> disks.
> The real problem though is the time it takes to do a restore using EM. It
> seems that I have to restore the full backup then each transaction log
> separately. It would be very convenient to be able to specify (using add
> device) the full backup and all of the logs I want at once, then only have
> to change the paths to the database and log files one time. I've read
> through BOL but it is silent on this issue. Is it possible through EM? Or
> should I be looking at a third-party app from e.g. Red Gate?
>
Sunday, February 19, 2012
Backup logs enterprise/restore standard?
machine, then restoring them to the warm standby. Both machines are
currently running 2000 Standard. If we upgrade the production machine to
Enterprise (we want to be able to allocate more than 2 GB memory), can we
keep restoring logs to Standard (so that we can defer the cost of upgrading
it until a later time)?
TIA
--
Scott NicholAll editions are binary on-disk compatible in SQL 2000. You can safely
restore a Standard Edition backup to an Enterprise Edition server. Your
"home-grown" log shipping will be just fine.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Scott Nichol" <reply_to_newsgroup@.scottnichol.com> wrote in message
news:uY7htr%23pFHA.3520@.tk2msftngp13.phx.gbl...
> We maintain a warm standby by backing up transaction logs on the
> production
> machine, then restoring them to the warm standby. Both machines are
> currently running 2000 Standard. If we upgrade the production machine to
> Enterprise (we want to be able to allocate more than 2 GB memory), can we
> keep restoring logs to Standard (so that we can defer the cost of
> upgrading
> it until a later time)?
> TIA
> --
> Scott Nichol
>
Thursday, February 16, 2012
Backup Log and Shrinking of the ldf file.
On of our Production servers, we have noticed that the actual shrinking of
the physical log file (.ldf) does not happen if we execute the backup log
statement only once. It seems we have to run the transaction log backup more
than once or multiple times to shrink the log file. The first time we
execute the backup log statement it seems that the DBCC Loginfo shows the
status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
subsequent execution of the backup log statement again a second time, the
file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases
many times to shrink the file? Is this by design? I am trying to understand
how the log and VLFs occur when it comes to backup and shrink and the need
to run the backup log statement twice to shrink the file physically. I would
like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side configuration
that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly
appreciated.
Thanks
MThis is a multi-part message in MIME format.
--010809070604000608040104
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Firstly, why are you shrinking a production transaction log? This is a
bad thing to do. Just set it to the max size to which you want it to
grow, back it up regularly enough so that it doesn't exceed that size
and then leave it alone. (See Tibor's "don't shrink" page:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp)
Now that that's out of the way... The transaction log (logical) is a
circular structure. When it gets to the end of the physical file it
wraps back around to the start of the physical file (assuming there are
no transactions at the start of the physical file, ie. that they've been
truncated from a previous BACKUP statement, otherwise it will try to do
an auto-grow if you haven't restricted it). When you backup the
transaction log, it is automatically truncated but some logical part of
it (VLF) is still the "active" logical file. This is where the new
transactions start from (not the beginning of the physical file). When
you shrink the log file (with DBCC SHRINKFILE) it shrinks the physical
file from the end back to that last VLF that contains transactions. So,
if the active VLF is somewhere near the end of the physical file, it's
not going to shrink very much, but when more transactions are committed,
the log will "wrap" back around to the start of the physical file. If
you did a BACKUP LOG and DBCC SHRINKFILE at this point then the physical
file would be able to shrink down considerably.
This is most likely the reason you're needing to do multiple BACKUPs
(and correspondingly DBCC SHRINKFILEs) in order to shrink it past a
point - because you need the transactions to wrap back around to the
start of the physical file.
However, it should all be a moot point because you shouldn't be
shrinking production transaction logs - bad, bad, naughty, naughty.
Just set it and leave it alone. And if you want it to stay tiny just
back it up more regularly. Or if you want it to stay tiny and don't
care about keeping the transaction log, then put the database in SIMPLE
recovery mode (just make sure you do full DB backups often enough to
minimise data loss).
--
*mike hodgson*
http://sqlnerd.blogspot.com
Meher wrote:
>Hi:
>On of our Production servers, we have noticed that the actual shrinking of
>the physical log file (.ldf) does not happen if we execute the backup log
>statement only once. It seems we have to run the transaction log backup more
>than once or multiple times to shrink the log file. The first time we
>execute the backup log statement it seems that the DBCC Loginfo shows the
>status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
>subsequent execution of the backup log statement again a second time, the
>file is shrunk (dbcc loginfo shows the status as 0).
>Any reason why we need to run the Tran log backup twice or in some cases
>many times to shrink the file? Is this by design? I am trying to understand
>how the log and VLFs occur when it comes to backup and shrink and the need
>to run the backup log statement twice to shrink the file physically. I would
>like to avoid that if I can and if it is possible.
>Additionally i am wondering if there is any db or server side configuration
>that causes this to happen.
>The Servers are all running SQL Server 2000 (both SP3 and SP4).
>MVPS, Please provide your valuable knowledge. Any insight is highly
>appreciated.
>Thanks
>M
>
>
>
--010809070604000608040104
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Firstly, why are you shrinking a production transaction log? This
is a bad thing to do. Just set it to the max size to which you want it
to grow, back it up regularly enough so that it doesn't exceed that
size and then leave it alone. (See Tibor's "don't shrink" page:
<a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://www.karaszi.com/SQLServer/info_dont_shrink.asp</a>)<br>">http://www.karaszi.com/SQLServer/info_dont_shrink.asp">http://www.karaszi.com/SQLServer/info_dont_shrink.asp</a>)<br>
<br>
Now that that's out of the way... The transaction log (logical) is a
circular structure. When it gets to the end of the physical file it
wraps back around to the start of the physical file (assuming there are
no transactions at the start of the physical file, ie. that they've
been truncated from a previous BACKUP statement, otherwise it will try
to do an auto-grow if you haven't restricted it). When you backup the
transaction log, it is automatically truncated but some logical part of
it (VLF) is still the "active" logical file. This is where the new
transactions start from (not the beginning of the physical file). When
you shrink the log file (with DBCC SHRINKFILE) it shrinks the physical
file from the end back to that last VLF that contains transactions.
So, if the active VLF is somewhere near the end of the physical file,
it's not going to shrink very much, but when more transactions are
committed, the log will "wrap" back around to the start of the physical
file. If you did a BACKUP LOG and DBCC SHRINKFILE at this point then
the physical file would be able to shrink down considerably.<br>
<br>
This is most likely the reason you're needing to do multiple BACKUPs
(and correspondingly DBCC SHRINKFILEs) in order to shrink it past a
point - because you need the transactions to wrap back around to the
start of the physical file.<br>
<br>
However, it should all be a moot point because you shouldn't be
shrinking production transaction logs - bad, bad, naughty, naughty.
Just set it and leave it alone. And if you want it to stay tiny just
back it up more regularly. Or if you want it to stay tiny and don't
care about keeping the transaction log, then put the database in SIMPLE
recovery mode (just make sure you do full DB backups often enough to
minimise data loss).<br>
</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2"><a href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
<br>
Meher wrote:
<blockquote cite="midelPEWe1YGHA.1352@.TK2MSFTNGP05.phx.gbl" type="cite">
<pre wrap="">Hi:
On of our Production servers, we have noticed that the actual shrinking of
the physical log file (.ldf) does not happen if we execute the backup log
statement only once. It seems we have to run the transaction log backup more
than once or multiple times to shrink the log file. The first time we
execute the backup log statement it seems that the DBCC Loginfo shows the
status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
subsequent execution of the backup log statement again a second time, the
file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases
many times to shrink the file? Is this by design? I am trying to understand
how the log and VLFs occur when it comes to backup and shrink and the need
to run the backup log statement twice to shrink the file physically. I would
like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side configuration
that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly
appreciated.
Thanks
M
</pre>
</blockquote>
</body>
</html>
--010809070604000608040104--|||Hi,
What is the size of production database.
Make a matinance plan and configure to shrink the logfile after full
backup.Then schedule transaction log backup.
this will help u.
from
Doller|||This is a multi-part message in MIME format.
--=_NextPart_000_000F_01C6632E.B6BDDF20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Well its not me who is shrinking the files but my customer. However I =should say the Mike this is a beautiful explanation that I have read =about why i need to do multiple backups. Thank you very much for your =explanation and suggestions. "Mike Hodgson" <e1minst3r@.gmail.com> wrote in message =news:elRBaP2YGHA.2376@.TK2MSFTNGP03.phx.gbl...
Firstly, why are you shrinking a production transaction log? This is =a bad thing to do. Just set it to the max size to which you want it to =grow, back it up regularly enough so that it doesn't exceed that size =and then leave it alone. (See Tibor's "don't shrink" page: =http://www.karaszi.com/SQLServer/info_dont_shrink.asp)
Now that that's out of the way... The transaction log (logical) is a =circular structure. When it gets to the end of the physical file it =wraps back around to the start of the physical file (assuming there are =no transactions at the start of the physical file, ie. that they've been =truncated from a previous BACKUP statement, otherwise it will try to do =an auto-grow if you haven't restricted it). When you backup the =transaction log, it is automatically truncated but some logical part of =it (VLF) is still the "active" logical file. This is where the new =transactions start from (not the beginning of the physical file). When =you shrink the log file (with DBCC SHRINKFILE) it shrinks the physical =file from the end back to that last VLF that contains transactions. So, =if the active VLF is somewhere near the end of the physical file, it's =not going to shrink very much, but when more transactions are committed, =the log will "wrap" back around to the start of the physical file. If =you did a BACKUP LOG and DBCC SHRINKFILE at this point then the physical =file would be able to shrink down considerably.
This is most likely the reason you're needing to do multiple BACKUPs =(and correspondingly DBCC SHRINKFILEs) in order to shrink it past a =point - because you need the transactions to wrap back around to the =start of the physical file.
However, it should all be a moot point because you shouldn't be =shrinking production transaction logs - bad, bad, naughty, naughty. =Just set it and leave it alone. And if you want it to stay tiny just =back it up more regularly. Or if you want it to stay tiny and don't =care about keeping the transaction log, then put the database in SIMPLE =recovery mode (just make sure you do full DB backups often enough to =minimise data loss).
--
mike hodgson
http://sqlnerd.blogspot.com=20
Meher wrote: Hi:
On of our Production servers, we have noticed that the actual shrinking =of the physical log file (.ldf) does not happen if we execute the backup =log statement only once. It seems we have to run the transaction log backup =more than once or multiple times to shrink the log file. The first time we execute the backup log statement it seems that the DBCC Loginfo shows =the status of the VLF as 2 and therefore we cannot shrink the ldf file. On a =
subsequent execution of the backup log statement again a second time, =the file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases =
many times to shrink the file? Is this by design? I am trying to =understand how the log and VLFs occur when it comes to backup and shrink and the =need to run the backup log statement twice to shrink the file physically. I =would like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side =configuration that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly appreciated.
Thanks
M
--=_NextPart_000_000F_01C6632E.B6BDDF20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Well its not me who is shrinking the =files but my customer. However I should say the Mike this is a beautiful explanation =that I have read about why i need to do multiple backups. Thank you very much =for your explanation and suggestions.
"Mike Hodgson"
--mike =hodgsonhttp://sqlnerd.blogspot.com Meher wrote: Hi:
On of our Production servers, we have noticed that the actual shrinking =of the physical log file (.ldf) does not happen if we execute the backup =log statement only once. It seems we have to run the transaction log backup =more than once or multiple times to shrink the log file. The first time we execute the backup log statement it seems that the DBCC Loginfo shows =the status of the VLF as 2 and therefore we cannot shrink the ldf file. On a =subsequent execution of the backup log statement again a second time, =the file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases =many times to shrink the file? Is this by design? I am trying to =understand how the log and VLFs occur when it comes to backup and shrink and the =need to run the backup log statement twice to shrink the file physically. I =would like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side =configuration that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly appreciated.
Thanks
M
--=_NextPart_000_000F_01C6632E.B6BDDF20--
Backup Log and Shrinking of the ldf file.
On of our Production servers, we have noticed that the actual shrinking of
the physical log file (.ldf) does not happen if we execute the backup log
statement only once. It seems we have to run the transaction log backup more
than once or multiple times to shrink the log file. The first time we
execute the backup log statement it seems that the DBCC Loginfo shows the
status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
subsequent execution of the backup log statement again a second time, the
file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases
many times to shrink the file? Is this by design? I am trying to understand
how the log and VLFs occur when it comes to backup and shrink and the need
to run the backup log statement twice to shrink the file physically. I would
like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side configuration
that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly
appreciated.
Thanks
MFirstly, why are you shrinking a production transaction log? This is a
bad thing to do. Just set it to the max size to which you want it to
grow, back it up regularly enough so that it doesn't exceed that size
and then leave it alone. (See Tibor's "don't shrink" page:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp)
Now that that's out of the way... The transaction log (logical) is a
circular structure. When it gets to the end of the physical file it
wraps back around to the start of the physical file (assuming there are
no transactions at the start of the physical file, ie. that they've been
truncated from a previous BACKUP statement, otherwise it will try to do
an auto-grow if you haven't restricted it). When you backup the
transaction log, it is automatically truncated but some logical part of
it (VLF) is still the "active" logical file. This is where the new
transactions start from (not the beginning of the physical file). When
you shrink the log file (with DBCC SHRINKFILE) it shrinks the physical
file from the end back to that last VLF that contains transactions. So,
if the active VLF is somewhere near the end of the physical file, it's
not going to shrink very much, but when more transactions are committed,
the log will "wrap" back around to the start of the physical file. If
you did a BACKUP LOG and DBCC SHRINKFILE at this point then the physical
file would be able to shrink down considerably.
This is most likely the reason you're needing to do multiple BACKUPs
(and correspondingly DBCC SHRINKFILEs) in order to shrink it past a
point - because you need the transactions to wrap back around to the
start of the physical file.
However, it should all be a moot point because you shouldn't be
shrinking production transaction logs - bad, bad, naughty, naughty.
Just set it and leave it alone. And if you want it to stay tiny just
back it up more regularly. Or if you want it to stay tiny and don't
care about keeping the transaction log, then put the database in SIMPLE
recovery mode (just make sure you do full DB backups often enough to
minimise data loss).
*mike hodgson*
http://sqlnerd.blogspot.com
Meher wrote:
>Hi:
>On of our Production servers, we have noticed that the actual shrinking of
>the physical log file (.ldf) does not happen if we execute the backup log
>statement only once. It seems we have to run the transaction log backup mor
e
>than once or multiple times to shrink the log file. The first time we
>execute the backup log statement it seems that the DBCC Loginfo shows the
>status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
>subsequent execution of the backup log statement again a second time, the
>file is shrunk (dbcc loginfo shows the status as 0).
>Any reason why we need to run the Tran log backup twice or in some cases
>many times to shrink the file? Is this by design? I am trying to understand
>how the log and VLFs occur when it comes to backup and shrink and the need
>to run the backup log statement twice to shrink the file physically. I woul
d
>like to avoid that if I can and if it is possible.
>Additionally i am wondering if there is any db or server side configuration
>that causes this to happen.
>The Servers are all running SQL Server 2000 (both SP3 and SP4).
>MVPS, Please provide your valuable knowledge. Any insight is highly
>appreciated.
>Thanks
>M
>
>
>|||Hi,
What is the size of production database.
Make a matinance plan and configure to shrink the logfile after full
backup.Then schedule transaction log backup.
this will help u.
from
Doller|||Well its not me who is shrinking the files but my customer. However I should
say the Mike this is a beautiful explanation that I have read about why i n
eed to do multiple backups. Thank you very much for your explanation and sug
gestions.
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:elRBaP2YGHA.2376@.
TK2MSFTNGP03.phx.gbl...
Firstly, why are you shrinking a production transaction log? This is a bad thing to do
. Just set it to the max size to which you want it to grow, back it up regularly enoug
h so that it doesn't exceed that size and then leave it alone. (See Tibor's "don't shr
ink" page: http://www.karaszi.com/SQLServer/info_dont_shrink.asp)
Now that that's out of the way... The transaction log (logical) is a circul
ar structure. When it gets to the end of the physical file it wraps back ar
ound to the start of the physical file (assuming there are no transactions a
t the start of the physical file, ie. that they've been truncated from a pre
vious BACKUP statement, otherwise it will try to do an auto-grow if you have
n't restricted it). When you backup the transaction log, it is automaticall
y truncated but some logical part of it (VLF) is still the "active" logical
file. This is where the new transactions start from (not the beginning of t
he physical file). When you shrink the log file (with DBCC SHRINKFILE) it s
hrinks the physical file from the end back to that last VLF that contains tr
ansactions. So, if the active VLF is somewhere near the end of the physical
file, it's not going to shrink very much, but when more transactions are co
mmitted, the log will "wrap" back around to the start of the physical file.
If you did a BACKUP LOG and DBCC SHRINKFILE at this point then the physical
file would be able to shrink down considerably.
This is most likely the reason you're needing to do multiple BACKUPs (and co
rrespondingly DBCC SHRINKFILEs) in order to shrink it past a point - because
you need the transactions to wrap back around to the start of the physical
file.
However, it should all be a moot point because you shouldn't be shrinking pr
oduction transaction logs - bad, bad, naughty, naughty. Just set it and lea
ve it alone. And if you want it to stay tiny just back it up more regularly
. Or if you want it to stay tiny and don't care about keeping the transacti
on log, then put the database in SIMPLE recovery mode (just make sure you do
full DB backups often enough to minimise data loss).
mike hodgson
http://sqlnerd.blogspot.com
Meher wrote:
Hi:
On of our Production servers, we have noticed that the actual shrinking of
the physical log file (.ldf) does not happen if we execute the backup log
statement only once. It seems we have to run the transaction log backup more
than once or multiple times to shrink the log file. The first time we
execute the backup log statement it seems that the DBCC Loginfo shows the
status of the VLF as 2 and therefore we cannot shrink the ldf file. On a
subsequent execution of the backup log statement again a second time, the
file is shrunk (dbcc loginfo shows the status as 0).
Any reason why we need to run the Tran log backup twice or in some cases
many times to shrink the file? Is this by design? I am trying to understand
how the log and VLFs occur when it comes to backup and shrink and the need
to run the backup log statement twice to shrink the file physically. I would
like to avoid that if I can and if it is possible.
Additionally i am wondering if there is any db or server side configuration
that causes this to happen.
The Servers are all running SQL Server 2000 (both SP3 and SP4).
MVPS, Please provide your valuable knowledge. Any insight is highly
appreciated.
Thanks
M
Monday, February 13, 2012
backup job sometimes fails
We have a nightly job on a production server which backs up all databases
(about 90 on the server)
Sometimes it'll only backup some of them, yet it reports success.
Our proc to manage the process is below:
Any ideas on what we need to do to make it reliable ?
--
DECLARE @.DB_Name varchar(32)
DECLARE @.Backup_Path varchar(255)
DECLARE @.Backup_Name varchar(255)
DECLARE DB_Cursor CURSOR FOR SELECT NAME FROM sysdatabases
OPEN DB_Cursor
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF @.DB_Name <> 'tempdb' AND @.DB_Name <> 'model'
BEGIN
print '--<< ' + @.db_name + '
>>--'
SET @.Backup_Path = N'd:\sql2005backups\nightly\' + @.DB_Name + 'Daily' +
'.bak'
SET @.Backup_Name = @.DB_Name + N' backup'
BACKUP DATABASE @.DB_Name TO DISK = @.Backup_Path WITH INIT
print ''
END
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
END
Print "Finished backing up the databases"
CLOSE DB_cursor
DEALLOCATE DB_cursor
My suggestion is to look into a 3rd party package for reliable backups of business critical data....SQL 2005 just isn't there yet in this area.
Jeff
|||create a job with the above script and keep the script in step1 of the job and then in the advanced options set an output file so that the output will be written to a text file, which will be used for troubleshooting purposes..............in the step2 you can have the mail step......and see whats the output after the backup completes.......is this box with sql 2005 sp1? if yes better go to SP2 as there are few bugs which are fixed in sp2.........also try to go with maintenance plan and see whats the result if the above option fails....|||Hi
Thanks for this
We already write the output to a file - it doesn't contain any errors or anything unusual - most strange...
The box is running SQL 2005 sp2.
I could go and buy something like Red-gate backup - but I don't see why I should have to ! Most frustrating..
thanks
Bruce
|||You don't need a third party solution - SQL native backups were fine and have for years. Third party solutions are the ones that tend to be a bit more problematic. The only problem I can think of that Jeff would have been referring to is maintenance plans. The problem is with maintenance plans, not SQL Server backups.
I'm curious - you are using both single quotes as well as double quotes for print statements? Is that the actual script you are using? What is in the output file? Does it have the name of the database that are skipped or not? What is in the error log? Have you tried running a server side trace during the times you run the backups to see what is actually being executed?
-Sue
|||Hi Sue
Thanks for replying..
The line with the double-quotes we ended up commenting out.
I also put the backup statement in a 'try catch' as follows below and there was no error logged
No - it doesn't have the name of the databases that are skipped - it just seems to exit without logging any errors - and it's not consistent - some nights it gets to the end.
There is nothing logged in the error logs.... No I haven't tried running a server side trace..
thanks, Bruce.
DECLARE @.DB_Name varchar(32)
DECLARE @.Backup_Path varchar(255)
DECLARE @.Backup_Name varchar(255)
DECLARE DB_Cursor CURSOR FOR SELECT NAME FROM sysdatabases order by name
OPEN DB_Cursor
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF @.DB_Name <> 'tempdb' AND @.DB_Name <> 'model'
BEGIN
print '--<< ' + @.db_name + ' >>--'
SET @.Backup_Path = N'd:\sql2005backups\nightly\' + @.DB_Name + 'Daily' + '.bak'
SET @.Backup_Name = @.DB_Name + N' backup'
BEGIN TRY
BACKUP DATABASE @.DB_Name TO DISK = @.Backup_Path WITH INIT ;
END TRY
BEGIN CATCH
Print 'Error -- ' + ERROR_MESSAGE();
END CATCH;
print ''
END
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
END
CLOSE DB_cursor
DEALLOCATE DB_cursor
print 'Finished backing up'
|||So you need to run a trace during the backups (and for a time prior to them starting) to see more of what is going on. You'll also want to look at the logs prior to and during the backups.
-Sue
|||Bruce,
I too have something like this. I noticed that this happens when you have many databases needs to be backed up.
What we did here is to split this backup jobs into multiple steps. Each Job will backup few databases may be 50.
Try this and let me know.
Thanks
Shilpi
|||Can you check whether the existing backup file is in use? If possible alter the script to append date at the end of backup filename. Since we are backingup nearly 88 databases but didnt find any issues.In which account is the job running and does the account has backup operator privilege to those failed db's?
backup job sometimes fails
We have a nightly job on a production server which backs up all databases
(about 90 on the server)
Sometimes it'll only backup some of them, yet it reports success.
Our proc to manage the process is below:
Any ideas on what we need to do to make it reliable ?
--
DECLARE @.DB_Name varchar(32)
DECLARE @.Backup_Path varchar(255)
DECLARE @.Backup_Name varchar(255)
DECLARE DB_Cursor CURSOR FOR SELECT NAME FROM sysdatabases
OPEN DB_Cursor
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF @.DB_Name <> 'tempdb' AND @.DB_Name <> 'model'
BEGIN
print '--<< ' + @.db_name + '
>>--'
SET @.Backup_Path = N'd:\sql2005backups\nightly\' + @.DB_Name + 'Daily' +
'.bak'
SET @.Backup_Name = @.DB_Name + N' backup'
BACKUP DATABASE @.DB_Name TO DISK = @.Backup_Path WITH INIT
print ''
END
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
END
Print "Finished backing up the databases"
CLOSE DB_cursor
DEALLOCATE DB_cursor
My suggestion is to look into a 3rd party package for reliable backups of business critical data....SQL 2005 just isn't there yet in this area.
Jeff
|||create a job with the above script and keep the script in step1 of the job and then in the advanced options set an output file so that the output will be written to a text file, which will be used for troubleshooting purposes..............in the step2 you can have the mail step......and see whats the output after the backup completes.......is this box with sql 2005 sp1? if yes better go to SP2 as there are few bugs which are fixed in sp2.........also try to go with maintenance plan and see whats the result if the above option fails....|||Hi
Thanks for this
We already write the output to a file - it doesn't contain any errors or anything unusual - most strange...
The box is running SQL 2005 sp2.
I could go and buy something like Red-gate backup - but I don't see why I should have to ! Most frustrating..
thanks
Bruce
|||You don't need a third party solution - SQL native backups were fine and have for years. Third party solutions are the ones that tend to be a bit more problematic. The only problem I can think of that Jeff would have been referring to is maintenance plans. The problem is with maintenance plans, not SQL Server backups.
I'm curious - you are using both single quotes as well as double quotes for print statements? Is that the actual script you are using? What is in the output file? Does it have the name of the database that are skipped or not? What is in the error log? Have you tried running a server side trace during the times you run the backups to see what is actually being executed?
-Sue
|||Hi Sue
Thanks for replying..
The line with the double-quotes we ended up commenting out.
I also put the backup statement in a 'try catch' as follows below and there was no error logged
No - it doesn't have the name of the databases that are skipped - it just seems to exit without logging any errors - and it's not consistent - some nights it gets to the end.
There is nothing logged in the error logs.... No I haven't tried running a server side trace..
thanks, Bruce.
DECLARE @.DB_Name varchar(32)
DECLARE @.Backup_Path varchar(255)
DECLARE @.Backup_Name varchar(255)
DECLARE DB_Cursor CURSOR FOR SELECT NAME FROM sysdatabases order by name
OPEN DB_Cursor
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF @.DB_Name <> 'tempdb' AND @.DB_Name <> 'model'
BEGIN
print '--<< ' + @.db_name + ' >>--'
SET @.Backup_Path = N'd:\sql2005backups\nightly\' + @.DB_Name + 'Daily' + '.bak'
SET @.Backup_Name = @.DB_Name + N' backup'
BEGIN TRY
BACKUP DATABASE @.DB_Name TO DISK = @.Backup_Path WITH INIT ;
END TRY
BEGIN CATCH
Print 'Error -- ' + ERROR_MESSAGE();
END CATCH;
print ''
END
FETCH NEXT FROM DB_Cursor INTO @.DB_Name
END
CLOSE DB_cursor
DEALLOCATE DB_cursor
print 'Finished backing up'
|||So you need to run a trace during the backups (and for a time prior to them starting) to see more of what is going on. You'll also want to look at the logs prior to and during the backups.
-Sue
|||Bruce,
I too have something like this. I noticed that this happens when you have many databases needs to be backed up.
What we did here is to split this backup jobs into multiple steps. Each Job will backup few databases may be 50.
Try this and let me know.
Thanks
Shilpi
|||Can you check whether the existing backup file is in use? If possible alter the script to append date at the end of backup filename. Since we are backingup nearly 88 databases but didnt find any issues.In which account is the job running and does the account has backup operator privilege to those failed db's?
Backup job Fails every time:
I have a scheduled job on my production server which always fails. When I
see the job history step details I can see 100 % backedup and along with
that I receive error
[SQLSTATE 01000] (Message 3211) Processed 1 pages for database 'SLNKMIL',
file 'SLNKMIL_Log' on file 1. [SQLSTATE 01000] (Message 4035) BACKUP
DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The
step failed.
Pl, guide me. Job fail isn't affordable on my production database.
I sincerly thank you!
S.Lakshminarayanan.
Message posted via http://www.sqlmonster.com
Can you try issuing a BACKUP DATABASE statement via T-SQL through Query
Analyzer? It would be helpful to see the errors (if there are any). Before
running the backup make sure that you have results set to text.
The syntax is easy enough:
BACKUP DATABASE SLNKMIL TO DISK = 'x:\SLNKMIL.bak' WITH INIT
Keith
"lakshminarayan iyer via SQLMonster.com" <forum@.SQLMonster.com> wrote in
message news:67ccca76be724649be8629b2da37796a@.SQLMonster.c om...
> Dear Friends!
> I have a scheduled job on my production server which always fails. When I
> see the job history step details I can see 100 % backedup and along with
> that I receive error
> [SQLSTATE 01000] (Message 3211) Processed 1 pages for database
'SLNKMIL',
> file 'SLNKMIL_Log' on file 1. [SQLSTATE 01000] (Message 4035) BACKUP
> DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The
> step failed.
> Pl, guide me. Job fail isn't affordable on my production database.
> I sincerly thank you!
> S.Lakshminarayanan.
> --
> Message posted via http://www.sqlmonster.com
|||Is the database in Simple recovery mode? If so you can not do a log backup.
Andrew J. Kelly SQL MVP
"lakshminarayan iyer via SQLMonster.com" <forum@.SQLMonster.com> wrote in
message news:67ccca76be724649be8629b2da37796a@.SQLMonster.c om...
> Dear Friends!
> I have a scheduled job on my production server which always fails. When I
> see the job history step details I can see 100 % backedup and along with
> that I receive error
> [SQLSTATE 01000] (Message 3211) Processed 1 pages for database 'SLNKMIL',
> file 'SLNKMIL_Log' on file 1. [SQLSTATE 01000] (Message 4035) BACKUP
> DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The
> step failed.
> Pl, guide me. Job fail isn't affordable on my production database.
> I sincerly thank you!
> S.Lakshminarayanan.
> --
> Message posted via http://www.sqlmonster.com