Sybase Basic Commands

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PitCia IT (Share Knowledge SAP)

Youtube.com/pitciait

ASE Sybase Commands

Commands Description
select @@bootcount number of times server restarted since installation.
select @@boottime date and time when server was last booted.
select @@dbts timestamp of current database.
select @@error most recently generated error number by system.
select @@errorlog path of ase dataserver error log.
select @@heapmemsize size of heap memory pool in bytes.
select @@identity most recently generated identity column values.
select @@isolation session specific isolation level.
select @@kernelmode kernel mode.
select @@lastlogindate last login date and time of user.
select @@maxpagesize server’s logical page size.
select @@nestlevel current nesting level
select @@optgoal current optimization goal setting.
select @@pagesize server’s virtual page size.
select @@parallel_degree current max parallel degree setting.
select @@rowcount number of rows affected by last query.
select @@scan_parallel_degree number of parallel degree for nonclustred index scan.
select @@servername server name.
select @@setrowcount current session set rowcount setting
select @@spid spid of current session.
select @@sqlstatus status of fetch command.
select @@tempdbid temporary database id of the session.
select @@thresh_hysteresis decrease in free space to activate threshold.
select @@timeticks number of microseconds per tick.
select @@total_read total disk read
select @@total_write total disk write.
select @@tranchained current session transaction mode (0- unchained 1- chained )
select @@trancount transaction nesting level of current session.
select @@transtate current state of transaction.
select @@version version of ase server.
select @@version_as_integer base version as number
select @@version_number version as a number.
View the server options sp_configure
Update server options sp_configure 'option_name', new_value

PitCia IT
WEB | SEO | SAP | CLOUD | Mobile
Email – [email protected]
PitCia IT (Share Knowledge SAP)
Youtube.com/pitciait

Display active servers or instances showserver (executed from UNIX shell)

Access server or instance isql -Uuser -Ppswd -Sserver


Access database use dbname

List databases in server or instance sp_helpdb


List devices or files used by the sp_helpdevice
databases
Find space used or available space sp_helpdb dbname or sp_helpsegment segname or sp_spaceused
List database tables sp_help
List table characteristics sp_help tablename
List source for stored procedures sp_helptext procname
Administer security grant revoke sp_helpuser sp_addlogin sp_adduser sp_addalias
sp_dropalias sp_dropuser sp_droplogin sp_addgroup sp_helpgroup
sp_changegroup sp_password
Start a server or instance startserver -fsrvr_name (from UNIX shell)
Backup database dump database db_name to '/path/file'
Restore database load database db_name from '/path/file'
Export a text file from a table bcp table_name out filename
for example:
bcp dbase..tab1 out tab1.dat -S DBSERV1 -U someuser -P
somepasswd -c > /dev/null
Load a text file into a table bcp table_name in filename
for example:
bcp dbase..tab1 in tab1.dat -S DBSERV2 -U someuser -P somepasswd
-c > /dev/null
List connected users sp_who
Kill connected users kill spid_number
Generate DDLs defncopy
sp_displaylogin Get Logged user information
sp_locklogin Lock/Unlock sybase user
select db_name() Default Database Name - When Login default db load

PitCia IT
WEB | SEO | SAP | CLOUD | Mobile
Email – [email protected]

You might also like