How to reduce the transactional log size (MSSQL database)?

OpManager provides extensive workflow operations:

You will find a print to the following effect in the logs: Caused by: java.sql.SQLException: The transaction log for database 'OpManagerDB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases..

To check the used % : DBCC SQLPERF(LOGSPACE) 

Steps to clear the logs:

  1. Shutdown OpManager server.
  2. Change the Recovery Model to Simple by following the steps below:
    • Go to SQL server-->OpManagerDB properties-->Options-->Recovery Model-->Simple.
  3. Connect to MSSQL Server-->OpManagerDB. Execute the following query
    1. DBCC SHRINKDATABASE (database name , target percent) for eg DBCC SHRINKDATABASE (OpManagerdb,20)
    2. alter database MODIFY FILE (Name = "_log",MAXSIZE=1 GB) - for eg alter database OpManagerdb MODIFY FILE (Name = "OpManagerdb_log",MAXSIZE=1 GB) (If the transaction log is too huge without any backup, it can not be shrunk. So run this query and then follow the above steps.
    BACKUP LOG OpManagerDB WITH TRUNCATE_ONLY
  4. Restart OpManager Server.

Ensure you upgrade to the latest build.

If you still get transaction logs filled up issue, check if you have free disk space where the database and transaction log files are saved.

If the drives are filled up, move them to different drive.

 
 Pricing  Get Quote