sybase administration - liamlamth/blog GitHub Wiki

operation

  • log path: $SYBASE/$SYBAsE_ASE/install/
  • login: isql -Usa_name -Ppassword -Smaster_db_name -w999
  • startup: $SYBASE/$SYBASE_ASE/bin/startserver -f $SYBASE/$SYBAsE_ASE/install/RUN_serverName
  • shutdown: shutdown with nowait
  • check session: sp_who
  • kill session (check with sp_who): kill spid#
  • clear transaction log (kill all running sql): dump tran database_name with truncate_only

system report

  • check memory: sp_configure memory
  • check data and log free size
    select db_name(d.dbid) as db_name,
           convert(numeric(9,2),sum(case when u.segmap != 4 then u.size/1048576.*@@maxpagesize end )) as data_size,
           convert(numeric(9,2),sum(case when u.segmap != 4 then size - curunreservedpgs(u.dbid, u.lstart, u.unreservedpgs) end)/1048576.*@@maxpagesize) as data_used,
           convert(numeric(9,2),100 * (1 - 1.0 * sum(case when u.segmap != 4 then curunreservedpgs(u.dbid, u.lstart, u.unreservedpgs) end) / sum(case when u.segmap != 4 then u.size end))) as data_used_pct,
           convert(numeric(9,2),sum(case when u.segmap = 4 then u.size/1048576.*@@maxpagesize end)) as log_size,
           convert(numeric(9,2),sum(case when u.segmap = 4 then u.size/1048576.*@@maxpagesize end) - lct_admin("logsegment_freepages",d.dbid)/1048576.*@@maxpagesize) as log_used,
           convert(numeric(9,2),100 * (1 - 1.0 * lct_admin("logsegment_freepages",d.dbid) / sum(case when u.segmap in (4, 7) then u.size end))) as log_used_pct 
    from   master..sysdatabases d, master..sysusages u
    where  u.dbid = d.dbid  and d.status not in (256,4096)
    group by d.dbid
    order by db_name(d.dbid)
    
  • check transaction log size in current database: dbcc checktable(syslogs)

⚠️ **GitHub.com Fallback** ⚠️