December 28, 2006 at 6:30 pm
We just upgraded from SQL 2000 to SQL 2005 3 weeks ago. We backup the databases nightly and the trans logs every 30 minutes during biz hours. With SQL 2000, the size of log backup files were managable ranging between tens MB to hundreds MB for about 30 databases. We are doing same thing with SQL 2005; trans logs are backed up every 30 minutes during biz hours. However the log backup files are now four, five times larger or more. For example one database when we had SQL 2000 had its log backup file less than 1 GB in size after the last log backup of the day. Now with SQL 2005 this same database has the log backup file reaches up to 10GB. Same acitivies everyday for the databases. Is there any thing you can thing of as the cause? Thanks.
December 28, 2006 at 9:29 pm
Is snapshot isolation level or mirroring is enabled?
MohammedU
Microsoft SQL Server MVP
December 28, 2006 at 11:14 pm
nope. All are default.
December 29, 2006 at 7:48 am
are you doing things in parallel now that you didn't do before? like large updates and reindexing at the same time?
December 29, 2006 at 9:34 am
There is only one thing different: the way we update data. We often need to update lookup tables. With SQL 2000 the data import-export tool let us drop and recreate the tables. With SQL 2005 we empty the tables first and import the new data. I am not sure how the developers do but usually they drop the FKs, delete the tables, import new data, and recreate the FKs. I suspect the transaction log grows when the tables are deleted (data deleted) but I can't explain why it didn't grow in SQL 2000.
December 29, 2006 at 10:49 am
have you tried truncating? I think delete causes a lot more data to be logged in the transaction log
December 29, 2006 at 11:54 am
Like SQL Noob recommended, if they went all the trouble to delete/disable the foreign keys they may as well should use TRUNCATE TABLE instead of delete. DELETE does generates *a lot* of log activity.
Cheers,
* Noel
December 29, 2006 at 3:08 pm
Truncate is not logged. I was just afraid it would break the LSN in the transaction log causing log restore failed. Even I did a test and was able to restore to the last log backup after a TRUNCATE but I am not at ease.
Thanks everyone.
December 29, 2006 at 4:32 pm
Truncate is minimally logged operation and it will not break LSN...
MohammedU
Microsoft SQL Server MVP
December 30, 2006 at 8:58 pm
What is the build of SQL Server?
Can you please check the log growth set for the database. There is a known issue with SQL Server 2005 where the growth is getting set to very high number (sometimes 12400%) so whenever there is autogrow happens it will increase log file size as you are expecting.
There are hotfixes for this problem.
FOR SP1
FIX: The value of the automatic growth increment of a database file may be very large in SQL Server 2005 with Service Pack 1
<http://support.microsoft.com/kb/919611/en-us>
FOR RTM
FIX: The value of the automatic growth increment of a database file may be very large in SQL Server 2005 <http://support.microsoft.com/kb/917887/en-us>
Contact Microsoft and get a grace case opened to get hotfix.
January 2, 2007 at 10:21 am
SQL build: Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) Apr 14 2006 01:12:25 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
It is an HP dual dual-core AMD Opteron 270 Processor with 2 GB of RAM. The log growth is set auto but the problem I have with is the backup of the log, not the log. The size of the log is normal. At night I do a final log backup, truncate the log, and do a full backup. The percentage of log usage is 1%, 2% of 500 MB in the morning and grows up to 80%, 90% at the end of the day. However the backup of the log is up to 8 GB , 10 GB at the end of the day after the final log backup. The hot fix doesn't seem to fit my case.
January 2, 2007 at 11:19 am
How often you run the tlog backup?
If your recovery model is full/bulk_logged, log will not be truncated unless you run the tlog backup.
If the db is configured for transactional replication, log will not be truncated if there pending transactions to replicate even after running the tlog backup.
MohammedU
Microsoft SQL Server MVP
January 2, 2007 at 11:49 am
the log backup runs every 30 minutes from 6am to 10pm. The recovery mode is full. The database is setup with default: no replication, no mirroring.
January 2, 2007 at 12:11 pm
"However the backup of the log is up to 8 GB , 10 GB at the end of the day after the final log backup."
Is your .ldf files grows to 8-10 GB or backp file?
Are you appending the log backups to single file?
MohammedU
Microsoft SQL Server MVP
January 2, 2007 at 3:23 pm
The log backup files grows, not the ldf files.
Yes, I appending the log backups into a single file.
It seems that the log backup job keeps backing up starting from the last checkpoint. Is there a way to checkpoint the log? Here is what I have from RESTORE HEADER ONLY.
BackupSize | FirstLSN | LastLSN | CheckpointLSN | DatabaseBackupLSN | BackupStartDate |
274432 | 67313000000004400037 | 67313000000007500001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 05:45:08.000 |
274432 | 67313000000004400037 | 67313000000007700001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 06:15:07.000 |
274432 | 67313000000004400037 | 67313000000007700001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 06:45:07.000 |
274432 | 67313000000004400037 | 67313000000007900001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 07:15:08.000 |
274432 | 67313000000004400037 | 67313000000008300001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 07:45:08.000 |
274432 | 67313000000004400037 | 67313000000009100001 | 67313000000004400037 | 67313000000004400037 | 2007-01-02 08:15:09.000 |
28272640 | 67313000000004400037 | 67327000000202400001 | 67327000000188600001 | 67313000000004400037 | 2007-01-02 08:45:09.000 |
56660992 | 67313000000004400037 | 67338000000120100001 | 67338000000012900001 | 67313000000004400037 | 2007-01-02 09:15:13.000 |
84325376 | 67313000000004400037 | 67346000000452400001 | 67341000000313100338 | 67313000000004400037 | 2007-01-02 09:45:10.000 |
111988736 | 67313000000004400037 | 67353000000533600001 | 67353000000475500001 | 67313000000004400037 | 2007-01-02 10:15:10.000 |
139520000 | 67313000000004400037 | 67359000000604700001 | 67359000000556500001 | 67313000000004400037 | 2007-01-02 10:45:11.000 |
166984704 | 67313000000004400037 | 67364000000907400001 | 67364000000791600001 | 67313000000004400037 | 2007-01-02 11:15:13.000 |
167312384 | 67313000000004400037 | 67364000000964700001 | 67364000000791600001 | 67313000000004400037 | 2007-01-02 11:45:12.000 |
168034304 | 67313000000004400037 | 67365000000030500001 | 67364000000791600001 | 67313000000004400037 | 2007-01-02 12:15:14.000 |
194973696 | 67313000000004400037 | 67369000000692000001 | 67366000000661600135 | 67313000000004400037 | 2007-01-02 12:45:29.000 |
222765056 | 67313000000004400037 | 67373000001050000001 | 67373000000873700001 | 67313000000004400037 | 2007-01-02 13:15:20.000 |
223289344 | 67313000000004400037 | 67373000001151400001 | 67373000000873700001 | 67313000000004400037 | 2007-01-02 13:45:15.000 |
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply