Sybase

Sybase database migration / reduction

One of the main problem of sybase (and other database) is the way it handle disk space. You must create « disk devices », which can be RAW or file on a filesystem. Then give some space of it to a database, and perhaps create or extend segments.

Of course, this may sound a good way to deal with it. Then comes the time when you need some storage for something else, or another database.

You start realizing that the 15 Gb you added to your database, thinking your data will grow as you reach your 1.000.000.000 subscriber… but your stalled at 150 :)

Lire la suite de l’article »

Get the Page size in Sybase

Strange, I wasn’t able to find a way to get the database page size in a Sybase (12.x) server.

Digging in sp_helpdb stored procedure gave me some more informations. To do this, or any stored proc, use this SQL command :

use sybsystemprocs
go
sp_helptext  sp_space_segment
go

You will get the stored proc as text.

Finaly, the solution to get the page size is :

select v.low/1024  from master.dbo.spt_values v  where v.number = 1 and v.type = "E"

or the page size in octets:

select v.low/1024  from master.dbo.spt_values v  where v.number = 1 and v.type = "E"

or how many pages there are in a mega-octet (Mo) :

select (1048576 / v.low)
from master.dbo.spt_values v
where v.number = 1
and v.type = "E"