In RightFax 9.0 and later, RightFax stores its database in SQL server. If the RightFax database log (.LDF) file becomes too large, SQL performance may deteriorate. You should keep your transaction log files to less than 4 GB to avoid performance issues. The following steps will help you shrink the size of your RightFax log file. For more technical tips on RightFax, renew your RightFax Support with Ingenium to gain access to our FAQ Database. Get a quote today.
•There are SQL db_owner permissions for the RightFax database.
•RightFax services are all stopped.
•Sufficient free space is available to perform this task. If the transaction log file (.LDF) is 20 GB, for example, verify that you have at least 20 GB free.
•There is sufficient time to perform this task. The size of the log file determines how long the process takes. If the RightFax transaction log file (.LDF) is larger than 10 GB, shrinking it may take 30 minutes or more.
Microsoft SQL Server uses the transaction log file (.LDF) for each transaction. The log file is useful for data recovery. To recover data, you can restore a known good backup of the database, and then apply any transactions that took place since your last backup was taken by applying the log file.
Before shrinking the SQL Server database, back up the log file to mark all transactions as committed so they are freed up during the shrink operation.
Step 1: Back Up the SQL Server Transaction Log (.LDF) File:
1. Open Microsoft SQL Server Management Studio.
2. Expand the Databases node.
3. Right-click the RightFax database, and then click Tasks > Backup.
4. For Backup Type, select Transaction Log.
5. Click OK to start the backup operation.
Step 2: Shrink the RightFax Transaction Log File (.LDF):
Now that the log file is backed up, you can shrink it. Shrinking the log file removes white space and committed transactions.
You can shrink your SQL Server transaction log file using SQL Server Management Studio or at the OSQL command prompt. Instructions for both methods are provided below.
Using Microsoft SQL Server Management Studio (Express):
If you do not have SQL Server Management Studio installed, you can download it from the Microsoft website or install it using the Fax Server 9.4 DVD.
1. Open SQL Server Management Studio, and log on.
2. Expand Databases.
3. Right-click your RightFax database, and then click Tasks > Shrink > Files.
4. Ensure that the file type is Log and the file name is correct.
5. Click OK when you are ready to make the changes.
From an OSQL Command Prompt:
1. At a command prompt, type:
osql -S -U<username> -P<password>
For example, to connect to SQL Server as the “sa” user with a password of “password,” enter the following:
osql -SSQLServer\RightFax -Usa -Ppassword
At the >1 prompt , type the following, and press ENTER after each line:
DBCC SHRINKFILE(“RightFax_Log”, 1)
BACKUP LOG RightFax WITH TRUNCATE_ONLY
DBCC SHRINKFILE(“RightFax_Log”, 1)
NOTE: In SQL Server 2008 and 2012 the BACKUP LOG as TRUNCATE_ONLY feature was depreciated and is not recognized as a backup option. The simple recovery model should be used to automatically truncate the transaction log.
Preventing the Transaction Log File (.LDF) from Growing Too Large:
As previously mentioned, for best performance, you should ensure that the RightFax transaction (.LDF) log file remains smaller than 4 GB. The larger it grows over 4 GB, the more likely you are to experience performance issues.
To keep the log file in check, perform regular backups of both the RightFax database (.MDF) file and transaction log (.LDF) file, and then shrink the transaction log file.
You can use the SQL Server Agent to schedule backups. However, the free version of SQL Server Management Studio (the Express version) does not include SQL Server Agent. You require a paid version of SQL Server to schedule backups.
For more information on SQL Server backups, see the References field below.
References: See the following Microsoft Support articles:
“A transaction log grows unexpectedly or becomes full on a computer that is running SQL Server”
“How to stop the transaction log of a SQL Server database from growing unexpectedly”
“Considerations for the ‘autogrow’ and ‘autoshrink’ settings in SQL Server”
“How to schedule a database backup operation by using SQL Server Management Studio in SQL Server 2005”
In addition, consult the Microsoft documentation on MSDN and TechNet.