Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




Of Interest

Business Intelligence and Analytics



Oracle Training





Sybase » Administration » DBA »

Setting the thresholds

     




Threshold settings allow customized procedures to be run when database segments
approach a defined capacity.

The "last chance threshold" is set by default, to execute sp_thresholdaction within the
current database, when a segment reaches 95% of capacity. The procedure sp_thresholdaction
needs to be created by the DBA. Here is a sample:


create proc sp_thresholdaction (
@dbname varchar(30),
@segmentname varchar(30),
@space_left int,
@status int ) as

declare @msg varchar(80),
@date1 datetime,
@fname varchar(80),
@fdate varchar(20),

@fpath varchar(40)

select @fpath = '/usr/dumps/logs/'

select @date1 = getdate()

select @fdate =
convert(varchar(2),datepart(MM,@date1)) +
convert(varchar(2),datepart(DD,@date1)) +
convert(varchar(2),datepart(HH,@date1)) +
convert(varchar(2),datepart(MI,@date1))

select @fname = @fpath + 'log_' + @dbname + @fdate + '.dmp'

select @msg = '***!! Last Chance Threshold reached, for ' + @dbname + '(' + @segmentname + ')'

print @msg

if @segmentname = 'logsegment'
dump tran @dbname to @fname

return



Other threshold levels can be created, for specific segments. They can be set up
to print informational messages to the error log, as a forewarning to the DBA. Here's a
sample which reflects the command syntax:

1> sp_addthreshold dbname,logsegment,400,'proc_log_threshold'
2> go
Adding threshold for segment 'logsegment' at '400' pages.
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
(return status = 0)








Sybase : Related Topics

Sybase : Administration : Post-installation check
Sybase : Administration : Device initialization
Sybase : Administration : Database Creation
Sybase : Administration : A backup routine
Sybase : Administration : Striping Dump Devices
Sybase : Administration : Moving the transaction log to another device
Sybase : Administration : Adding a segment to a database
Sybase : Administration : Configuring the cache
Sybase : Administration : Apply multiple transaction dumps
Sybase : Administration : Database maintenance procedure
Sybase : Administration : Database maintenance script
Sybase : Administration : Server configuration
Sybase : Administration : Dealing with a Corrupted Database
Sybase : Administration : Dealing with a Server Failure
Sybase : Administration : DBCC Notes
Sybase : Administration : Create proxy tables and external logins
Sybase : Administration : Renaming a database
Sybase : Administration : Reorg: rebuilding a table
Sybase : Administration : Sybase ASE 15 Enhancements
Sybase : Administration : Apply a transaction dump
Sybase : Administration : Security Tasks
Sybase : Administration : Setting Process Priorities
Sybase : Administration : Sybase ASE Architecture Overview
Sybase : Administration : Drop an alias, with objects linked to login
Sybase : Administration : Display grants, effective rights to objects
Sybase : Administration : Displaying access information from sysprotects
Sybase : Administration : Database Engines: Status and Settings
Sybase : Administration : Replication Server 15 Configuration
Sybase : Administration : Loading data into Sybase IQ from a Remote Server
Sybase : Administration : Sybase IQ Overview
Sybase : Administration : Sybase IQ Functions
Sybase : Administration : Sybase IQ - Remote Access From ASE

Sybase Web Site
Sybase Mobile Web Site
Oracle Web Site



Get the latest Rocket99 news and tech tips via






Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2012 Stoltenbar Inc All Rights Reserved.