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 files deletion

Author  Topic 

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2005-01-25 : 16:31:42
Hi all
I have a problem.I have very huge log files in my database .I want to delete these files from the production database.What all things should i consider before deleting them.plz help

Regards

Nitin

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-25 : 16:54:44
Back up the log, and shrink the file.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-01-26 : 02:31:10
quote:
Originally posted by nitin1353

Hi all
I have a problem.I have very huge log files in my database .I want to delete these files from the production database.What all things should i consider before deleting them.plz help

Regards

Nitin



if they are in use, you will not be able to delete them

but you can shrink them,

i agree with chad plus create maintenance jobs and restrict the size of the log file to prevent it from growing too large.


--------------------
keeping it simple...
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-26 : 13:08:34
I wouldn't restrict the size of the log, as that will cause problems if the max size is reached, and it tries to grow again.

What you do NEED to do is 1 of 2 things.

1. Set your Database to simple recovery
or
2. Do much more frequent log backups.

If you need the ability to restore to a point in time, then choose option 2. If not, Choose option 1. I have over simplified the decision, but there is plenty of information on this forum, and in other references to help you make that decision.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-01-27 : 04:51:52
quote:

i agree with chad plus create maintenance jobs and restrict the size of the log file to prevent it from growing too large.



that's why you need to create maintenance jobs if you're going to restrict the log size.

another solution is, if the database is not critical (no need for point-in-time recovery):

1. create backup jobs (one full backup and one for log backup)
2. create an alert to monitor log file size
3. when the limit is reached, the alert triggers the log backup job
- i make sure i have one full backup for each database every day, from experience this has saved me a lot of headaches



--------------------
keeping it simple...
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-27 : 05:30:40
>> I wouldn't restrict the size of the log, as that will cause problems if the max size is reached, and it tries to grow again.
That's much better than getting the same problems when the disk is full.
Don't like maint plans.
see
http://www.nigelrivett.net/SQLAdmin/TransactionLogFileGrows_1.html
for your current problem
and
http://www.nigelrivett.net/SQLAdmin/BackupAllDatabases.html
for the backups

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-27 : 12:47:21
quote:

That's much better than getting the same problems when the disk is full



That is why I said he/she should also change to simple recovery, or schedule more frequent log backups. Which should keep the log from growing excessivly.

Now this is just my opinion, but when answering the question "Why did out PROD server go down?" I would much prefer to answer because the disk filled up (You didn't spend enough money for disk space).

Than Because I restricted the file growth (I made it happen by restricting file growth, but we have disk space a plenty)

Now in either of these cases proper care/feeding of the log file would avoid the problem.

-Chad


http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page
   

- Advertisement -