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: Tuesday, April 15, 2014 9:54 AM
Points: 1,720, Visits: 3,063
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 @ 7:53 PM
Points: 22,511, Visits: 30,236
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: Friday, March 14, 2014 2:19 AM
Points: 2,820, Visits: 3,916
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----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1392881
Posted Wednesday, December 05, 2012 4:17 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 9:54 AM
Points: 1,720, Visits: 3,063
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
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, November 19, 2013 8:15 AM
Points: 653, Visits: 1,428
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-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:30 PM
Points: 41,531, Visits: 34,448
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: Tuesday, April 15, 2014 9:54 AM
Points: 1,720, Visits: 3,063
Thanks much, that helps
Post #1393701
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse