Groups | Blog | Home
all groups > sql server new users > june 2006 >

sql server new users : SQL transaction logs question


tednov
6/14/2006 8:51:32 AM
Greetings

I have a SQL server that is used as a backup type of device. The server
is only accessed by other servers(exchange, docsopen, anti spam etc.),
not by the end users.

The typical full transaction log/low disk space errors are now becoming
more of a burden. I have a very basic weekly maintenance schedule that
I do which includes backing up the logs and shrinking the db. However I
do have one very large(60+ gig) Exchange SQL db. That particular log is
hovering around 35 gig and is danger of filling up the drive. However I
do not have a enough space to perform the backup of that log.

Short of hooking up a usb hd to the server what other avenues do I have?
I'm real tempted to delete the log(but not the db) and start from
scratch but I'd like to verify here first before doing so.

Ted Novak
TRA#5512
tednov
6/14/2006 9:35:40 AM
[quoted text, click to view]


Thank you for responding. Shoot, maybe I should have explained this a
bit better. I also should have explained that I'm a complete newbie to SQL.

The SQL server does get a nightly backup to tape but I was referring to
going into the SQL admin and using that to perform a backup of the
transaction logs. I thought in order for me to properly shrink the db I
have to backup the transaction log first?

Ted Novak
TRA#5512
Michael Epprecht [MSFT]
6/14/2006 4:25:06 PM
Hi

If you are only backing up the transaction log once a week, why do it? You
should either do it on a very regular basis (hourly or less), or set the
database recovery mode to 'Simple' and then you don't need to worry about
it.

Transaction log backups give you point in time recovery, but as you don't
back it up frequently, you loose out on it in case of a disaster.

The question you have to ask your self. "Can you loose all the data that
changed in the DB since the last full backup? If no, then implement very
frequent log backups. If yes, then go the 'simple' recovery route."

Books online has a lot of information on database recovery.

Regards
--
Mike

This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Steen Persson (DK)
6/16/2006 12:00:00 AM
[quoted text, click to view]

Hi Ted

Just "blindly" shrinking the logfile or database might not help you a
lot. If SQL server need that much space in the log, it will just grow
again. Do like Mike suggested and read up on Database Recovery and
BACKUP/RESTORE in Books On Line. That will give you a basic
understanding on how it works.
If a nightly full database backup is sufficient for your in terms of
recovery, then you can just as well do as Mike suggested and switch to
SIMPLE recovery mode. This will truncate your logfile at certain
thresholds and then the space can be reused. Just remember that
switching to simple recovery (or backing up the log regularly for that
matter..) will NOT necessarily prevent the logfile from growing. The log
will always have to be able to hold an active transaction so if a
transaction runs for a long time, the logfile might have to grow to
contain this - no matter what recovery model you've chosen or how often
you backup you log.


--
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
AddThis Social Bookmark Button