INF: How to Increase the Number of SQL Server Error LogsID: Q196909
|
By default, the SQL Server error logs are kept in the Mssql7\Log
subdirectory. By default, there are seven SQL Server error logs; Errorlog
and Errorlog.1 through Errorlog.6. The name of the current, most recent log
is Errorlog with no extension. The log is re-created every time SQL Server
is restarted. The previous log is renamed to Errorlog.1, and the next
previous log (Errorlog.1) is renamed to Errorlog.2, and so on. Errorlog.6
is deleted. This actually occurs in reverse order, but the result is the
same.
In some cases, you may want to keep more than seven logs archived. In SQL Server 7.0, you can add a registry key setting to retain more than seven error logs.
WARNING: Using Registry Editor incorrectly can cause serious problems that
may require you to reinstall your operating system. Microsoft cannot
guarantee that problems resulting from the incorrect use of Registry Editor
can be solved. Use Registry Editor at your own risk.
For information about how to edit the registry, view the "Changing Keys and
Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete
Information in the Registry" and "Edit Registry Data" Help topics in
Regedt32.exe. Note that you should back up the registry before you edit it.
If you are running Windows NT, you should also update your Emergency
Repair Disk (ERD).
The new registry key that you can set is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\NumErrorLogs
xp_regwrite 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', 'NumErrorLogs',
'REG_DWORD', 20
go
Because this command alters the registry, it is a good idea to back up your
changes. You can do this by running the command-line utility Regrebld.exe
with the -Backup parameter, as in the following example:
D:\MSSQL7\BINN>regrebld -Backup
This command creates five files in the \Mssql7\Binn subdirectory:
Mssql7.rbkSave these files; you will need them if you want to restore the registry.
Mssql7ct.rbk
Mssql7ea.rbk
Mssql7es.rbk
Mssql7p.rbk
Additional query words: errorlog errorlogs logs
Keywords : SSrvErr_Log
Version : winnt:7.0
Platform : winnt
Issue type : kbinfo
Last Reviewed: August 12, 1999