0% found this document useful (0 votes)
218 views2 pages

Sybase Scripts

This document contains SQL scripts to summarize database and server configuration details like total database size, free space, log space usage, database version, instance name, startup date, trace flags, server names, database details, disk space usage, and devices used by databases.

Uploaded by

firehari
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
218 views2 pages

Sybase Scripts

This document contains SQL scripts to summarize database and server configuration details like total database size, free space, log space usage, database version, instance name, startup date, trace flags, server names, database details, disk space usage, and devices used by databases.

Uploaded by

firehari
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL script to calculate sybase total database size, data free, data used, total log space, log

space free, log space used.

select "dbname"=db_name(t1.dbid),"DataSize(MB)"=convert(int,sum(case when t1.segmap!=4 then @@maxpagesize/1024.*t1.size/1024 else null end)), "DataFree(MB)"=str(sum(case when t1.segmap!=4 then @@maxpagesize/1024.*curunreservedpgs(t1.dbid,t1.lstart, t1.unreservedpgs)/1024 else null end),11,3),"LogSize(MB)"=isnull(str(sum(case when t1.segmap=4 then @@maxpagesize/1024.*t1.size/1024 else null end),11) ,"on data dev") , "LogFree(MB)"=str(@@maxpagesize/1024.*lct_admin("logsegment_freepages", t1.dbid) /1024,11,3) from master..sysusages t1 group by t1.dbid

Script to identify the database version,edition,patch,Operating system version


select @@version "DATASERVER VERSION"

Script to identify the Instance name, Page Size of Instance.


select @@servername "Instance Name", @@maxpagesize " Page Size of Instance"

Script to identify the Instance Startup date.


select getdate() "Current Date", @@boottime "Instance Startup date"

Script to identify the active trace flag status.


DBCC Traceflags

Check for servers name and their network name.


select srvname "SERVER NAME",srvnetname "SERVER N/W NAME" from sysservers

Database startup date ,durability ,size details. Sp_helpdb Engine Details


sp_configure 'number of engines'

check for disk space usage rates and I/O contention sp_sysmon

Determine which devices a specific database is using sp_helpdevice

You might also like