473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

backup advise

Hi
We usae Sql2000.
I'm setting up backups jobs and need advise.
When I run a backup of a database, does it automatically clean out the
transaction log ? For a complete backup ? for a differential backup ?
When would it be best to run a shrinkdatabase command ? Why would I want
to run the shrinkdatabase ?
Thnaks
David Greenberg
Dec 31 '07 #1
3 1467
David Greenberg (da*****@iba.or g.il) writes:
We usae Sql2000.
I'm setting up backups jobs and need advise.
When I run a backup of a database, does it automatically clean out the
transaction log ? For a complete backup ? for a differential backup ?
No. Backing up the database and backing up the transaction log are two
separate operations.

Before you go ahead, determine what level of recovery you need. If the
database goes belly-up, do you need restore to a point in time? Or would
you be content with restoring the most recent backup?

In the former case, you need to use full recovery and you need to back up
your transaction log regularly. In the latter case, you can go with simple
recovery and forget all about the transaction log. SQL Server will
automatically truncate the transaction log regularly so that only active
transctions remain.
When would it be best to run a shrinkdatabase command ? Why would I want
to run the shrinkdatabase ?
Most of the time you don't want to. Shrinking the database is a very
exceptional operation. This article gives some insight about this:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 31 '07 #2
Erland Sommarskog wrote:
David Greenberg (da*****@iba.or g.il) writes:
>>We usae Sql2000.
I'm setting up backups jobs and need advise.
When I run a backup of a database, does it automatically clean out the
transaction log ? For a complete backup ? for a differential backup ?


No. Backing up the database and backing up the transaction log are two
separate operations.

Before you go ahead, determine what level of recovery you need. If the
database goes belly-up, do you need restore to a point in time? Or would
you be content with restoring the most recent backup?

In the former case, you need to use full recovery and you need to back up
your transaction log regularly. In the latter case, you can go with simple
recovery and forget all about the transaction log. SQL Server will
automatically truncate the transaction log regularly so that only active
transctions remain.

>>When would it be best to run a shrinkdatabase command ? Why would I want
to run the shrinkdatabase ?


Most of the time you don't want to. Shrinking the database is a very
exceptional operation. This article gives some insight about this:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp

So when does SqlServer decide to shrink the database automaticaly ? When
a backup is performed ?
Jan 1 '08 #3
David Greenberg (da*****@iba.or g.il) writes:
So when does SqlServer decide to shrink the database automaticaly ? When
a backup is performed ?
To have SQL Server automatically shrink a database, you have configure
the database to be in auto-shrink mode, which I strongly recommend against.
As I said, shrinking is something you should do only exceptionally, and
when you do, you want to have control over it.

If you are in AUTO_SHRINK mode, Books Online tells us this:

The database files are candidates for periodic shrinking.

Both data file and log files can be automatically shrunk. AUTO_SHRINK
reduces the size of the transaction log only if the database is set to
SIMPLE recovery model or if the log is backed up. When set to OFF, the
database files are not automatically shrunk during periodic checks for
unused space.

The AUTO_SHRINK option causes files to be shrunk when more than 25
percent of the file contains unused space. The file is shrunk to a size
where 25 percent of the file is unused space, or to the size of the
file when it was created, whichever is larger.

You cannot shrink a read-only database
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jan 1 '08 #4

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

Similar topics

5
7610
by: copernicus | last post by:
Hi, I have a 2 Tb data warehouse.I need a backup strategy as the current backup strategy(cold backup) is taking too long.Is it possible to do a incremental backups using RMAN ? I guess I have to put the database in archivelog mode for this to work.But it is going to generate a lot of archive if I put in archivelog mode. I am not sure how to proceed.Plz advise. Thanks,
12
2282
by: siliconmike | last post by:
How do I synchronize MySQL table data of my home PC with latest data from a remote server ? My home PC is on a very slow internet connection, so implementing replication will cause long time read lock on remote server, which is not desirable. What are the tools for manual sync of tables ? I'm running FreeBSD on my home PC.
3
1320
by: mark_drewersback | last post by:
Hi All Bit of a situation so hopefully someone can advise. I've a client who has a sql 2000 database that *unfortunately* hasn't had a backup procedure in place. Its been running for just over a year and on Monday it got, well, screwed. They have a 50 gig ldf file. Yes, 50 gig. Is it possible to put in place a database maintenance plan that will allow me to roll back to, say, last friday just from the ldf file?
7
3795
by: Claudio Lapidus | last post by:
Hello all I need to transfer a database installation from one host to another. I need to dump all users, databases, schemas, stored procedures, triggers, etc. but no actual data at all. What I try to achieve is a fresh clone ready to run. I tried pg_dump -s and pg_dumpall, but somewhere I'm missing something, so: what is the procedure to dump all database structure alone, and what is the proper reload procedure? TIA
6
3350
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API (no tablespace backups) the backup images is stored as a single backup object. Later I will be able to restore the complete database from this image and I will also be able to restore single tablespaces from this backup image as long as I...
2
1151
by: maxzsim via SQLMonster.com | last post by:
Hi , I am running SQL server 2000 sp3a and i have set up my database to be in "Full Recovery" mode. I am not able to understand if i have set anything wrong here : 1. Full database Backup - every weekend 2. Differential Backup - twice a day 3. Txn log backup - 4 times a day (4hrs apart)
3
2518
by: Konstantin Andreev | last post by:
Hello, everybody. I've spent a lot of time reading "DB2 Information Center" and Raul Chong's book "Understanding DB2. Learning Visually with Examples", but still unable to answer this simple question. I need to perform the full database backup for at least these two goals: - to restore data onto developers' database system. - to ensure disaster recovery
1
3493
by: Sumeet | last post by:
Hi All, I have taken an db2 v8.1 fp15 backup on AIX and want to restore it into a db2 v8.1 fp15 Solaris Box. If the backup was uncompressed, the cross-platform restore works without any issue. But for compressed backup images, since the decompression requires compression libraries, which I assume, is in native AIX binary code(and embedded into the image), it fails to restore the database. Could someone advise, if we can decompress the...
0
3240
by: coolatt | last post by:
hi all. I have already read the documentation for PostgreSQL Continuous Archiving and Point-In-Time Recovery (PITR) I want to know if it is possible to take regular base backup & use smaller number of WAL files for the recovery. Please advise if this is possible. thanks.
0
9594
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
10599
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...
1
10347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6863
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
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.