database log file

  • If a database is setup to readonly and in simple recovery mode.

    Will the log file grow or not?

    thanks

  • 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.

  • 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;-)

  • 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,

  • 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

  • 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, MVP, M.Sc (Comp Sci)
    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
  • Thanks much, that helps

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply