<< ibec_OnlineDatabase | IBEBlock | ibec_DropDatabase >>

ibec_ShutdownDatabase

Syntax

 function ibec_ShutdownDatabase(Database : string; Options : string) : variant;

ibec_ShutdownDatabase performs a shutdown of the database specified with the Databaseparameter (connection string for the database) using the Firebird Services API.

The Options variable specifies additional connect and shutdown parameters:

Connection options

User=<user_name>User Name
Password=<password>Password
ClientLib=<path>Path to the client library file

Shutdown options

Support of online/shutdown modes (Firebird 2.5 and above) was added in IBExpert version 2014.01.01.

Wait=<seconds>Timeout in seconds
DenyTransaction | DenyAttachmentShutdown Action
Mode=<mode>Shutdown mode. Possible values are Multi, Single and Full. If Mode is not specified Multi will be used by default. This option is available for Firebird 2.5 and above.

ibec_ShutdownDatabase returns NULL in case of success. Otherwise it returns an error message.

Examples

1. Shutdown a database aborting all connections and transactions

    Res = ibec_ShutdownDatabase('localhost:d:\data\mydb.fdb',
                            'ClientLib="d:\FBlientLibs\fbclient25.dll";
                             User=SYSDBA; Password=masterkey');

2. Shutdown a database preventing new connections

    Res = ibec_ShutdownDatabase('localhost:d:\data\mydb.fdb',
                            'ClientLib="d:\FBlientLibs\fbclient25.dll";
                             User=SYSDBA; Password=masterkey; DenyConnection');

3. Shutdown a database preventing new transactions

    Res = ibec_ShutdownDatabase('localhost:d:\data\mydb.fdb',
                            'ClientLib="d:\FBlientLibs\fbclient25.dll";
                             User=SYSDBA; Password=masterkey; DenyTransaction');

4. Shutdown with timeout 1 minute

    Res = ibec_ShutdownDatabase('localhost:d:\data\mydb.fdb',
                            'ClientLib="d:\FBlientLibs\fbclient25.dll";
                             User=SYSDBA; Password=masterkey; Wait=60');

5. Shutdown and don't allow any connections from anyone, even SYSDBA or the database owner.

    Res = ibec_ShutdownDatabase('localhost:d:\data\mydb.fdb',
                            'ClientLib="d:\FBlientLibs\fbclient25.dll";
                             User=SYSDBA; Password=masterkey; Mode=Full');

back to top of page
<< ibec_OnlineDatabase | IBEBlock | ibec_DropDatabase >>