Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 log file is 21 gig

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2006-04-27 : 11:47:40
I have log file is 21 gig...i cannot shrink this
Mode is Full

Should i just do a detach and then delete log file then reattach.

Is there anything i can do without having to do detach.

can i do this
BACKUP LOG database WITH TRUNCATE_ONLY

Will this help

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-04-27 : 12:02:32
You should be running database backups and transaction log backups if your database is in full recovery mode. Your transaction logs will continue to grow until you run the transaction log backup.

I recommend a daily full backup, and transaction log backups scheduled every 15 minutes. You can set this up with the Database maintenance Wizard.

After you run the backups, then you can run DBCC SHRINKFILE to reduce the size of your transaction log file to a reasonable size.




CODO ERGO SUM
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-27 : 12:58:46
Do you need the recovery model to be FULL? Are you performing regular transaction log backups? If no and no, then set the recovery model to SIMPLE then shrink the file.

Tara Kizer
aka tduggan
Go to Top of Page

homebrew
Posting Yak Master

114 Posts

Posted - 2006-04-27 : 15:06:03
Maybe there's an open transaction that never got committed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-27 : 15:10:33
It's most likely due to DBCC DBREINDEX (or optimizations job from a maintenance plan) that caused this. This is normal for your tlog to grow if you have it running. If you do have it, you should NOT shrink your transaction log as you will receive a huge performance penalty the next time the job kicks off as it will need to expand the LDF file. You should add more disk space to accomodate the job if you are insistent on running it, which you shouldn't be. Check this out for details:

http://weblogs.sqlteam.com/tarad/archive/2006/04/11/9585.aspx

How big is your MDF?

Tara Kizer
aka tduggan
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-04-27 : 16:29:37
Tara: If its only DBCC DBREINDEX that is causing the problem would switching to DEFRAG instead use less log space?

Kristen
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-27 : 16:34:47
It logs less, so yes. But switching should be based upon one's analysis of the MS article mentioned in my weblog along with what Paul mentioned. Depending on the situation, you may not need to run either.

Tara Kizer
aka tduggan
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-04-27 : 17:39:53
Based on the questions asked in the original post, my guess of the situation would be:
1. No tran log backups are running, and likely no backups.
2. If there are no backups, why would there be reindex jobs?
3. It has probably been running this way since the DB was setup, and the transaction log file finally filled up the disk.


It would be nice if the Create Datebase Wizard in Enterprise Manager created a daily backup and hourly transaction log backup by default. The people that really don't know what they are doing would have at least some protection from self-inflicted injury.

We seem to get a post like this every day or so, along with the "I deleted my table/database. I don't have a backup. Please tell me how to get my data back."





CODO ERGO SUM
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-04-28 : 02:24:17
"a daily backup and hourly transaction log backup by default"

A Maintenance Plan can be set up for All User Databases - so that could be an option on Install of SQL Server ...

Kristen
Go to Top of Page
   

- Advertisement -