473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

AutoShrink Transaction Log File

Hello All,

I have been encountering trouble with a SQL Server 2000 Transaction
log file, mainly with the constant growth and lack of the autoshrink
option. Here are the details:
1.) OS is Windows 2000 server sp3
2.) SQL Server 2000 (Build 2195) sp3
3.) Database Recovery Mode is set to Full
4.) Maintenance Plan for "Transaction Log Backup" is set to remove
files older then 1hr.
5.) The "AutoShrink" option is on for the DB properties.

Also as part of the Maintenance plan the database in question is
backed up nightly. The problem is that the transaction log file has
grown so much that it was consuming all of the free space on the hard
drive so I then restricted the file growth. When all of the drive
space was consumed or the "database log file is full" message was
encountered I would run the following Query scripts to shrink the file
manually:
First – Backup Log <database name> With Truncate_Only
Second – DBCC Shrinkfile (<database name>_log, 200)
Which brings the transaction log file down to 200mbs. I need to
automate this so that I don't have to keep babysitting this database
or manually shrinking the log file.
Jul 20 '05 #1
3 30105

"Bucfan1" <su*****@comcomsystems.com> wrote in message
news:c2**************************@posting.google.c om...
Hello All,

I have been encountering trouble with a SQL Server 2000 Transaction
log file, mainly with the constant growth and lack of the autoshrink
option. Here are the details:
1.) OS is Windows 2000 server sp3
2.) SQL Server 2000 (Build 2195) sp3
3.) Database Recovery Mode is set to Full
4.) Maintenance Plan for "Transaction Log Backup" is set to remove
files older then 1hr.
5.) The "AutoShrink" option is on for the DB properties.

Also as part of the Maintenance plan the database in question is
backed up nightly. The problem is that the transaction log file has
grown so much that it was consuming all of the free space on the hard
drive so I then restricted the file growth. When all of the drive
space was consumed or the "database log file is full" message was
encountered I would run the following Query scripts to shrink the file
manually:
First - Backup Log <database name> With Truncate_Only
Second - DBCC Shrinkfile (<database name>_log, 200)
Which brings the transaction log file down to 200mbs. I need to
automate this so that I don't have to keep babysitting this database
or manually shrinking the log file.


It's not clear from your post how often you back up the transaction log. You
mention a database backup every night, but not a log backup. Only log
backups will free up space in the log - a full backup will not. When you
backup the log, the space will be reused for future transactions, or the log
will shrink if the space isn't needed. See "Transaction Log Backups" in
Books Online for more information.

Simon
Jul 20 '05 #2
[posted and mailed, please reply in news]

Bucfan1 (su*****@comcomsystems.com) writes:
I have been encountering trouble with a SQL Server 2000 Transaction
log file, mainly with the constant growth and lack of the autoshrink
option. Here are the details:
1.) OS is Windows 2000 server sp3
2.) SQL Server 2000 (Build 2195) sp3
3.) Database Recovery Mode is set to Full
4.) Maintenance Plan for "Transaction Log Backup" is set to remove
files older then 1hr.
5.) The "AutoShrink" option is on for the DB properties.

Also as part of the Maintenance plan the database in question is
backed up nightly. The problem is that the transaction log file has
grown so much that it was consuming all of the free space on the hard
drive so I then restricted the file growth. When all of the drive
space was consumed or the "database log file is full" message was
encountered I would run the following Query scripts to shrink the file
manually:
First – Backup Log <database name> With Truncate_Only
Second – DBCC Shrinkfile (<database name>_log, 200)
Which brings the transaction log file down to 200mbs. I need to
automate this so that I don't have to keep babysitting this database
or manually shrinking the log file.


To add to Simon's reponse: if you don't care about the transaction log,
and you don't need up-to-the-point recovery, but it is always to sufficient
from the nightly backup, your best option is simply to switch to
simple recovery.

In any case, I would advice against setting up some automatic shrink from
what you describe above. If you shrink the log, it will autogrow, and
autogrow takes resources and slows down the system.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

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

"Bucfan1" <su*****@comcomsystems.com> wrote in message
news:c2**************************@posting.google.c om...
Hello All,

I have been encountering trouble with a SQL Server 2000 Transaction
log file, mainly with the constant growth and lack of the autoshrink
option. Here are the details:
1.) OS is Windows 2000 server sp3
2.) SQL Server 2000 (Build 2195) sp3
3.) Database Recovery Mode is set to Full
4.) Maintenance Plan for "Transaction Log Backup" is set to remove
files older then 1hr.
Remove what files?

I don't see a step here about actually performing a transaction log backup.

5.) The "AutoShrink" option is on for the DB properties.

Also as part of the Maintenance plan the database in question is
backed up nightly. The problem is that the transaction log file has
grown so much that it was consuming all of the free space on the hard
drive so I then restricted the file growth.
This to me indicates that transaction log backups are not occurring.
When all of the drive
space was consumed or the "database log file is full" message was
encountered I would run the following Query scripts to shrink the file
manually:
First - Backup Log <database name> With Truncate_Only
Second - DBCC Shrinkfile (<database name>_log, 200)
Which brings the transaction log file down to 200mbs. I need to
automate this so that I don't have to keep babysitting this database
or manually shrinking the log file.


Note, the minute you do a backup log with truncate_only, you break the
transaction log chain and lose a lot of your recovery opportunities.

Also, avoid where possible shrinking the file, it can ultimately lead to
file level fragmentation.

Jul 20 '05 #4

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

Similar topics

13
by: darkhorse | last post by:
Hi all, While doing a quite big "set of programs" for a university subject I've found myself in the middle of a problem someone surely has had before, so I'm looking for some help. At one...
10
by: TZoner | last post by:
1) Can one find the location of the 'Transaction Log' at: <Hard Disk>\Program Files\Microsoft SQL Server\MSSQL\Data\MyDb_Log.ldf? 2) Is it safe to delete it, as SQL will create a new Transaction...
1
by: Krzysztof Rozmus | last post by:
Hi, I have stored procedure (MS SQL Server 2000) which operates on around 600 000 rows (SELECT, UPDATE, INSERT) and executes in 5 minutes, when I put it in SQL transaction it slows down to...
16
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. ...
5
by: laststubborn | last post by:
Hi All, I have a dillema that I created 2 transaction file before I started to take log back. Now I changed my recovery model from simple to full. Do I still need to keep my second transaction...
0
by: vineetkumar | last post by:
dear all, i have a problem to maintain the Transaction Logging Mechanism in postgresql 8.1 so please send reply how i can maintain Rollback Segment, LogFiles, and every day transaction file . is...
0
by: Gerryteague | last post by:
Help My Transaction Log file is 180GB, my database file is 1GB, I am unable to backup the transaction file and I have now out of HD space. Can I delete the lof file and start again, or can I...
0
by: ramyass | last post by:
Hi all, I have SQL Server 2000 installed on my PC. A database has been created and i need to view the contents of LDF file. It would be great if any one of you let me know how to view the contents...
0
by: DanInTacoma | last post by:
We have a fairly straightforward maint plan on one of our servers (MSSQL 2K)...it backs up several DB's to a folder on another server (the one with the tape drive) so they can be archived to tape. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.