question

suesh avatar image
suesh asked

How can we add another log file to database while applications are connected to database ?

The users are currently working with database. Here how can we add another log file to that database? what are the steps we follow? Thanks, siddu
database-files
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Please help us out. This site runs by you voting on the answers to your questions. For every helpful or partially correct answer below, please indicate this by clicking on the thumbs up symbol next to each of those answers. If any one answer below lead you to a solution to your problem, please indicate this by clicking on the check mark next to that answer.
0 Likes 0 ·
Squirrel avatar image
Squirrel answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image
JohnM answered
Just curious, is there a reason why you want to add another log file? What are you attempting to solve? Here's an example of how to accomplish this: USE master; GO ALTER DATABASE [DatabaseNameHere] ADD LOG FILE ( NAME = test1log2, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\test2log.ldf', SIZE = 5MB, MAXSIZE = 100MB, FILEGROWTH = 5MB ) GO The above was borrowed from: http://msdn.microsoft.com/en-us/library/bb522469.aspx Hope this helps!
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
suesh, why would you want to add a second log file?
1 Like 1 ·
suesh avatar image suesh commented ·
can we add log file directly without disconnecting the users?
0 Likes 0 ·
JohnM avatar image JohnM suesh commented ·
Yes, you should be able to add it in flight, however I would recommend testing this before putting it into production.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.