FBIRD_DB_INFO
Purpose
Use the fbird_db_info function to gather
statistical information about a database.
Syntax
<db_info> ::= fbird_db_info(
svc_hndl, db, what_1 [, what_2] )
Element
|
Type
|
Description
|
svc_hndl
|
resource
|
A valid service handle
|
db
|
string
|
A database name
|
what_1
|
int
|
Requested data items (OR'ed with what_2)
|
what_2
|
int
|
Requested data items (OR'ed with what_1)
|
<return>
|
mixed
|
String on success, False on failure
|
Semantics
The fbird_db_info function returns statistical
information about a database, similar to using the 'gstat' command.
The db parameter is a path to a database or a database alias. Note
that it is not necessary to specify the server portion, as you would
in a connection string: the service handle already specifies which
server you are talking too.
The following table lists the options that can be
specified for the what_1 and what_2 parameters. The values can be
OR'ed together to request multiple data items at once:
Flag
|
Meaning
|
|
IBASE_STS_DATA_PAGES
|
Request statistics for user data pages;
similar to 'gstat -data'
|
|
IBASE_STS_DB_LOG
|
Request the information in the database log;
similar to 'gstat -log'
|
|
IBASE_STS_HDR_PAGES
|
Request the information in the database header
pages; similar to 'gstat -header'
|
|
IBASE_STS_IDX_PAGES
|
Request statistics for the user index pages;
similar to 'gstat -index'
|
|
IBASE_STS_SYS_RELATIONS
|
Request statistics for system tables and
indexes; similar to 'gstat -system'
|
Example
The below example retrieves the information
located on the database header pages:
$svc = fbird_service_attach('localhost',
'sysdba', 'masterkey') $info = fbird_db_info($svc,
'path/to/db.fdb',
IBASE_STS_HDR_PAGES); fbird_service_detach($svc); echo
$db_info;
See also
fbird_service_attach,
fbird_service_detach,
fbird_server_info
|