All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class interbase.interclient.Server

java.lang.Object
   |
   +----interbase.interclient.Server

public final class Server
extends Object
InterClient Extension for future release

This class is used for administrating an InterBase server.

In addition to the InterBase service which operates on InterBase databases, a guardian process known as the InterBase administration service exists for administrating the server as a whole.

The InterBase administration service can be used for starting and stopping the InterBase service, or for operating on database files directly.

Only sysdba can obtain a Server object, thereby administering an InterBase server; other users access database information thru a Connection or DatabaseMetaData and are not allowed Server access.

See Also:
getServer

Method Index

 o activateIndices(String, boolean)
Toggle use of database indices. InterClient Extension.
 o addUser(String, String)
Register a user in isc4.gdb InterClient Extension.
 o backup(boolean, boolean, boolean, boolean, boolean, String, String)
Backup a database. InterClient Extension.
 o backup(boolean, String, String)
Backup a database. InterClient Extension.
 o changePassword(String, String)
Change the password for a registered user in isc4.gdb. InterClient Extension.
 o commitLimboTransaction(String, int)
Attempt to commit a limbo transaction. InterClient Extension.
 o createDatabase(String)
Create a database using the default page size and cache buffers. InterClient Extension.
 o createDatabase(String, int, int, String[], int[])
Create a database using the specified page size and stamp the number of cache buffers to use for this database onto the database header page. InterClient Extension.
 o createShadow(String, String)
Create a database shadow file for the database. Deprecated. InterClient Extension.
 o createShadow(String, String, int)
Create a database shadow file for the database. Deprecated. InterClient Extension.
 o createShadow(String, String, int, String[], int[])
Create a database shadow for a multi-file database. Deprecated. InterClient Extension.
 o deregister(String)
Remove a registered database from isc4.gdb InterClient Extension.
 o dropDatabase(String)
Remove the database file, and degregister it. InterClient Extension.
 o dropShadow(String)
Delete a database shadow file. InterClient Extension.
 o dropUser(String)
Remove a registered user from isc4.gdb InterClient Extension.
 o enableAutomaticSweeping(String, boolean)
Enable/disable automatic housekeeping of old record versions. InterClient Extension.
 o getCacheBuffers(String)
Get the suggested number of cache page buffers to use for a database. InterClient Extension.
 o getDefaultCacheBuffers()
Get the default suggested number of cache buffers the server will use for database attachments. InterClient Extension.
 o getDefaultPageSize(int)
Get the default page size that will be used by the createDatabase() method. InterClient Extension.
 o getLengths(String)
Get the lengths of all secondary files for a multi-file database. InterClient Extension.
 o getLimboTransactionIds(String)
Get the limbo transactions for the database. InterClient Extension.
 o getLockActivity(String)
Get a continuous stream of InterBase lock activity for the database. InterClient Extension.
 o getRegisteredDatabases()
Returns an array of database files registered in isc4.gdb. InterClient Extension.
 o getSecondaryFiles(String)
Get the secondary files for a multi-file database. InterClient Extension.
 o getStatistics()
Get server-wide statistics accumulated since the InterBase service started. InterClient Extension.
 o getUsers()
Returns an array of users registered in isc4.gdb. InterClient Extension.
 o getUsersConnected()
Returns an array of users currently connected to server. InterClient Extension.
 o getUsersConnected(String)
Returns an array of users currently connected to database. InterClient Extension.
 o limitNumberOfConnections(String, int)
Limit the number of connections to a database. InterClient Extension.
 o markAsDamaged(String)
Mark the database as damaged. InterClient Extension.
 o move(String, String)
Change the name or physical location of a database. InterClient Extension.
 o register(String)
Register a database in isc4.gdb InterClient Extension.
 o repair(String)
Release unassigned pages and record fragments. InterClient Extension.
 o restore(String, String)
Restore a database from a backup file. InterClient Extension.
 o restore(String, String, int, String[], int[])
Restore a database from a backup file. InterClient Extension.
 o restore(String, String, int, String[], int[], boolean, boolean, boolean, boolean, String[])
Restore a database from a backup file. InterClient Extension.
 o rollbackLimboTransaction(String, int)
Rollback a limbo transaction. InterClient Extension.
 o setCacheBuffers(String, int)
Set the suggested number of cache page buffers to use for a database. InterClient Extension.
 o setSweepInterval(String, int)
Set the sweep interval for automatic sweeping. InterClient Extension.
 o shutdown()
Shut down the InterBase service. InterClient Extension.
 o shutdown(String, boolean, boolean, boolean, int)
Prevent further database connections or transactions, or force the shutdown of existing ones. InterClient Extension.
 o startup(ServerProperties)
Start the InterBase service to allow for database connections. InterClient Extension.
 o sweep(String)
Manually sweep the database of old record versions. InterClient Extension.
 o twoPhaseCommitLimboTransactions(String)
Attempt to resolve all limbo transactions using two-phase commit. InterClient Extension.
 o verify(String)
Check the database for checksum errors, and unassigned or corrupt pages. InterClient Extension.

Methods

 o startup
  public synchronized void startup(ServerProperties properties) throws SQLException
InterClient Extension for future release

Start the InterBase service to allow for database connections.

Throws: SQLException
Not yet implemented.
 o shutdown
  public synchronized void shutdown() throws SQLException
InterClient Extension for future release

Shut down the InterBase service.

Throws: SQLException
Not yet implemented.
 o shutdown
  public synchronized void shutdown(String database,
                                    boolean force,
                                    boolean blockNewConnections,
                                    boolean blockNewTransactions,
                                    int timeout) throws SQLException
InterClient Extension for future release

Prevent further database connections or transactions, or force the shutdown of existing ones.

Periodically you will want to shut down a database for backups and restores. Backup saves only the current committed version of each record while also putting all the data for each relation on contiguous pages in the database. Restore will rebuild all the indices and reset the statistics for each. This usually will increase performance significantly.

Throws: SQLException
Not yet implemented.
 o createDatabase
  public synchronized void createDatabase(String database) throws SQLException
InterClient Extension for future release

Create a database using the default page size and cache buffers. The default page size and cache buffers for the server can be configured using the ServerProperties.setDefaultPageSize() and ServerProperties.setDefaultCacheBuffers() methods.

Registers the database automatically.

Throws: SQLException
Not yet implemented.
See Also:
setDefaultPageSize
 o createDatabase
  public synchronized void createDatabase(String database,
                                          int pageSize,
                                          int cacheBuffers,
                                          String secondaryFiles[],
                                          int lengths[]) throws SQLException
InterClient Extension for future release

Create a database using the specified page size and stamp the number of cache buffers to use for this database onto the database header page.

Throws: SQLException
Not yet implemented.
 o dropDatabase
  public synchronized void dropDatabase(String database) throws SQLException
InterClient Extension for future release

Remove the database file, and degregister it.

Throws: SQLException
Not yet implemented.
 o getRegisteredDatabases
  public synchronized String[] getRegisteredDatabases() throws SQLException
InterClient Extension for future release

Returns an array of database files registered in isc4.gdb. A database browser will work off this list.

Throws: SQLException
Not yet implemented.
 o register
  public synchronized void register(String database) throws SQLException
InterClient Extension for future release

Register a database in isc4.gdb

Throws: SQLException
Not yet implemented.
 o deregister
  public synchronized void deregister(String database) throws SQLException
InterClient Extension for future release

Remove a registered database from isc4.gdb

Throws: SQLException
Not yet implemented.
 o addUser
  public synchronized void addUser(String user,
                                   String password) throws SQLException
InterClient Extension for future release

Register a user in isc4.gdb

Throws: SQLException
Not yet implemented.
 o dropUser
  public synchronized void dropUser(String user) throws SQLException
InterClient Extension for future release

Remove a registered user from isc4.gdb

Throws: SQLException
Not yet implemented.
 o changePassword
  public synchronized void changePassword(String user,
                                          String newPassword) throws SQLException
InterClient Extension for future release

Change the password for a registered user in isc4.gdb.

Throws: SQLException
Not yet implemented.
 o getUsers
  public synchronized String[] getUsers() throws SQLException
InterClient Extension for future release

Returns an array of users registered in isc4.gdb.

Throws: SQLException
Not yet implemented.
 o getUsersConnected
  public synchronized String[] getUsersConnected() throws SQLException
InterClient Extension for future release

Returns an array of users currently connected to server.

Throws: SQLException
Not yet implemented.
 o getUsersConnected
  public synchronized String[] getUsersConnected(String database) throws SQLException
InterClient Extension for future release

Returns an array of users currently connected to database.

Throws: SQLException
Not yet implemented.
 o backup
  public synchronized void backup(boolean transportable,
                                  String database,
                                  String backupFile) throws SQLException
InterClient Extension for future release

Backup a database.

Backup always stores the database backup to a single gbak file. Garbage collection of old record versions is performed by default.

Throws: SQLException
for checksum errors or limbo transactions.
 o backup
  public synchronized void backup(boolean transportable,
                                  boolean ignoreLimboTransactions,
                                  boolean ignoreChecksums,
                                  boolean metaDataOnly,
                                  boolean inhibitGarbageCollection,
                                  String database,
                                  String backupFile) throws SQLException
InterClient Extension for future release

Backup a database.

Issues a SQLWarning for checksum errors and limbo transactions

Throws: SQLException
Not yet implemented.
 o restore
  public synchronized void restore(String backupFile,
                                   String database) throws SQLException
InterClient Extension for future release

Restore a database from a backup file.

Throws: SQLException
if the database can't be verified, or if validity constraints are violated. Not yet implemented.
 o restore
  public synchronized void restore(String backupFile,
                                   String database,
                                   int pageSize,
                                   String secondaryFiles[],
                                   int lengths[]) throws SQLException
InterClient Extension for future release

Restore a database from a backup file.

secondaryFiles argument may be null if you're only changing pageSize.

Throws: SQLException
if the database can't be verified, or if validity constraints are violated. Not yet implemented.
 o restore
  public synchronized void restore(String backupFile,
                                   String database,
                                   int pageSize,
                                   String secondaryFiles[],
                                   int lengths[],
                                   boolean inactivateIndices,
                                   boolean dropValidityConstraints,
                                   boolean dropShadow,
                                   boolean incremental,
                                   String tables[]) throws SQLException
InterClient Extension for future release

Restore a database from a backup file.

If the tables argument is non-null then restore only those tables.

The database page size decides how much data will be retrieved with one logical access from the database. The default is 1K (1024 bytes) with 2K, 4K, and 8K the other allowed values. A single logical access from the database may involve multiple physical accesses. For example, on most UNIX systems, the default number of bytes retrieved in a single physical access is 512. For a 1K page size, two physical accesses occur for every logical access. There is a tradeoff then between reading/writing the most data versus physical I/O. The proper page size will be determined by your database requirements, i.e., is the database mostly for reading, update intensive, or a combination? Is accessing BLOBS or ARRAYS a priority? What is the record size of your main table, the table that will be accessed most often?

Database page size will also influence the tuning of indices. The section on performance monitoring will review the tool called gstat that can analyze the layout of an index. If there are too many levels in the index then increasing the page size will flatten the index structures and usually improve performance. Another rule of thumb is to try to keep the indices on the main table to three or fewer levels.

The only way to change the database's page size after creation is to backup and then restore the database with a different page size. Page 110 in the Windows Client User's Guide details how to do this. Note that databases on Windows 3.1 and Windows NT can only have a page size of 1024.

The database can also be made up of many different files. This allows you to effectively use the available disk space on multiple volumes. The user always refers to the first file, the database name, and never has to know about the secondary files. This also allows a database to be larger than the operating system limit for a single file. This does not allow the DBA to specify in which file individual objects in the database may be placed. In other words, you cannot assign Relation A to the first file, Relation B to the second file and the indices for both to the third file. The files are used and filled in sequential order and can contain data from any table or index in the database.

The only way to change the number of database files after creation is to backup and then restore the database specifying the secondary files and the attributes. Page 109 in the Windows Client User's Guide details how to do this.

Throws: SQLException
Not yet implemented.
 o activateIndices
  public synchronized void activateIndices(String database,
                                           boolean activate) throws SQLException
InterClient Extension for future release

Toggle use of database indices.

Throws: SQLException
Not yet implemented.
 o move
  public synchronized void move(String database,
                                String newDatabase) throws SQLException
InterClient Extension for future release

Change the name or physical location of a database.

Note: Move cannot be used to split a database or change its page size; Backup and restore must be used to split a database into multiple files or change its page size.

Throws: SQLException
Not yet implemented.
 o enableAutomaticSweeping
  public synchronized void enableAutomaticSweeping(String database,
                                                   boolean on) throws SQLException
InterClient Extension for future release

Enable/disable automatic housekeeping of old record versions.

Sweeping can be performed manually or automatically. By default, when the OIT is 20,001 transactions less then the Next Transaction number, which is also kept on the database header page, the process that tried to start the transaction will sweep the entire database and remove as many BDRs as possible. While this is happening, other users can continue to use the database.

If you are going to start the sweep manually then it is advised that you first make sure there is no one connected to the database. This will not only clean out the BDRs and clean out the erased records, but also update the OIT number on the header page to be one less than the Next Transaction number. It can do this because there are no other active transactions that might need to see any of the BDRs.

Throws: SQLException
Not yet implemented.
See Also:
sweep
 o sweep
  public synchronized void sweep(String database) throws SQLException
InterClient Extension for future release

Manually sweep the database of old record versions.

Even with our efficiencies in keeping the BDRs small, the database can still accumulate a great deal of unnecessary generations, i.e. garbage. There are two ways to clean out all the garbage from the database. The first is called Cooperative Garbage Collection. It happens automatically every time a record is touched, on a select, update, or delete operation. When the record is touched, the InterBase kernel follows the pointers to each BDR and compares it's transaction number with what's called the Oldest Interesting Transaction (OIT). This number is kept in the header page for the database. If the BDR's transaction number is less than the OIT, then the BDR can be purged from the database and the space reclaimed for new data. This will not clean up deleted records and their BDRs.

Throws: SQLException
Not yet implemented.
See Also:
enableAutomaticSweeping
 o setSweepInterval
  public synchronized void setSweepInterval(String database,
                                            int num) throws SQLException
InterClient Extension for future release

Set the sweep interval for automatic sweeping.

Throws: SQLException
Not yet implemented.
 o createShadow
  public synchronized void createShadow(String database,
                                        String shadowURL) throws SQLException
Note: createShadow() is deprecated.

InterClient Extension for future release

Create a database shadow file for the database.

Another physical property is the ability to create shadows of the database. Shadows are carbon copies of the database, an exact duplicate. The main reason for shadows is to protect yourself from hardware failure. First you have to set up one or more shadows on other disk partitions or better still, other machines. The if your primary disk or server fails the users can reconnect to the shadow after the DBA has enabled it. This is much quicker than restoring from a backup.

Shadows can also be composed of multiple files just like normal databases.

The major drawback to shadows is that they increase the number of writes the database server does. If you have only one shadow then every write is duplicated. Two shadows and every write is tripled. This can cause performance problems.

Throws: SQLException
Not yet implemented.
 o createShadow
  public synchronized void createShadow(String database,
                                        String shadowURL,
                                        int pageSize) throws SQLException
Note: createShadow() is deprecated.

InterClient Extension for future release

Create a database shadow file for the database.

Throws: SQLException
Not yet implemented.
 o createShadow
  public synchronized void createShadow(String database,
                                        String shadowURL,
                                        int pageSize,
                                        String secondaryFiles[],
                                        int lengths[]) throws SQLException
Note: createShadow() is deprecated.

InterClient Extension for future release

Create a database shadow for a multi-file database.

Throws: SQLException
Not yet implemented.
 o dropShadow
  public synchronized void dropShadow(String shadowURL) throws SQLException
InterClient Extension for future release

Delete a database shadow file.

Throws: SQLException
Not yet implemented.
 o verify
  public synchronized void verify(String database) throws SQLException
InterClient Extension for future release

Check the database for checksum errors, and unassigned or corrupt pages.

Throws: SQLException
Not yet implemented.
 o markAsDamaged
  public void markAsDamaged(String database) throws SQLException
InterClient Extension for future release

Mark the database as damaged.

Connection requests should throw a SQLException for damaged databases.

Throws: SQLException
Not yet implemented.
 o limitNumberOfConnections
  public synchronized void limitNumberOfConnections(String database,
                                                    int maxUsers) throws SQLException
InterClient Extension for future release

Limit the number of connections to a database.

Throws: SQLException
Not yet implemented.
 o repair
  public synchronized void repair(String database) throws SQLException
InterClient Extension for future release

Release unassigned pages and record fragments.

Note: Clearly this cannot repair corrupt databases in general.

Throws: SQLException
Not yet implemented.
 o getLimboTransactionIds
  public synchronized int[] getLimboTransactionIds(String database) throws SQLException
InterClient Extension for future release

Get the limbo transactions for the database.

Throws: SQLException
Not yet implemented.
 o rollbackLimboTransaction
  public synchronized void rollbackLimboTransaction(String database,
                                                    int transactionId) throws SQLException
InterClient Extension for future release

Rollback a limbo transaction.

Throws: SQLException
Not yet implemented.
 o commitLimboTransaction
  public synchronized void commitLimboTransaction(String database,
                                                  int transactionId) throws SQLException
InterClient Extension for future release

Attempt to commit a limbo transaction.

Throws: SQLException
Not yet implemented.
See Also:
getTransactionId
 o twoPhaseCommitLimboTransactions
  public synchronized void twoPhaseCommitLimboTransactions(String database) throws SQLException
InterClient Extension for future release

Attempt to resolve all limbo transactions using two-phase commit.

Throws: SQLException
Not yet implemented.
 o getSecondaryFiles
  public synchronized String[] getSecondaryFiles(String database) throws SQLException
InterClient Extension for future release

Get the secondary files for a multi-file database.

Throws: SQLException
Not yet implemented.
 o getLengths
  public synchronized int[] getLengths(String database) throws SQLException
InterClient Extension for future release

Get the lengths of all secondary files for a multi-file database.

Throws: SQLException
Not yet implemented.
 o setCacheBuffers
  public synchronized void setCacheBuffers(String database,
                                           int buffers) throws SQLException
InterClient Extension for future release

Set the suggested number of cache page buffers to use for a database. This is a persistent property of the database and is stamped onto the database header page.

By default, Server.createDatabase() stamps a zero onto the database header page. If this value is non-zero, it takes precedence over both the server-wide and connection-wide settings (ServerProperties.setDefaultCacheBuffers(), and ConnectionProperties.setCacheBuffers()).

Superserver allocates a separate page buffer cache per database.

Throws: SQLException
Not yet implemented.
See Also:
getCacheBuffers, setDefaultCacheBuffers, setCacheBuffers
 o getCacheBuffers
  public synchronized int getCacheBuffers(String database) throws SQLException
InterClient Extension for future release

Get the suggested number of cache page buffers to use for a database.

Throws: SQLException
Not yet implemented.
See Also:
setCacheBuffers
 o getDefaultPageSize
  public int getDefaultPageSize(int pageSize) throws SQLException
InterClient Extension for future release

Get the default page size that will be used by the createDatabase() method.

Throws: SQLException
Not yet implemented.
See Also:
setDefaultPageSize, createDatabase
 o getDefaultCacheBuffers
  public int getDefaultCacheBuffers() throws SQLException
InterClient Extension for future release

Get the default suggested number of cache buffers the server will use for database attachments.

Throws: SQLException
Not yet implemented.
See Also:
setDefaultCacheBuffers, getCacheBuffers, getCacheBuffers
 o getStatistics
  public synchronized ServerStatistics getStatistics() throws SQLException
InterClient Extension for future release

Get server-wide statistics accumulated since the InterBase service started.

Throws: SQLException
Not yet implemented.
 o getLockActivity
  public synchronized InputStream getLockActivity(String database) throws SQLException
InterClient Extension for future release

Get a continuous stream of InterBase lock activity for the database.

Returns:
gds_lock_print info as an ascii stream.
Throws: SQLException
Not yet implemented.

All Packages  Class Hierarchy  This Package  Previous  Next  Index