dbTalk Databases Forums  

backup advise

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss backup advise in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Greenberg
 
Posts: n/a

Default backup advise - 12-31-2007 , 02:35 AM






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

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: backup advise - 12-31-2007 , 03:19 AM






David Greenberg (davidgr (AT) iba (DOT) org.il) writes:
Quote:
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.

Quote:
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, esquel (AT) sommarskog (DOT) 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


Reply With Quote
  #3  
Old   
David Greenberg
 
Posts: n/a

Default Re: backup advise - 01-01-2008 , 03:33 AM



Erland Sommarskog wrote:

Quote:
David Greenberg (davidgr (AT) iba (DOT) org.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 ?


Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: backup advise - 01-01-2008 , 03:56 AM



David Greenberg (davidgr (AT) iba (DOT) org.il) writes:
Quote:
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, esquel (AT) sommarskog (DOT) 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.