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