PSIsafe Administrator Guide: SQL Transaction Log Shrink

Shrinking the SQL Transaction log associated with the Database attached to your PSIsafe installation is essential for performance and data integrity, and should be performed as often as necessary. These SQL Transact steps can be added to a scheduled SQL Agent Maintenance job as well.

  1. Login to SQL Instance that contains CNG_Main Database
  2. Make Full Database backup (SQL Instance>Database>CNG_Main>Tasks>Back Up…)
  3. Create a new query
  4. Paste the following code in the query window. It is recommended you go to 100mb, 25mb, and finally 2mb. Change the value for Log size in the query script.
-- START SHRINK Query
USE CNG_Main;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE CNG_Main
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 2 MB.
DBCC SHRINKFILE (CNG_Main_Log, 2);
GO
-- Reset the database recovery model.
ALTER DATABASE CNG_Main
SET RECOVERY FULL;
GO
-- END SHRINK Query

Keywords: PSIsafe Server, PSIsafe On-Premises, PSIsafe Transaction Log, SQL Transaction Log, SQL Transaction Log Shrink

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.