Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Alter Database with variable Expand / Collapse
Author
Message
Posted Thursday, April 30, 2009 7:24 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 12, 2009 8:16 AM
Points: 38, Visits: 129
Thank you for your hints.
I also think now that it is not good to shrink the transcation log to 1MB.
Although the recovery mode is set to simple (so only the last transactions is stored in the transaction log),
the growth of the transaction log is an expensive operation.
But, why should the transaction log size set to 10% of the database size?
Has someone experiences which is a good value in simple recovery mode?

Regards,
Post #707669
Posted Thursday, April 30, 2009 5:42 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, February 24, 2014 1:01 AM
Points: 503, Visits: 610
There are no definitive rules on how you should size the database log file. If I may bore you with my past, back in 1993 I was sent off to Sybase to learn about Sybase System 10. As we all know Sybase and SQL Server are one and the same (poetic licence now I feel) and back then Sybase were saying that, as a good starting point, the log file should be 20% of the size of the database or twice the size of the largest table on which you might perform a single update which hits every row.

But really it depends on how your database is used. One of the databases I look after has data files totalling 1.5TB but the log file is sized at 5GB which is roughly 3%.

Mike
Post #708195
Posted Friday, October 18, 2013 12:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Yesterday @ 8:42 AM
Points: 1, Visits: 27
Sometimes you need to change all db's from full to simple in a second environment, where log room is scarce or you are just testing.

Select 'Alter Database ['+name+'] Set Recovery simple with no_wait'
from sys.databases
where recovery_model_desc like 'full' and database_id > 4

Will generate sql's to alter your user db's ( > 4) to simple, but won't run them. You can pick and execute them with cut and paste.

-007sql
Post #1506300
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse