Showing posts with label nightly. Show all posts
Showing posts with label nightly. Show all posts

Thursday, March 29, 2012

Backup strategy

Hi,

In my current organisation they are using SQL Server.

They are using TSM (Tivoli Storage Manager) to back up the server on a nightly base.

However I feel that this is not the correct way. Suppose I need some data back, I call technical support and they would restore the server. If another user made some changes to another database that day, he would lose his changes.

Of course they could restore a file but I am not sure if this is correctly. What will happen to the transaction log for example ?

My idea is that they should backup the database using the normal sql backup commando, dump the data to a folder and backup that folder.

Any suggestions please ?

Constantijn Enders

TSM has it's own way of running backups. It even uses the SQL Server APIs to do so. No need to worry about it. When in doubt, test.|||

Great, thanks a lot

CE

|||

Tivoli is a great product, just make sure you understand how to use it properly. Set up a test lab and practice, practice, practice restores.

Sunday, March 25, 2012

backup speed SQL 2000

I'm running a manually written nightly backup script on all dbs on a
server. it's a dev server FYI.
the script does the following for all databases:
dbcc checkdb
dbcc dbreindex (on all relevant tables) -- this is done once a week
only
backup transaction with no_log
backup database
now... the duration for this is around 2 hours, given the number &
size of the databases. however, on the night I do the dbcc dbreindex,
the duration drops to 5 minutes. i've added the dbcc dbreindex to run
on other nights, and yes it drops down to 5 minutes each time. next
time it runs without, back up to 2 hours.....
why?
if any other info is required, i will supply.
Specify an output file and check for error messages.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<bmwbase-newsgroup@.yahoo.com> wrote in message
news:1179959856.718711.314480@.x35g2000prf.googlegr oups.com...
> I'm running a manually written nightly backup script on all dbs on a
> server. it's a dev server FYI.
> the script does the following for all databases:
> dbcc checkdb
> dbcc dbreindex (on all relevant tables) -- this is done once a week
> only
> backup transaction with no_log
> backup database
> now... the duration for this is around 2 hours, given the number &
> size of the databases. however, on the night I do the dbcc dbreindex,
> the duration drops to 5 minutes. i've added the dbcc dbreindex to run
> on other nights, and yes it drops down to 5 minutes each time. next
> time it runs without, back up to 2 hours.....
> why?
> if any other info is required, i will supply.
>

backup speed SQL 2000

I'm running a manually written nightly backup script on all dbs on a
server. it's a dev server FYI.
the script does the following for all databases:
dbcc checkdb
dbcc dbreindex (on all relevant tables) -- this is done once a week
only
backup transaction with no_log
backup database
now... the duration for this is around 2 hours, given the number &
size of the databases. however, on the night I do the dbcc dbreindex,
the duration drops to 5 minutes. i've added the dbcc dbreindex to run
on other nights, and yes it drops down to 5 minutes each time. next
time it runs without, back up to 2 hours.....
why?
if any other info is required, i will supply.Specify an output file and check for error messages.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<bmwbase-newsgroup@.yahoo.com> wrote in message
news:1179959856.718711.314480@.x35g2000prf.googlegroups.com...
> I'm running a manually written nightly backup script on all dbs on a
> server. it's a dev server FYI.
> the script does the following for all databases:
> dbcc checkdb
> dbcc dbreindex (on all relevant tables) -- this is done once a week
> only
> backup transaction with no_log
> backup database
> now... the duration for this is around 2 hours, given the number &
> size of the databases. however, on the night I do the dbcc dbreindex,
> the duration drops to 5 minutes. i've added the dbcc dbreindex to run
> on other nights, and yes it drops down to 5 minutes each time. next
> time it runs without, back up to 2 hours.....
> why?
> if any other info is required, i will supply.
>sql

backup speed SQL 2000

I'm running a manually written nightly backup script on all dbs on a
server. it's a dev server FYI.
the script does the following for all databases:
dbcc checkdb
dbcc dbreindex (on all relevant tables) -- this is done once a week
only
backup transaction with no_log
backup database
now... the duration for this is around 2 hours, given the number &
size of the databases. however, on the night I do the dbcc dbreindex,
the duration drops to 5 minutes. i've added the dbcc dbreindex to run
on other nights, and yes it drops down to 5 minutes each time. next
time it runs without, back up to 2 hours.....
why?
if any other info is required, i will supply.Specify an output file and check for error messages.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<bmwbase-newsgroup@.yahoo.com> wrote in message
news:1179959856.718711.314480@.x35g2000prf.googlegroups.com...
> I'm running a manually written nightly backup script on all dbs on a
> server. it's a dev server FYI.
> the script does the following for all databases:
> dbcc checkdb
> dbcc dbreindex (on all relevant tables) -- this is done once a week
> only
> backup transaction with no_log
> backup database
> now... the duration for this is around 2 hours, given the number &
> size of the databases. however, on the night I do the dbcc dbreindex,
> the duration drops to 5 minutes. i've added the dbcc dbreindex to run
> on other nights, and yes it drops down to 5 minutes each time. next
> time it runs without, back up to 2 hours.....
> why?
> if any other info is required, i will supply.
>

Backup Size - Larger than db size

I have a database which I am backing up nightly ( after a log truncate, dbcc
checkdb ) and the .bak size is a lot larger than the actual database.
I am looking at the table space, and I think it might be the reserved space
also being backed up, I thought that only actual data was backed up.
Any pointers would be appreciated. Any more info require pls let me know.Are you perhaps by mistake doing append to the backup device? You can see wh
at backups are on a
backup device using RESTORE HEADERONLY.
Backup will copy all extents which are in use, so even if only one page are
used on an extent, the
whole extent will be included in the backup.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ben Rum" <bundyrum75@.yahoo.com> wrote in message news:eSbUf.14129$814.11725@.newsfe5-win.ntl
i.net...
>I have a database which I am backing up nightly ( after a log truncate, dbc
c checkdb ) and the .bak
>size is a lot larger than the actual database.
> I am looking at the table space, and I think it might be the reserved spac
e also being backed up,
> I thought that only actual data was backed up.
> Any pointers would be appreciated. Any more info require pls let me know.
>
>

Backup Size - Larger than db size

I have a database which I am backing up nightly ( after a log truncate, dbcc
checkdb ) and the .bak size is a lot larger than the actual database.
I am looking at the table space, and I think it might be the reserved space
also being backed up, I thought that only actual data was backed up.
Any pointers would be appreciated. Any more info require pls let me know.Are you perhaps by mistake doing append to the backup device? You can see what backups are on a
backup device using RESTORE HEADERONLY.
Backup will copy all extents which are in use, so even if only one page are used on an extent, the
whole extent will be included in the backup.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ben Rum" <bundyrum75@.yahoo.com> wrote in message news:eSbUf.14129$814.11725@.newsfe5-win.ntli.net...
>I have a database which I am backing up nightly ( after a log truncate, dbcc checkdb ) and the .bak
>size is a lot larger than the actual database.
> I am looking at the table space, and I think it might be the reserved space also being backed up,
> I thought that only actual data was backed up.
> Any pointers would be appreciated. Any more info require pls let me know.
>
>

Backup Size - Larger than db size

I have a database which I am backing up nightly ( after a log truncate, dbcc
checkdb ) and the .bak size is a lot larger than the actual database.
I am looking at the table space, and I think it might be the reserved space
also being backed up, I thought that only actual data was backed up.
Any pointers would be appreciated. Any more info require pls let me know.
Are you perhaps by mistake doing append to the backup device? You can see what backups are on a
backup device using RESTORE HEADERONLY.
Backup will copy all extents which are in use, so even if only one page are used on an extent, the
whole extent will be included in the backup.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ben Rum" <bundyrum75@.yahoo.com> wrote in message news:eSbUf.14129$814.11725@.newsfe5-win.ntli.net...
>I have a database which I am backing up nightly ( after a log truncate, dbcc checkdb ) and the .bak
>size is a lot larger than the actual database.
> I am looking at the table space, and I think it might be the reserved space also being backed up,
> I thought that only actual data was backed up.
> Any pointers would be appreciated. Any more info require pls let me know.
>
>
sql

Monday, March 19, 2012

Backup Question

I have some SQL 2000 and SQL 2005 servers as part of my network and I am
including the SQL databases are part of my nightly backup routines. How I d
o
this is set up SQL jobs to create .bak files early in the evening so that th
e
nightly backup "sweep" then includes them in the backup since the .mdf and
.ldf are open files. This work great but is it the best way? Does not
Volume Shadow Copy help me work around this issue so that I can backup open
.mdf and .ldf files? If so then how does that work since I'm not familiar
with it.
Basically, what does everyone else do as part of the backup rountines to
make sure SQL Server data gets backed up and what databases (outside of your
application databases) do you backup (master etc.)?
Thanks!
-Richard KHello,
There are a few of ways you can tackle this...
1. Use a third party tool that can back up the database directly to tape
like Backup Exec or Lite Speed etc.
2. Create a maintenance plan to back up the database at a schedule time to
your directory.
3. Online Back ups
4. Etc.
There are lots of good information on how to set up a maintenance plan in
the SQL Books online or check out
http://searchsqlserver.techtarget.c...1076630,00.html
I Hope this helps.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K|||Sorry I left out a few things..
If you are doing replication you will want to back up the Back up the
Publisher, Distributor, Subscriber(s) and Master DBs and all your SQL Users.
ESSAG" target="_blank">http://www.microsoft.com/technet/pr...x#
ESSAG
Also, depending how important your data is you may want to do Trans Logs in
between full backups.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K|||Richard K wrote:
> I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
do
> this is set up SQL jobs to create .bak files early in the evening so that
the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup ope
n
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of yo
ur
> application databases) do you backup (master etc.)?
I saw Christina's answers but decided to describe what I normally do.
1. The \Data directory is excluded from the file system (FS) backup
2. A management plan (or several plans if you need to do the transaction
log backups for some databases and not for others) puts all the backup
files into \Backup directory and deletes them after N days (depending on
the space capacities).
3. A file system backup writes to tapes those *.bak and *.trn files
created by the maintenance routine.
The timing and specifics depend on the business needs and probability of
disasters.
If the most probable disaster is a data loss caused by the
application/operator (i.e. the SQL Server is up and running but the data
was lost), you better have SQL backups ready and copy them to the tape
even 20+ hours after they are created.
If the most probable disaster is a hardware failure and the backups need
to be restored on a separate SQL Server, then it is better to schedule
the SQL backups prior to the FS or trigger the FS backup at the end of
the SQL backup.|||"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
>
Don't back up the .MDF and .LDF files.
Even with volume shadow copy you won't get a consistent backup.
Imagine this scenario. You backup MyDB.MDF at 11:00 PM.
By the time you get around to backing up MyDB.LDF at 11:15 PM, new
transactions have been completed in MyDB and some new ones have been
started, but not completed.
Now things crash.
You restore MyDB.MDF. Ok, all's good and fine. You restore MyDB.LDF.
Now you try to start up the DB. It can't. Why? Because MyDB.LDF has open
transactions that don't even exist in MyDB.MDF yet and MyDBF has open
transactions that MyDB.LDF things are completed.
So, yes, simply backup to disk as you seem to want to do. Simply figure out
how long it takes to do a full backup.
Generally I did full backups of my user databases 3 nights a week. And then
transaction log backups every 15 minutes.
WORST case scenario for recovery was to restore the most recent full backup
and then 288 or so transaction log backups.
Now, if I'm then backing them up to tape, well I simply make sure I keep at
least 3 days worth of tapes around.
Generally though I like to backup to a snap server or other NAS device and
keep them there for a week (with tape backups as desired). This makes
recovery even faster.

> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
I backed up the system databases daily since they're small and generally can
only have simple recovery mode, so to capture changes, I wanted to make sure
we had a fairly recent copy.

> Thanks!
> -Richard K
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Backup Question

I have some SQL 2000 and SQL 2005 servers as part of my network and I am
including the SQL databases are part of my nightly backup routines. How I do
this is set up SQL jobs to create .bak files early in the evening so that the
nightly backup "sweep" then includes them in the backup since the .mdf and
..ldf are open files. This work great but is it the best way? Does not
Volume Shadow Copy help me work around this issue so that I can backup open
..mdf and .ldf files? If so then how does that work since I'm not familiar
with it.
Basically, what does everyone else do as part of the backup rountines to
make sure SQL Server data gets backed up and what databases (outside of your
application databases) do you backup (master etc.)?
Thanks!
-Richard K
Hello,
There are a few of ways you can tackle this...
1. Use a third party tool that can back up the database directly to tape
like Backup Exec or Lite Speed etc.
2. Create a maintenance plan to back up the database at a schedule time to
your directory.
3. Online Back ups
4. Etc.
There are lots of good information on how to set up a maintenance plan in
the SQL Books online or check out
http://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1076630,00.html
I Hope this helps.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K
|||Sorry I left out a few things..
If you are doing replication you will want to back up the Back up the
Publisher, Distributor, Subscriber(s) and Master DBs and all your SQL Users.
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx#ESSAG
Also, depending how important your data is you may want to do Trans Logs in
between full backups.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K
|||Richard K wrote:
> I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I do
> this is set up SQL jobs to create .bak files early in the evening so that the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of your
> application databases) do you backup (master etc.)?
I saw Christina's answers but decided to describe what I normally do.
1. The \Data directory is excluded from the file system (FS) backup
2. A management plan (or several plans if you need to do the transaction
log backups for some databases and not for others) puts all the backup
files into \Backup directory and deletes them after N days (depending on
the space capacities).
3. A file system backup writes to tapes those *.bak and *.trn files
created by the maintenance routine.
The timing and specifics depend on the business needs and probability of
disasters.
If the most probable disaster is a data loss caused by the
application/operator (i.e. the SQL Server is up and running but the data
was lost), you better have SQL backups ready and copy them to the tape
even 20+ hours after they are created.
If the most probable disaster is a hardware failure and the backups need
to be restored on a separate SQL Server, then it is better to schedule
the SQL backups prior to the FS or trigger the FS backup at the end of
the SQL backup.
|||"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
>
Don't back up the .MDF and .LDF files.
Even with volume shadow copy you won't get a consistent backup.
Imagine this scenario. You backup MyDB.MDF at 11:00 PM.
By the time you get around to backing up MyDB.LDF at 11:15 PM, new
transactions have been completed in MyDB and some new ones have been
started, but not completed.
Now things crash.
You restore MyDB.MDF. Ok, all's good and fine. You restore MyDB.LDF.
Now you try to start up the DB. It can't. Why? Because MyDB.LDF has open
transactions that don't even exist in MyDB.MDF yet and MyDBF has open
transactions that MyDB.LDF things are completed.
So, yes, simply backup to disk as you seem to want to do. Simply figure out
how long it takes to do a full backup.
Generally I did full backups of my user databases 3 nights a week. And then
transaction log backups every 15 minutes.
WORST case scenario for recovery was to restore the most recent full backup
and then 288 or so transaction log backups.
Now, if I'm then backing them up to tape, well I simply make sure I keep at
least 3 days worth of tapes around.
Generally though I like to backup to a snap server or other NAS device and
keep them there for a week (with tape backups as desired). This makes
recovery even faster.

> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
I backed up the system databases daily since they're small and generally can
only have simple recovery mode, so to capture changes, I wanted to make sure
we had a fairly recent copy.

> Thanks!
> -Richard K
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Backup Question

I have some SQL 2000 and SQL 2005 servers as part of my network and I am
including the SQL databases are part of my nightly backup routines. How I do
this is set up SQL jobs to create .bak files early in the evening so that the
nightly backup "sweep" then includes them in the backup since the .mdf and
.ldf are open files. This work great but is it the best way? Does not
Volume Shadow Copy help me work around this issue so that I can backup open
.mdf and .ldf files? If so then how does that work since I'm not familiar
with it.
Basically, what does everyone else do as part of the backup rountines to
make sure SQL Server data gets backed up and what databases (outside of your
application databases) do you backup (master etc.)?
Thanks!
-Richard KHello,
There are a few of ways you can tackle this...
1. Use a third party tool that can back up the database directly to tape
like Backup Exec or Lite Speed etc.
2. Create a maintenance plan to back up the database at a schedule time to
your directory.
3. Online Back ups
4. Etc.
There are lots of good information on how to set up a maintenance plan in
the SQL Books online or check out
http://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1076630,00.html
I Hope this helps.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K|||Sorry I left out a few things..
If you are doing replication you will want to back up the Back up the
Publisher, Distributor, Subscriber(s) and Master DBs and all your SQL Users.
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx#ESSAG
Also, depending how important your data is you may want to do Trans Logs in
between full backups.
Thanks,
Christina
"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
> Thanks!
> -Richard K|||Richard K wrote:
> I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I do
> this is set up SQL jobs to create .bak files early in the evening so that the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of your
> application databases) do you backup (master etc.)?
I saw Christina's answers but decided to describe what I normally do.
1. The \Data directory is excluded from the file system (FS) backup
2. A management plan (or several plans if you need to do the transaction
log backups for some databases and not for others) puts all the backup
files into \Backup directory and deletes them after N days (depending on
the space capacities).
3. A file system backup writes to tapes those *.bak and *.trn files
created by the maintenance routine.
The timing and specifics depend on the business needs and probability of
disasters.
If the most probable disaster is a data loss caused by the
application/operator (i.e. the SQL Server is up and running but the data
was lost), you better have SQL backups ready and copy them to the tape
even 20+ hours after they are created.
If the most probable disaster is a hardware failure and the backups need
to be restored on a separate SQL Server, then it is better to schedule
the SQL backups prior to the FS or trigger the FS backup at the end of
the SQL backup.|||"Richard K" <RichardK@.discussions.microsoft.com> wrote in message
news:ABF5A430-0B76-454D-BEE8-F32863C53C11@.microsoft.com...
>I have some SQL 2000 and SQL 2005 servers as part of my network and I am
> including the SQL databases are part of my nightly backup routines. How I
> do
> this is set up SQL jobs to create .bak files early in the evening so that
> the
> nightly backup "sweep" then includes them in the backup since the .mdf and
> .ldf are open files. This work great but is it the best way? Does not
> Volume Shadow Copy help me work around this issue so that I can backup
> open
> .mdf and .ldf files? If so then how does that work since I'm not familiar
> with it.
>
Don't back up the .MDF and .LDF files.
Even with volume shadow copy you won't get a consistent backup.
Imagine this scenario. You backup MyDB.MDF at 11:00 PM.
By the time you get around to backing up MyDB.LDF at 11:15 PM, new
transactions have been completed in MyDB and some new ones have been
started, but not completed.
Now things crash.
You restore MyDB.MDF. Ok, all's good and fine. You restore MyDB.LDF.
Now you try to start up the DB. It can't. Why? Because MyDB.LDF has open
transactions that don't even exist in MyDB.MDF yet and MyDBF has open
transactions that MyDB.LDF things are completed.
So, yes, simply backup to disk as you seem to want to do. Simply figure out
how long it takes to do a full backup.
Generally I did full backups of my user databases 3 nights a week. And then
transaction log backups every 15 minutes.
WORST case scenario for recovery was to restore the most recent full backup
and then 288 or so transaction log backups.
Now, if I'm then backing them up to tape, well I simply make sure I keep at
least 3 days worth of tapes around.
Generally though I like to backup to a snap server or other NAS device and
keep them there for a week (with tape backups as desired). This makes
recovery even faster.
> Basically, what does everyone else do as part of the backup rountines to
> make sure SQL Server data gets backed up and what databases (outside of
> your
> application databases) do you backup (master etc.)?
I backed up the system databases daily since they're small and generally can
only have simple recovery mode, so to capture changes, I wanted to make sure
we had a fairly recent copy.
> Thanks!
> -Richard K
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Saturday, February 25, 2012

Backup of Log files

Dear All,
My nightly backups for log files are failing as there are
users still attached to the database being backup up.
What is the best stratergy for dealing with this ?
Do I
1) Make the DB single user ?
2) Have a script to kill all connections
3) Modify my backup plans
4) Some other
Any help here would be greatly appriciated.
PeterHi Peter,
Which version of SQL Server do you use? SQL Server 2000 and 7 (and probably
some earlier versions as well, but I don't have experience with them) allow
database and log backups when there are users connected to the database.
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Peter" <nospam@.thisemailaddress.co.uk> wrote in message
news:05ae01c35fe8$90bfb4c0$a101280a@.phx.gbl...
> Dear All,
> My nightly backups for log files are failing as there are
> users still attached to the database being backup up.
> What is the best stratergy for dealing with this ?
> Do I
> 1) Make the DB single user ?
> 2) Have a script to kill all connections
> 3) Modify my backup plans
> 4) Some other
> Any help here would be greatly appriciated.
> Peter|||Hello,
Thanks for both of your replies.
I am using SQL 2000. However the backups I am doing are
part of the database maintence plan backups.
I do know that you can back up log files when people are
connected (I do this every hour with our production
database) but once a week I perform a backup of all our
databases with all sort of integrity checks, re builds of
indexes and so on. Its these back ups the log file back
ups are failing on.
Thanks
Peter
>--Original Message--
>Dear All,
>My nightly backups for log files are failing as there are
>users still attached to the database being backup up.
>What is the best stratergy for dealing with this ?
>Do I
>1) Make the DB single user ?
>2) Have a script to kill all connections
>3) Modify my backup plans
>4) Some other
>Any help here would be greatly appriciated.
>Peter
>.
>|||How do you know that they are failing because users are attached? Where are
you getting these error messages from ?
What is the exact message from the Maintenance plan history ?
--
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Peter" <nospam@.thisemailaddress.co.uk> wrote in message
news:060601c35fee$5e973990$a101280a@.phx.gbl...
> Hello,
> Thanks for both of your replies.
> I am using SQL 2000. However the backups I am doing are
> part of the database maintence plan backups.
> I do know that you can back up log files when people are
> connected (I do this every hour with our production
> database) but once a week I perform a backup of all our
> databases with all sort of integrity checks, re builds of
> indexes and so on. Its these back ups the log file back
> ups are failing on.
> Thanks
> Peter
> >--Original Message--
> >Dear All,
> >
> >My nightly backups for log files are failing as there are
> >users still attached to the database being backup up.
> >
> >What is the best stratergy for dealing with this ?
> >
> >Do I
> >1) Make the DB single user ?
> >2) Have a script to kill all connections
> >3) Modify my backup plans
> >4) Some other
> >
> >Any help here would be greatly appriciated.
> >
> >Peter
> >.
> >

Thursday, February 16, 2012

backup jobs not runing on mssql7

Hi there,
I have a mssql-7 and 2/5 dbs get backed up nightly through
the scheduled backup jobs. 3 dbs keep failing at nights
and if I run the job manually. I can manually backup the
DBs through ALL TASKS..BACKUP DATABASE.
I've Checked:
SP-4
service running
sql agent running as admin
Job enabled
MDAC (latest)
jobs are 15mins apart
Any suggestions are appriciated.
ThanXHave you checked the logs and Agent history? What is the error that gets
produced?
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
> Hi there,
> I have a mssql-7 and 2/5 dbs get backed up nightly through
> the scheduled backup jobs. 3 dbs keep failing at nights
> and if I run the job manually. I can manually backup the
> DBs through ALL TASKS..BACKUP DATABASE.
> I've Checked:
> SP-4
> service running
> sql agent running as admin
> Job enabled
> MDAC (latest)
> jobs are 15mins apart
> Any suggestions are appriciated.
> ThanX
>|||Andrew,
I have cheched the agent log and its clean! and the server
log doesn't mention anything regarding the job failure.
ThanX
>--Original Message--
>Have you checked the logs and Agent history? What is the
error that gets
>produced?
>--
>Andrew J. Kelly SQL MVP
>
>"Emil" <anonymous@.discussions.microsoft.com> wrote in
message
>news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
through[vbcol=seagreen]
>
>.
>|||What about the Job History? Right click on thjob in EM and choose Show
History. Then check the checkbox labeled Show Details and see what that
says.
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:f29b01c43dad$56d3bc90$a601280a@.phx.gbl...[vbcol=seagreen]
> Andrew,
> I have cheched the agent log and its clean! and the server
> log doesn't mention anything regarding the job failure.
> ThanX
> error that gets
> message
> through

Monday, February 13, 2012

backup jobs not runing on mssql7

Hi there,
I have a mssql-7 and 2/5 dbs get backed up nightly through
the scheduled backup jobs. 3 dbs keep failing at nights
and if I run the job manually. I can manually backup the
DBs through ALL TASKS..BACKUP DATABASE.
I've Checked:
SP-4
service running
sql agent running as admin
Job enabled
MDAC (latest)
jobs are 15mins apart
Any suggestions are appriciated.
ThanX
Have you checked the logs and Agent history? What is the error that gets
produced?
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
> Hi there,
> I have a mssql-7 and 2/5 dbs get backed up nightly through
> the scheduled backup jobs. 3 dbs keep failing at nights
> and if I run the job manually. I can manually backup the
> DBs through ALL TASKS..BACKUP DATABASE.
> I've Checked:
> SP-4
> service running
> sql agent running as admin
> Job enabled
> MDAC (latest)
> jobs are 15mins apart
> Any suggestions are appriciated.
> ThanX
>
|||Andrew,
I have cheched the agent log and its clean! and the server
log doesn't mention anything regarding the job failure.
ThanX
>--Original Message--
>Have you checked the logs and Agent history? What is the
error that gets
>produced?
>--
>Andrew J. Kelly SQL MVP
>
>"Emil" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
through
>
>.
>
|||What about the Job History? Right click on thjob in EM and choose Show
History. Then check the checkbox labeled Show Details and see what that
says.
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:f29b01c43dad$56d3bc90$a601280a@.phx.gbl...[vbcol=seagreen]
> Andrew,
> I have cheched the agent log and its clean! and the server
> log doesn't mention anything regarding the job failure.
> ThanX
> error that gets
> message
> through

backup jobs not runing on mssql7

Hi there,
I have a mssql-7 and 2/5 dbs get backed up nightly through
the scheduled backup jobs. 3 dbs keep failing at nights
and if I run the job manually. I can manually backup the
DBs through ALL TASKS..BACKUP DATABASE.
I've Checked:
SP-4
service running
sql agent running as admin
Job enabled
MDAC (latest)
jobs are 15mins apart
Any suggestions are appriciated.
ThanXHave you checked the logs and Agent history? What is the error that gets
produced?
--
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
> Hi there,
> I have a mssql-7 and 2/5 dbs get backed up nightly through
> the scheduled backup jobs. 3 dbs keep failing at nights
> and if I run the job manually. I can manually backup the
> DBs through ALL TASKS..BACKUP DATABASE.
> I've Checked:
> SP-4
> service running
> sql agent running as admin
> Job enabled
> MDAC (latest)
> jobs are 15mins apart
> Any suggestions are appriciated.
> ThanX
>|||Andrew,
I have cheched the agent log and its clean! and the server
log doesn't mention anything regarding the job failure.
ThanX
>--Original Message--
>Have you checked the logs and Agent history? What is the
error that gets
>produced?
>--
>Andrew J. Kelly SQL MVP
>
>"Emil" <anonymous@.discussions.microsoft.com> wrote in
message
>news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
>> Hi there,
>> I have a mssql-7 and 2/5 dbs get backed up nightly
through
>> the scheduled backup jobs. 3 dbs keep failing at nights
>> and if I run the job manually. I can manually backup the
>> DBs through ALL TASKS..BACKUP DATABASE.
>> I've Checked:
>> SP-4
>> service running
>> sql agent running as admin
>> Job enabled
>> MDAC (latest)
>> jobs are 15mins apart
>> Any suggestions are appriciated.
>> ThanX
>>
>
>.
>|||What about the Job History? Right click on thjob in EM and choose Show
History. Then check the checkbox labeled Show Details and see what that
says.
--
Andrew J. Kelly SQL MVP
"Emil" <anonymous@.discussions.microsoft.com> wrote in message
news:f29b01c43dad$56d3bc90$a601280a@.phx.gbl...
> Andrew,
> I have cheched the agent log and its clean! and the server
> log doesn't mention anything regarding the job failure.
> ThanX
> >--Original Message--
> >Have you checked the logs and Agent history? What is the
> error that gets
> >produced?
> >
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"Emil" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:ed5901c43d33$cbb41660$a101280a@.phx.gbl...
> >> Hi there,
> >> I have a mssql-7 and 2/5 dbs get backed up nightly
> through
> >> the scheduled backup jobs. 3 dbs keep failing at nights
> >> and if I run the job manually. I can manually backup the
> >> DBs through ALL TASKS..BACKUP DATABASE.
> >>
> >> I've Checked:
> >> SP-4
> >> service running
> >> sql agent running as admin
> >> Job enabled
> >> MDAC (latest)
> >> jobs are 15mins apart
> >>
> >> Any suggestions are appriciated.
> >> ThanX
> >>
> >>
> >
> >
> >.
> >

backup job sometimes fails

Hi

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

Hi

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 can't remove old .BAK from disk

Hello,
I have a full database backup job that I run nightly on large database. The
database size is approx 37 GB. This job was created using the maintenance
plan wizard in Enterprise Manager. The maintenance plan is set up to retain 1
days worth of .BAK files on the server.
My problem is that occasionally(not all or the time) this backup job fails.
After taking a closer look I found that the database is actually being backed
up properly but the job fails because it is not able to delete the old backup
from the previous day. This can cause the disk drive to fill to capacity if
not monitored closely.
I have other database backup jobs that were created using maintenance plans
that work just fine.
Is there a reason why this database backup job is sometimes unable to delete
old backup files?
This has been causing me headaches for some time and I'd appreciate any
feedback you may have...
Thanks,
John
Could you please explain how do you delete the old backup file?
Are you using VB Scripts,...?
Ed
"John P" wrote:

> Hello,
> I have a full database backup job that I run nightly on large database. The
> database size is approx 37 GB. This job was created using the maintenance
> plan wizard in Enterprise Manager. The maintenance plan is set up to retain 1
> days worth of .BAK files on the server.
> My problem is that occasionally(not all or the time) this backup job fails.
> After taking a closer look I found that the database is actually being backed
> up properly but the job fails because it is not able to delete the old backup
> from the previous day. This can cause the disk drive to fill to capacity if
> not monitored closely.
> I have other database backup jobs that were created using maintenance plans
> that work just fine.
> Is there a reason why this database backup job is sometimes unable to delete
> old backup files?
> This has been causing me headaches for some time and I'd appreciate any
> feedback you may have...
> Thanks,
> John
|||Get rid of the maint plan and code it yourself. You only keep 1 copy so
you can just delete it before the backup.
It would be quicker to write the job than to have posted your question
.
I assume you are copying the backup somewhere otherwise if the backup
fails or is corrupt you are left without a backup and can lose the
database.
I try to keep at least 3 backups on disk and will zip them if they are
large.
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||Check your scheduling. Chances are, the Tape Backup client you are using on
this server or the Anti-Virus software is running scheduled jobs around the
same time as your disk database backup. All of these task try and need to
gain exclusive access to the files; so, it is better to have their
respective schedules staggard.
You probably see the problem against this database more often than the
others because of its size: the larger the file the longer the duration so
the higher the probability that there will be a conflict.
Sincerely,
Anthony Thomas

"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:836CA9D0-E58B-49E6-A537-F4208EF376B2@.microsoft.com...
Could you please explain how do you delete the old backup file?
Are you using VB Scripts,...?
Ed
"John P" wrote:

> Hello,
> I have a full database backup job that I run nightly on large database.
The
> database size is approx 37 GB. This job was created using the maintenance
> plan wizard in Enterprise Manager. The maintenance plan is set up to
retain 1
> days worth of .BAK files on the server.
> My problem is that occasionally(not all or the time) this backup job
fails.
> After taking a closer look I found that the database is actually being
backed
> up properly but the job fails because it is not able to delete the old
backup
> from the previous day. This can cause the disk drive to fill to capacity
if
> not monitored closely.
> I have other database backup jobs that were created using maintenance
plans
> that work just fine.
> Is there a reason why this database backup job is sometimes unable to
delete
> old backup files?
> This has been causing me headaches for some time and I'd appreciate any
> feedback you may have...
> Thanks,
> John
|||"Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
news:%23v0oMCi2EHA.1392@.tk2msftngp13.phx.gbl...
> Get rid of the maint plan and code it yourself. You only keep 1 copy so
> you can just delete it before the backup.
>
Umm, can I recommend deleting it AFTER a successful backup.
Otherwise you risk deleting your one good backup and having the new one
fail. :-)

> It would be quicker to write the job than to have posted your question
> .
> I assume you are copying the backup somewhere otherwise if the backup
> fails or is corrupt you are left without a backup and can lose the
> database.
> I try to keep at least 3 backups on disk and will zip them if they are
> large.
> Nigel Rivett
> www.nigelrivett.net
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!

backup job can't remove old .BAK from disk

Hello,
I have a full database backup job that I run nightly on large database. The
database size is approx 37 GB. This job was created using the maintenance
plan wizard in Enterprise Manager. The maintenance plan is set up to retain 1
days worth of .BAK files on the server.
My problem is that occasionally(not all or the time) this backup job fails.
After taking a closer look I found that the database is actually being backed
up properly but the job fails because it is not able to delete the old backup
from the previous day. This can cause the disk drive to fill to capacity if
not monitored closely.
I have other database backup jobs that were created using maintenance plans
that work just fine.
Is there a reason why this database backup job is sometimes unable to delete
old backup files?
This has been causing me headaches for some time and I'd appreciate any
feedback you may have...
Thanks,
JohnCould you please explain how do you delete the old backup file?
Are you using VB Scripts,...?
Ed
"John P" wrote:
> Hello,
> I have a full database backup job that I run nightly on large database. The
> database size is approx 37 GB. This job was created using the maintenance
> plan wizard in Enterprise Manager. The maintenance plan is set up to retain 1
> days worth of .BAK files on the server.
> My problem is that occasionally(not all or the time) this backup job fails.
> After taking a closer look I found that the database is actually being backed
> up properly but the job fails because it is not able to delete the old backup
> from the previous day. This can cause the disk drive to fill to capacity if
> not monitored closely.
> I have other database backup jobs that were created using maintenance plans
> that work just fine.
> Is there a reason why this database backup job is sometimes unable to delete
> old backup files?
> This has been causing me headaches for some time and I'd appreciate any
> feedback you may have...
> Thanks,
> John|||Check your scheduling. Chances are, the Tape Backup client you are using on
this server or the Anti-Virus software is running scheduled jobs around the
same time as your disk database backup. All of these task try and need to
gain exclusive access to the files; so, it is better to have their
respective schedules staggard.
You probably see the problem against this database more often than the
others because of its size: the larger the file the longer the duration so
the higher the probability that there will be a conflict.
Sincerely,
Anthony Thomas
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:836CA9D0-E58B-49E6-A537-F4208EF376B2@.microsoft.com...
Could you please explain how do you delete the old backup file?
Are you using VB Scripts,...?
Ed
"John P" wrote:
> Hello,
> I have a full database backup job that I run nightly on large database.
The
> database size is approx 37 GB. This job was created using the maintenance
> plan wizard in Enterprise Manager. The maintenance plan is set up to
retain 1
> days worth of .BAK files on the server.
> My problem is that occasionally(not all or the time) this backup job
fails.
> After taking a closer look I found that the database is actually being
backed
> up properly but the job fails because it is not able to delete the old
backup
> from the previous day. This can cause the disk drive to fill to capacity
if
> not monitored closely.
> I have other database backup jobs that were created using maintenance
plans
> that work just fine.
> Is there a reason why this database backup job is sometimes unable to
delete
> old backup files?
> This has been causing me headaches for some time and I'd appreciate any
> feedback you may have...
> Thanks,
> John|||I have a similar situation where my backup area can only
hold one backup file. I use a two step job and avoid the
Maintenance Plan wizard. The first step uses xp_cmdshell
to delete the previous day's backup file, the second backs
up the database with the 'backup database x to disk ='
command. Later in the evening my backup folder is copied
to tape. I build the date into the backup file name. So
I have to create a variable with the delete command and
path and correct file name for xp_cmdshell.
>--Original Message--
>Hello,
>I have a full database backup job that I run nightly on
large database. The
>database size is approx 37 GB. This job was created using
the maintenance
>plan wizard in Enterprise Manager. The maintenance plan
is set up to retain 1
>days worth of .BAK files on the server.
>My problem is that occasionally(not all or the time) this
backup job fails.
>After taking a closer look I found that the database is
actually being backed
>up properly but the job fails because it is not able to
delete the old backup
>from the previous day. This can cause the disk drive to
fill to capacity if
>not monitored closely.
>I have other database backup jobs that were created using
maintenance plans
>that work just fine.
>Is there a reason why this database backup job is
sometimes unable to delete
>old backup files?
>This has been causing me headaches for some time and I'd
appreciate any
>feedback you may have...
>Thanks,
>John
>.
>|||We have a space problem, but more because of our Storage Administration
team.
The default behaviour of the Maintenance Plans is to backup up and then
verify each database in the plan. Only after all backups are completed,
without error, the file delete portion runs for yesterday's backup. So, you
need space for at least 2 Full backups and any retained transaction log
backups in between.
The way we've coded it is to go ahead and set the Maintenance Plans, but
then code another job that runs several times per day checking the Archive
Bit on the prior backup files. Whenever the tape client runs, it will reset
this bit allowing our job to remove it. This reduces our space requirements
to just 1 set of Full backups and intra-day transaction log backups.
Also, we write our backups to dedicated disk partitions that are compressed.
You might also consider something like SQL Litespeed, which further
compresses the database backup files but integrates nicely withing the
Maintenance Plans already created.
Hope this helps.
Sincerely,
Anthony Thomas
"randy" <randydoub@.yahoo.com> wrote in message
news:1beb01c4dc68$9f66cb00$a301280a@.phx.gbl...
I have a similar situation where my backup area can only
hold one backup file. I use a two step job and avoid the
Maintenance Plan wizard. The first step uses xp_cmdshell
to delete the previous day's backup file, the second backs
up the database with the 'backup database x to disk ='
command. Later in the evening my backup folder is copied
to tape. I build the date into the backup file name. So
I have to create a variable with the delete command and
path and correct file name for xp_cmdshell.
>--Original Message--
>Hello,
>I have a full database backup job that I run nightly on
large database. The
>database size is approx 37 GB. This job was created using
the maintenance
>plan wizard in Enterprise Manager. The maintenance plan
is set up to retain 1
>days worth of .BAK files on the server.
>My problem is that occasionally(not all or the time) this
backup job fails.
>After taking a closer look I found that the database is
actually being backed
>up properly but the job fails because it is not able to
delete the old backup
>from the previous day. This can cause the disk drive to
fill to capacity if
>not monitored closely.
>I have other database backup jobs that were created using
maintenance plans
>that work just fine.
>Is there a reason why this database backup job is
sometimes unable to delete
>old backup files?
>This has been causing me headaches for some time and I'd
appreciate any
>feedback you may have...
>Thanks,
>John
>.
>