rm /opt/sybase-12.5/master/testdb.dat
set -x
isql -Usa -Ppassword -Ssybase  <<EOI
drop database testdb
go
sp_dropdevice testdb_dev
go
disk init name="testdb_dev",physname="/opt/sybase-12.5/master/testdb.dat",vdevno=9,size="500M"
create database testdb on testdb_dev="300M" 
go
use testdb
go
sp_addsegment testdb_seg,testdb,testdb_dev
go
sp_extendsegment testdb_seg,testdb,testdb_dev
go
create procedure sp_thresholdaction as dump transaction testdb with no_log
go
sp_addthreshold testdb,testdb_seg,1000,sp_thresholdaction
go

use master
go
alter database tempdb 
go
use tempdb
go
sp_addsegment tempdb_seg,tempdb,master
go
create procedure sp_thresholdtempdb as dump transaction tempdb with no_log
go
sp_addthreshold tempdb,tempdb_seg,300,sp_thresholdtempdb
go
use testdb
go
EOI
