June 15, 2004 at 7:28 pm
Can I grow the transaction Log using a script?
My scenario:
I have 3 different scripts that need to run on this particular database, 2 of them only need 4gb of TL space, so I set the transaction log to automatically grow by 4096, which works well, but the other script requires 24Gb, and it spends a lot of time growing the file while executing the script. I want to be able to grow the file to 24Gb before the script executes and then shrink it afterwards.
Thank you,
Ryk
June 18, 2004 at 8:00 am
This was removed by the editor as SPAM
June 18, 2004 at 8:53 am
My best guess (but not tested):
-- Before batch
use master
go
alter database foo_db
modify file (name=foo_db_log,
size=24 GB)
go
-- After batch
use foo_db
go
dbcc shrinkfile (foo_db_log, 4000) -- Shrinking to 4 GB
go
June 20, 2004 at 4:21 pm
Thank you, yes that is what I ended up using.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply