How do I shrink a log file in a mirrored database?

How do I shrink a log file in a mirrored database?

You have to create a job that regularly backs up the transaction log (every 15 or 30 minutes or so) to keep the log size from getting out of hand. If it is already out of hand, run BACKUP LOG TO DISK = ‘Nul’, then run a DBCC SHRINKFILE command. Then you can get your job set up.

How do I shrink a transaction log in SQL Server 2012?

Truncate the transaction log

  1. Right-click the database and select Properties -> Options.
  2. Set the recovery model to Simple and exit the menu.
  3. Right-click the database again and select Tasks -> Shrink -> Files.
  4. Change the type to Log .
  5. Under Shrink action, select Reorganize pages before releasing unused space and click OK.

Can I shrink the transaction log file on a mirror database?

Per this question about transaction log maintenance on a mirror database, you can’t back up the log on the mirror, but when asked specifically in comments about how to shrink an overgrown log file on a mirror database, a comment was left that One way to do this would be to failover to the mirrored database and do the shrink there.

How are transaction logs used in SQL Server?

The transaction logs are used to record all transactions before committing data to the DB data file. The transaction log files are required to roll back the database to the previous state. Typically, the journal stores the sequence number, type of change, the operations performed, etc.

How to shrink a SQL Server transaction file?

To shrink transaction file, backup must be performed as there are actives Virtual Log File : http://www.xoowiki.com/Article/SQL-Server/tronquer-journal-de-log-sur-base-en-miroir-499.aspx You have to backup the log regularly otherwise your log file will grow indefinitely.

Why is MY SQL Server transaction log file too big?

Since mirroring was set up, this size increase was duplicated on the mirrored server, and eventually took up all the disk space and made the mirror database unusable.