sp_helpdb

Description

Reports information about a particular database or about all databases.

Syntax

sp_helpdb [dbname]

Parameters

dbname

is the name of the database on which to report information. Without this optional parameter, sp_helpdb reports on all databases. dbname can include wildcard characters to return all databases that match the specified pattern.

Examples

Example 1

Displays information about all the databases in Adaptive Server:

sp_helpdb

name	            db_size  owner dbid created        status
--------------  -------- ----- ---- -------------- ------------------
master           5.0 MB   sa    1   Jan 01, 1900   no options set
model            2.0 MB   sa    3   Jan 01, 1900   no options set
pubs2            2.0 MB   sa    6   Sep 20, 1995   no options set
sybsystemprocs   16.0 MB  sa    4   Sep 20, 1995   trunc log on chkp
tempdb           2.0 MB   sa    2   Sep 20, 1995   select into/bulkcopy

Example 2

Issued from within pubs2, displays information about the pubs2 database, and includes segment information:

sp_helpdb pubs2

name   db_size  owner  dbid  created       status 
-----  -------  -----  ----  ------------  ---------------------- 
pubs2  2.0 MB   sa     4     Mar 05, 1993  abort tran when log full

device_fragments   size    usage         free kbytes
-----------------  ------  ------------  -------------
master             2.0 MB  data and log            576 

device                         segment                        
------------------------------ ------------------------------ 
master                         default                        
master                         logsegment                     
master                         system                         

name    attribute_class attribute     int_value char_value  comments
------- --------------- ------------- --------- ----------- --------
pubs2   buffer manager  cache binding         1 pubs2_cache     NULL

Example 3

Not issued from within pubs2, displays information about the pubs2 database:

sp_helpdb pubs2

name   db_size  owner  dbid  created       status                                                                                                 
-----  -------  -----  ----  ------------  ---------------------- 
pubs2  2.0 MB    sa     4    Mar 05, 1993  abort tran when log full

device_fragments      size    usage           free kbytes
-----------------     ------  ------------  -------------
master                2.0 MB  data and log            576 

name    attribute_class attribute     int_value char_value  comments
------- --------------- ------------- --------- ----------- --------
pubs2   buffer manager  cache binding         1 pubs2_cache     NULL

Example 4

Displays the row lock promotion attributes set for the pubtune database:

sp_helpdb pubtune

name                           attribute_class
attribute                      int_value
         char_value
         comments
-----------------------------------------------------------
pubtune                        lock strategy             
     row lock promotion                    NULL
     PCT = 95, LWM = 300, HWM = 300

Usage

Permissions

Any user can execute sp_helpdb.

See also

Commands alter database, create database

System procedures sp_configure, sp_dboption, sp_rename