INF: Storage of SQL Server's Error Log on Stand-Alone Server

ID Number: Q67969

1.10 1.11 4.20

OS/2

Summary:

The following information discusses the behavior of the error log when

SQL Server is run as a stand-alone server.

If SQL Server does not find the old error log when it is started, it

will create a new one. If it does find the old error log, it will

reopen the error log and append to it. It is important to watch the

size of this error log, because it can continually grow to be quite

large if it is never deleted or renamed.

In addition, it is possible that the error log will not be placed in

the \SQL\LOG directory. When SQL Server is started with "sqlservr",

the "/e" option is used to tell it where to place the error log. If

this option is omitted, SQL Server will put the error log in the

default directory when "sqlservr" was started.

One way to keep old copies of the error logs is to write a .CMD file

that will perform this type of functionality. For example:

echo off

cd\<path name where error logs will be kept>

if exist errorlog.6 del errorlog.6

if exist errorlog.5 ren errorlog.5 errorlog.6

if exist errorlog.4 ren errorlog.4 errorlog.5

if exist errorlog.3 ren errorlog.3 errorlog.4

if exist errorlog.2 ren errorlog.2 errorlog.3

if exist errorlog 1 ren errorlog.1 errorlog.2

sqlservr /d <path for master.dat> /e <path for error log>

Note: Instead of using the "/d" and "/e" options, it is also

acceptable to use the "-d" and "-e" options. For example:

sqlservr -d <path for master.dat> -e <path for error log>

Additional reference words: 1.10 1.11 4.20 errorlog log novell