DBCC Shrink Log file in Database is read only in sql2005

  • hi

    i have restore the database use .TRN file in sheduling to one hour . the database is read only and stand by mode. i have shrink log file . but in read only mode the dbcc shrink file is not posible.

    1) how can i use the dbcc shrink file to minimize the size of .ldf file .

    2) i have remove the read only mode of database then i can posible to restore the database use in .TRN File

    i should expect user experience

  • Why do you want to shrink the log?

    If you bring the database online, you will not be able to restore more log backups.

    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
  • 1) how can i use the dbcc shrink file to minimize the size of .ldf file

    I'm not sure about this, I hope the source servers log file is copied to destination!

    2) i have remove the read only mode of database then i can posible to restore the database use in .TRN File

    If you bring the database out of read only mode, then you won't be able to restore transaction logs in future.

  • thanks to reply all

    i have shrink the .ldf log file of database. becouse increse the size of log file

  • You cannot without recovering the database and making it impossible to apply more log file backups.

  • Use Databse name

    ALTER DATABASE database-name SET READ_WRITE

    and then run the DBCC Shrinkfile('Logfilename', Size)

    Take the Full backup.

    And then

    ALTER DATABASE database-name SET READ_ONLY

    there is only option if you want to shrink the readonly Log File

  • Please note: 3 year old thread. And the DB is not read-only, it's in STANDBY.

    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

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

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