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 issue

Author  Topic 

vishu_av
Yak Posting Veteran

69 Posts

Posted - 2007-10-08 : 00:37:27
Hi all,
i would like to know if i can avoid the log file being created in my database. Reason, i am doing some operation that is eating the memory in GB. I would like to know if there is any way i can UNCHECK this log file to be created...
Please help..

Thanks in advance..!!

Kristen
Test

22859 Posts

Posted - 2007-10-08 : 01:12:37
No, you have to have the log file.

You can set the Recovery Model to SIMPLE, and that will cause the lg file to be reused after a checkpoint - so it will won't grow continuously until a backup (like the FULL Recovery model).

In addition to that you would need to make your transactions into shorter "batches"

"i am doing some operation that is eating the memory in GB"

What sort of operations?

Kristen
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-08 : 21:19:29
Eating the memory is nothing to do with log file? Do you really mean generate gb logs? Do you ever backup log?
Go to Top of Page

vishu_av
Yak Posting Veteran

69 Posts

Posted - 2007-10-08 : 23:31:38
No. I donot back up the logs. Its just that i am running some stored proc that is inserting/ updating 1million records. (something like a customer information for some bank). This is causing log files generated upto 20GB at one shot.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-08 : 23:34:58
Should run that in smaller batches like Kristen said and backup log in between. You have to set scheduled log backup job.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-09 : 04:00:51
"I donot back up the logs"

Presumably your database is running in SIMPLE Recovery model then? (otherwise it will be growing forever!)

"stored proc that is inserting/ updating 1million records."

We do something similar but we only update records that have really changed. That reduced the TLog impact hugely - unless all 1million rows have changed, of course! Then your only choice is to loop round in appropriately sized batches

Kristen
Go to Top of Page
   

- Advertisement -