---
title: "Pharos Transaction log in SQL has grown very large. The default size is 30MB to start but may grow and shrink as needed based on the Database configuration."
slug: "pharos-transaction-log-in-sql-has-grown-very-large-the-default-size-is-30mb-to-start-but-may-grow-and-shrink-as-needed-based-on-the-database-configuration"
updated: 2024-03-28T14:25:52Z
published: 2024-03-28T14:25:52Z
canonical: "kb.pharos.com/pharos-transaction-log-in-sql-has-grown-very-large-the-default-size-is-30mb-to-start-but-may-grow-and-shrink-as-needed-based-on-the-database-configuration"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://kb.pharos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pharos Transaction log in SQL has grown very large. The default size is 30MB to start but may grow and shrink as needed based on the Database configuration.

The Pharos transaction log file (pharos_log.ldf) should be 30 MB.

Incorrect settings in SQL Server can cause this file to grow much larger, and as a result cause problems.

---

#### To correct an oversized Pharos transaction log follow these steps:

Close all connections to the Pharos Database:

1. Stop the Pharos License Server Service which will stop all Pharos Services
2. Close any copies of Pharos Reports that may be running.

### OPTION 1: Using SQL Server Enterprise Manager or Management Studio

1. Detach the Pharos database
2. Locate the SQL Server data files. There should be two files related to the Pharos Database (pharos_data.mdf and pharos_log.ldf)
3. Delete the oversized log file (pharos_log.ldf)
4. Re-attach the Pharos database and restart the Pharos Services, starting with License and Database Services

### OPTION 2: Using a command prompt

1. In the Command Prompt run the following query to detach the Pharos database:

osql -U sa -d master -S servername -Q "sp_detach_db 'pharos'" -P password -o outputfile.txt

servername - Name of the Server

password - Valid Password for 'sa' account
2. Now, in the Command Prompt run the following query to re-attach the Pharos database:

osql -U sa -d master -S servername -Q "sp_attach_single_file_db @dbname = 'pharos', @physname = 'correct_path\pharos_data.mdf'" -P password -o outputfile.txt
3. Restart the Pharos services starting with License and Database Services

### NOTES:

Verify that SQL Server Agent Service is set to Automatic and running to ensure that daily Pharos Database backups are performed.

Check in SQL Server that the log is set to be 30 MB and allowed to grow at 10%.

### SQL Server 2008

[The backup process for SQL Server 2008 doesn't work with Pharos. It fails with a error stating that "truncate only" is not a valid option.](http://pharos.custhelp.com/app/answers/detail/a_id/1567)

Note: A small video has been provided using SQL Management Studio.

## Related

- [Pharos Print Center Error: Received A Negative Response When Attempting Convert](/pharos-print-center-error-received-a-negative-response-when-attempting-convert.md)
- [Pharos Omega 1.5.5 Revision 6399 (Queens Cliff U5)](/pharos-omega-155-revision-6399-queens-cliff-u5.md)
- [Pharos Cloud: Configuring the Print Scout for Windows with verbose logging.](/pharos-cloud-configuring-the-print-scout-for-windows-with-verbose-logging.md)

## Attachments

- [SQL-correct-transact-log-file.rar](https://cdn.document360.io/f4fb58ca-1114-4e59-ba1a-d8f647bd6dcf/Images/Documentation/SQL-correct-transact-log-file.rar)
