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
 General SQL Server Forums
 New to SQL Server Programming
 Log File

Author  Topic 

issammansour
Yak Posting Veteran

51 Posts

Posted - 2007-08-17 : 07:19:38
Hi,

I have a log file with four times of the data "mdf" file is that normal?

Is there a way to drop that files of zap it, any sample will be helpful.


Thanks.

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-17 : 08:23:19
USE DB_NAME

GO

ALTER DATABASE DB_NAME SET RECOVERY SIMPLE

CHECKPOINT

BACKUP LOG DB_NAME WITH NO_LOG

DBCC SHRINKFILE (LOG_FILE_NAME, 1024)

ALTER DATABASE DB_NAME SET RECOVERY FULL


-----------------------------------------------------------------------------------------------
Ashley Rhodes
Go to Top of Page

issammansour
Yak Posting Veteran

51 Posts

Posted - 2007-08-17 : 09:46:06

the system has an error on

BACKUP LOG DB_NAME WITH NO_LOG

(NO_log)
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-17 : 10:25:26
skip that command and just truncate the file to the required size and see if it works

just do this

DBCC SHRINKFILE (LOG_FILE_NAME, 1024)
whre 1024 is the size and you can change it according to your need


-----------------------------------------------------------------------------------------------
Ashley Rhodes
Go to Top of Page

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-08-17 : 10:43:51
Is your log full? Did you just experience a large load on the database, or has it just grown over time? If it is the latter I would not shrink the file, but rather I would suggest you just backup the transaction log frequently. Or, if you don't need point of time recovery just do the backup and shrink as suggested and switch to simple recovery.

Please see this post in the FAQ, it covers this topic well.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56434

Go to Top of Page
   

- Advertisement -