DETACH [ IMAGE/SQL Administration Guide ] MPE/iX 5.5 Documentation
IMAGE/SQL Administration Guide
DETACH
Detaches a TurboIMAGE/XL database from a DBEnvironment.
Syntax
DET[ACH]
Command Prerequisites
* SET SQLDBE issued.
* SET TURBODB issued.
* DBA authority.
* Database attached.
Description
Use the DETACH command to detach a TurboIMAGE/XL database from a
DBEnvironment. Obtain exclusive access to the DBEnvironment before using
the DETACH command. Use the ISQL SELECT command to find out if it is
being accessed. (See the ATTACH command for an example of SELECT.)
SET TURBODB and SET SQLDBE commands must be issued before the detach can
take place. The database named in the most recent SET TURBODB is
detached from the DBEnvironment named in the most recent SET SQLDBE
command.
[REV BEG]
You must detach the database before performing any restructuring tasks
and reattach (using the ATTACH command) when the restructuring is
complete. You do not need to detach the database when changing the
capacity of data sets.[REV END]
When a database is detached, all mapping information about it is removed
from the ATCINFO file (DBEnvironmentNameCR). If it is the only database
attached to the DBEnvironment, the ATCINFO file itself is purged. If the
TurboIMAGE/XL database is no longer attached to any DBEnvironment, the
DBNameTC file is also purged.
In addition, all mapped table definitions are removed from the
DBEnvironment system catalog. All IMAGE/SQL views and user-created views
based on IMAGE/SQL tables and index definitions are dropped. Note that
DBUTIL can be used to purge and detach a database that is attached to a
DBEnvironment.
[REV BEG]
DETACH only affects the DBEnvironment named in the SET SQLDBE statement.
Information about tables and indices is removed from the specified
DBEnvironment.[REV END]
Example
In this example, SALES is detached from PartsDBE. When this occurs, all
mapping information about SALES is removed from the ATCINFO file. If
SALES is the only database attached to PartsDBE, the ATCINFO file itself
is purged. If SALES is no longer attached to any DBEnvironment, the
SALESTC file is also purged.
_____________________________________
| |
| :RUN IMAGESQL.PUB.SYS |
| >>SET SQLDBE PARTSDBE |
| >>SET TURBODB SALES |
| >>DETACH |
_____________________________________
MPE/iX 5.5 Documentation