Dumping the transaction log  A more complex procedure

Chapter 15: Managing Free Space with Thresholds

A simple threshold procedure

Following is a simple procedure that dumps the transaction log and prints a message to the error log. Because this procedure uses a variable (@dbname) for the database name, it can be used for all databases in Adaptive Server:

create procedure sp_thresholdaction
    @dbname varchar(30),
    @segmentname varchar(30),
    @free_space int,
    @status int
as
dump transaction @dbname
    to tapedump1
print "LOG DUMP: ’%1!’ for ’%2!’ dumped",
        @segmentname, @dbname 




Copyright © 2005. Sybase Inc. All rights reserved. A more complex procedure

View this book as PDF