Sql-server – Shirking of Log file on Primary Server of Transaction Log shipping

high-availabilitylog-shippingsql serversql-server-2012transaction-log

I have a database with size 200 GB Total(mdf+ldf) and Log file(ldf) with 50 GB and 99% unallocated space in ldf file i.e. not being used at all.

We had setup log backups for every 5 minutes, so there no problem with ldf file increasing.

We had setup Log shipping on Prod server(Primary) and DR Server(Secondary)

Now i have a question,

  1. Can i shrink the log file of the database on primary to 1 GB?
  2. Can i shrink the log file i.e. ldf without changing the recovery model of database to 1 GB?
  3. Can i shrink the log file without using NOTRUCATE option, if i use ssms wizard to shrink.
  4. Will shrinking cause for log file to grow more after shrinking?

Expedite answers would be appreciated

Thank you

Best Answer

I have a database with size 200 GB Total(mdf+ldf) and Log file(ldf) with 50 GB and 99% unallocated space in ldf file i.e. not being used at all.

Leave it as it is, the space would eventually be utilized without any autogrowth and that would really help your SQL Server transactions, so just DONT shrink.

FYI

  1. You can shrink log files on primary server
  2. DONT change the recovery model this would break logshipping. Yes you can shrink without changing recovery model
  3. The log file will eventually again grow so there is no sense in shrinking.
  4. You may use NO truncate but normal shrinking would just do fine. This is just to answer your queries I would still say do not shrink.

Further reading Why Does Transaction Log file Growing and Runs out of the Space