Guidelines for Dropping a Dbspace

Issue a DROP DBSPACE command to remove a database file.

To drop a dbspace:
To empty a dbspace, you must:

Because of the way Sybase IQ fills dbspaces with data, it is unlikely that a dbspace will become empty only after explicitly relocating tables and join indexes, especially if disk striping is in use. Typically, you cannot empty a dbspace by truncating the tables in it, as even an empty table takes some space. To relocate the tables, use ALTER TABLE MOVE.

If you relocate a table while other users are reading from it, the normal rules of table versioning apply, that is, old table versions persist until the transactions of the readers complete.

A DBA can determine the dbspace in which tables and indexes are located by running the stored procedures sp_iqspaceinfo, sp_iqdbspaceinfo, and sp_iqindexinfo. These procedures show the number of blocks used by each table, join index, and index in each dbspace.

To find out whether you can drop a particular dbspace, run sp_iqdbspace. Look at the Block Types column (Blk Types), which tells you the contents of each dbspace. You can drop a dbspace if it contains block types “H,” “F,” “R,” “B,” “X,” and “C,” but not other block types.

Block type “A” is data from active table versions. Use sp_iqdbspaceinfo to determine which tables to relocate.

Block type “O” indicates old versions that may still be in use. You must roll back or commit active connections to release this space. Block type “M” indicates multiplex.

For instructions on using Sybase Control Center to delete a dbspace, see the Sybase Control Center for Sybase IQ online help in SCC or at http://sybooks.sybase.com/nav/summary.do?prod=10680.