Turning off the secondary truncation point in a database

Truncating the log frees only log pages that the RepAgent has sent to the Replication Server with confirmation. To truncate portions of the log that have not been transferred, you must turn off the secondary truncation point for the database by executing the Transact-SQL command dbcc settrunc(ltm, ignore) in the database.

NoteOnly the Adaptive Server system administrator and the database owner have permission to execute the dbcc settrunc command.

First, suspend the RepAgent forwarding the log. Otherwise, executing dbcc settrunc results in the following error:

The log transfer context for the current database is
already reserved by Adaptive Server process 7. The log
transfer context for the current database is not
reserved.

To turn off the secondary truncation point in the database named Parts, for example, log in to the Adaptive Server with the database and execute:

> use Parts
> go
> dbcc settrunc(ltm, ignore)
> go

After you have turned off the secondary truncation point, you can truncate the log using the Transact-SQL dump transaction command. See the Adaptive Server Enterprise Reference Manual for more information.

Finally, you should dump the transaction log. This may result in the loss of updates to the replicate database. The primary database is not affected. You must reapply the lost updates to the replicate database. For more information about reapplying updates, see “Log truncation problems”.