INF: Creating a Log Device If "Log Full" Error Occurs

ID Number: Q60058

1.11 4.20

OS/2

Summary:

When a "log full" error occurs consistently (even after modifying

the recovery interval), it means that the log must be extended.

This article describes the process.

More Information:

When a log file is full, the correct procedure to use is to issue

the ALTER DATABASE command, followed by the SP_LOGDEVICE command, so

that you can physically move the log file to a device separate from

the device on which the database resides. The device to which the log

file will be moved must first be created by using the DISK INIT

command before the log file can be moved to it.

The correct order in which to issue these commands is as follows:

1. Issue a DISK INIT command. For example

disk init,

name = "testlog",

physname = "c:\sqltest\log",

vdevno = 2,

size = 5120

where:

name = The logical name of the log device.

physname = The full pathname where the log file will reside.

vdevno = The virtual device number. This number must be unique,

where valid numbers are 1-9. An available number can

be determined by issuing the sp_helpdevice command.

size = The size of the database device in 2K blocks.

2. Issue an ALTER command. For example

alter database test on testlog = 2

where:

test = The name of the database whose storage size is to be

changed.

testlog = The logical name of the device on which to put the

database extension on.

2 = The size of the space, in megabytes, allocated to the

database extension device.

3. Issue a SP_LOGDEVICE command. For example

sp_logdevice test, testlog

where

test = The name of the database whose Syslogs table you

want to put on a specific device.

testlog = The logical name of the database device on which you

want to put the Syslogs table.

Additional reference words: optimization and tuning, dumping and loading