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

database log file Expand / Collapse
Author
Message
Posted Tuesday, December 04, 2012 6:30 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
If a database is setup to readonly and in simple recovery mode.

Will the log file grow or not?

thanks
Post #1392760
Posted Tuesday, December 04, 2012 6:48 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 8:34 AM
Points: 21,588, Visits: 27,385
It shouldn't since you can't run insert, update, or delete statements. In addition you can't update the statistics or reorganize or rebuild indexes.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1392763
Posted Wednesday, December 05, 2012 3:21 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562, Visits: 3,451
sqlfriends (12/4/2012)
If a database is setup to readonly.
Will the log file grow or not?

thanks
NO




sqlfriends (12/4/2012)
If a database is setup in simple recovery mode.

Will the log file grow or not?

thanks
Yes


-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #1392881
Posted Wednesday, December 05, 2012 4:17 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
So if a database is set to read only , and by just querying the database, it won't create any log transactions, so no affect on log file, is that correct?

Thanks,
Post #1393262
Posted Wednesday, December 05, 2012 4:30 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: Thursday, May 09, 2013 1:13 PM
Points: 516, Visits: 1,004
sqlfriends (12/5/2012)
So if a database is set to read only , and by just querying the database, it won't create any log transactions, so no affect on log file, is that correct?

Thanks,


That is correct. You can confirm that using fn_dblog(null,null).

USE [master]
GO
ALTER DATABASE [DBA_Rep] SET READ_ONLY WITH ROLLBACK IMMEDIATE
GO

SELECT * FROM fn_dblog(null,null)
Returned 3 transaction log records in my development environment

SELECT * FROM dbo.Backup_History

SELECT * FROM fn_dblog(null,null)
Returned the same 3 transaction log records
Post #1393265
Posted Thursday, December 06, 2012 1:52 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:44 AM
Points: 37,645, Visits: 29,898
sqlfriends (12/5/2012)
So if a database is set to read only , and by just querying the database, it won't create any log transactions, so no affect on log file, is that correct?


Selects are never logged, in any recovery model in any database setting. Database changes are what are logged. A read only database can't be changed and hence won't get any log records.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1393371
Posted Thursday, December 06, 2012 12:29 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
Thanks much, that helps
Post #1393701
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse