Trim Your SQL DBs Log Remotely

The SQL Log records transaction made into database. These log-entries can be used later to check the actions with database. It also used to ensure database integrity in the event of a system restore, includes but not limited to database queries, updating/insertion/deletion of the records. They are just like a temporary location where SQL Server engine temporary store transactions and at final commits the transaction to the database. To clear the disk space and clean the database log, we need to truncate/trim the database log frequently specially for a very active database. Many times the SQL log file grow very large and consume too much space over server. This might also cause to slow performance of a busy database. Here are steps to trim the SQL log remotely.

  • Open Microsoft SQL Server Manager Studio to connect with SQL Database
  • Click on your database to select your database
  • Create new query
  • Now use below T-SQL Script into this newly opened Query windows
  •  Execute this query by clicking Execute Button or press F5 Key to execute it.

USE your_db_name_here
GO
ALTER DATABASE your_db_name_here SET RECOVERY SIMPLE
DBCC SHRINKFILE(2,0)
ALTER DATABASE your_db_name_here SET RECOVERY FULL
GO

Execution of above query done the process.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , | Posted under Internet | RSS 2.0

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 8 = 17

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>