473,847 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Backup Plans and Locking Database

I run SQL Server 2000 and use thier database maintenance plans to
backup my databases. My questions is what happens if a change is being
made to a database table while a backup is running? Should I be locking
the databases before the backup begins?

Scenario:

1) Database Plan begins backup at 7:00 PM.
2) At 7:01 PM a web user updates their password while the backup is
taking place.
3) at 7:15 PM the backup is complete.

In this scenario, will the change/update made in step (2) be contained
within the backup?
On Another note, can anyone point me in the right direction for "Best
Practices" on establishing a Recovery Mode for a database? I have been
told to set it to "Simple" so the logs do consume a lot of disc space
and performance. The issue with this is I am not sure if I should be
maintaining a full transaction log. Our database only changes on a
monthly basis. The only "on going" updates that may take place is a
user changing their password. We also have other databases that change
often throughout the day. I assume after a transaction log has been
truncated, the amount of disk space it consumes is minimal? So please
any information or a kick in the right direction would be much
appreciated. Thanks.

Jul 23 '05 #1
2 2115
Matt (ma***********@ manning-napier.com) writes:
I run SQL Server 2000 and use thier database maintenance plans to
backup my databases. My questions is what happens if a change is being
made to a database table while a backup is running? Should I be locking
the databases before the backup begins?
No! The Backup routine is designed to give you a transaction-consistent
backup.
Scenario:

1) Database Plan begins backup at 7:00 PM.
2) At 7:01 PM a web user updates their password while the backup is
taking place.
3) at 7:15 PM the backup is complete.

In this scenario, will the change/update made in step (2) be contained
within the backup?
I think so, but to be honest, I have not memorized the fine print of
BACKUP, so I don't know for sure. Actually, it does not really matter if
that password change makes it to the backup or not. (Trivial proof: assume
the user changes is password at 19:16.)

What is important, is that while the backup is running, there is a
transaction running that updates the salaries of all employees with
2%. In the backup all employees all must either have the old salary
or all have the new salary. If you were to backup the database file
through the file system this could happen.
On Another note, can anyone point me in the right direction for "Best
Practices" on establishing a Recovery Mode for a database? I have been
told to set it to "Simple" so the logs do consume a lot of disc space
and performance. The issue with this is I am not sure if I should be
maintaining a full transaction log. Our database only changes on a
monthly basis. The only "on going" updates that may take place is a
user changing their password.
The main determine factor whether to use full or bulk-logged recovery
on one hand or simple recovery on the other is: what happens at a crash?
Are you content with restoring the most recent backup, or you need an
up-to-the point recovery to minimize data loss?

From your description, it sounds that simple is alright, assuming that
you take a full backup after the monthly update. If there is a crash,
all you could lose is a few newly changed passwords.
We also have other databases that change often throughout the day. I
assume after a transaction log has been truncated, the amount of disk
space it consumes is minimal? So please any information or a kick in the
right direction would be much appreciated. Thanks.


First, ir you truncate the transaction log without backing it up,
you lose your ability to the up-to-the-point recovery. Only do this
in an emergency.

Second, just truncating the transaction log does not conserve disk
space, unless the database is set to autoshrink (which is not a good
think to do). You will have to skrink it with DBCC SHRINKFILE. However,
it's little point in shrinking it, if it is to grow again. Better
leave it as it is, unless it has become horrendesouly big.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
Matt (ma***********@ manning-napier.com) writes:
I run SQL Server 2000 and use thier database maintenance plans to
backup my databases. My questions is what happens if a change is being
made to a database table while a backup is running? Should I be locking
the databases before the backup begins?
No! The Backup routine is designed to give you a transaction-consistent
backup.
Scenario:

1) Database Plan begins backup at 7:00 PM.
2) At 7:01 PM a web user updates their password while the backup is
taking place.
3) at 7:15 PM the backup is complete.

In this scenario, will the change/update made in step (2) be contained
within the backup?
I think so, but to be honest, I have not memorized the fine print of
BACKUP, so I don't know for sure. Actually, it does not really matter if
that password change makes it to the backup or not. (Trivial proof: assume
the user changes is password at 19:16.)

What is important, is that while the backup is running, there is a
transaction running that updates the salaries of all employees with
2%. In the backup all employees all must either have the old salary
or all have the new salary. If you were to backup the database file
through the file system this could happen.
On Another note, can anyone point me in the right direction for "Best
Practices" on establishing a Recovery Mode for a database? I have been
told to set it to "Simple" so the logs do consume a lot of disc space
and performance. The issue with this is I am not sure if I should be
maintaining a full transaction log. Our database only changes on a
monthly basis. The only "on going" updates that may take place is a
user changing their password.
The main determine factor whether to use full or bulk-logged recovery
on one hand or simple recovery on the other is: what happens at a crash?
Are you content with restoring the most recent backup, or you need an
up-to-the point recovery to minimize data loss?

From your description, it sounds that simple is alright, assuming that
you take a full backup after the monthly update. If there is a crash,
all you could lose is a few newly changed passwords.
We also have other databases that change often throughout the day. I
assume after a transaction log has been truncated, the amount of disk
space it consumes is minimal? So please any information or a kick in the
right direction would be much appreciated. Thanks.


First, ir you truncate the transaction log without backing it up,
you lose your ability to the up-to-the-point recovery. Only do this
in an emergency.

Second, just truncating the transaction log does not conserve disk
space, unless the database is set to autoshrink (which is not a good
think to do). You will have to skrink it with DBCC SHRINKFILE. However,
it's little point in shrinking it, if it is to grow again. Better
leave it as it is, unless it has become horrendesouly big.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

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

Similar topics

2
2001
by: jwbeaty | last post by:
Here's a weird one. I'm running SQL Server 7 and when I run a backup something weird happens. When I perform the backup via Enterprise Manager by right clicking on the database I want to backup, I click on OK but no progress blocks show up in the window showing you the status of the backup. The completion window pops up saying that the DB has been backed up. OK--Fine, maybe the backup is really quick. Then, through Explorer, I look...
6
3183
by: Iain Hosking | last post by:
I am running a SQL Server 2000 installation with several databases. Each database and log is backed-up using a maintenance plan. The scheduled maintance plan for the latest database does not run, but displays no error. There is no entry in the job history. The same thing happens when I try to run the individual jobs from Enterprise Manager. I've checked the database recovery model (full), the location of the backup files (same as the...
3
10591
by: bryja_klaudiusz[at]poczta[dot]fm | last post by:
Hi, How to automate database backup (MSDE server v8.0)? Is some free tool which can help on this or can I use some stored procedure? Plan: Complete - 1 per week Differential - 1 per day -- *Best regards,* Klaudiusz Bryja
9
9952
by: tech_guru | last post by:
Hello!! I am relatively new to SQL and am having a problem. I have taken over a SQL 2000 db that did not have any backup plans scheduled for it. I created a maintenance plan that backs up the database every night and another plan that backs up the system databases once a week. I ran both these jobs successfully, but when I created a third plan to backup the transaction log it fails with the following message: Executed as user: NT...
0
1128
by: Matt | last post by:
I run SQL Server 2000 and use thier database maintenance plans to backup my databases. My questions is what happens if a change is being made to a database table while a backup is running? Should I be locking the databases before the backup begins? Scenario: 1) Database Plan begins backup at 7:00 PM. 2) At 7:01 PM a web user updates their password while the backup is taking place.
2
3693
by: Trent | last post by:
Hello, all. I have the following production DB2 environment. DB2 8.1.4 (fp4) WG edition with 2 production databases on Windows 2003 standard edition. My first question is regard with locking. I found some escalations for X lock on some tables. How do I work out an appropriate MAXLOCK & LOCKTIMEOUT settings to optimize the lock escalation issue.
2
1185
by: David | last post by:
Hi, We are about to install MSSQL Server 2000, on a Windows XP Home Machine. However, we have servers we could set routine backups of files to be done to. What what be the best way of doing this? Is there functionality in SQL Server 2000, where we can say dump all data definitions, accounts, and data to files on this drive at regular intervals?
2
3019
by: David Gray | last post by:
Hi, SQL Server 2005 Standard (X64) edition. Have a database which has its log backed up every hour during the normal business day and each evening a full backup is performed. After two days we would like the the log backups to be automatically overwritten in the backup device , is this possible?
5
2723
by: aj | last post by:
SQL Server SP2 9.0.3042 64-bit I recently put my first SQL Server DB in production. In the "other" database that I use (not interested in any arguments), you can indicate the desired size of your transaction logs. When the current log reaches that size, it gets backed up (or whatever you have configured to happen). Certain events in the database might cause the logs to get prematurely "cut" at a particular time, but the logs are for...
0
9889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9732
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10652
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7058
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5723
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5914
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4535
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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

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