---
title: "SQL Server stopped due to oversized Transaction Log."
slug: "sql-server-stopped-due-to-oversized-transaction-log"
updated: 2024-04-02T13:07:30Z
published: 2024-04-02T13:07:30Z
canonical: "kb.pharos.com/sql-server-stopped-due-to-oversized-transaction-log"
---

> ## 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.

# SQL Server stopped due to oversized Transaction Log.

The Pharos Principal Server is not functioning correctly as the hard drive is full. The Pharos Database Transaction Log is using all available HD space.

---

This can happen if the SQL Server Agent is never turned on. When backups are run, the log is truncated, making it smaller.

To free up the space in the SQL Server Transaction Log for the Pharos Database, follow these steps:

1. Close all connections to the Pharos Database on SQL Server by stopping the Pharos Database Service and any dependant Pharos services. Also close any copies of Pharos Reports that may be running.
2. Open SQL Query Analyzer, logging on as 'sa' or a user with System Administrator rights and run the following SQL query:

```plaintext
sp_detach_db 'pharos'
```
3. Open Windows Explorer and browse to a location where the SQL Server data files are located. (i.e. c:\MSSQL7\Data). There should be two files related to the Pharos Database (pharos_data.mdf and pharos_log.ldf). Delete the old log file that is now too big (i.e. pharos_log.ldf). You may need to delete the file from the Recycle Bin as well.
4. Switching back to SQL Query Analyzer, run the following SQL query:

```plaintext
sp_attach_single_file_db @dbname ='pharos', @physname = 'c:\MSSQL7\Data\pharos_data.mdf'
```
5. Restart the Pharos Services (starting with Pharos Database Service)

## Related

- [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.](/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.md)
- [Migrating Pharos database from one SQL Server to another.](/migrating-pharos-database-from-one-sql-server-to-another.md)
- [Transactions Log file keeps growing.](/transactions-log-file-keeps-growing.md)
- [Migrating Pharos database between two machines running SQL Server](/migrating-pharos-database-between-two-machines-running-sql-server.md)
- [Cannot install Pharos Uniprint: Unable to open a connection to SQL Server. Check that your SQL Server service is started. The Pharos Database cannot be installed with the current settings.](/cannot-install-pharos-uniprint-unable-to-open-a-connection-to-sql-server-check-that-your-sql-server-service-is-started-the-pharos-database-cannot-be-installed-with-the-current-settings.md)
