Dropping Dbfiles from IQ_SYSTEM_TEMP

Issue a DROP DBSPACE command to remove a dbfile.

Prerequisites
To drop a dbfile:
  • Requires the MANAGE ANY DBSPACE system privilege.

  • The dbfile cannot contain any data from user tables. SAP Sybase IQ does not allow you to drop a dbfile unless it is empty.

  • There must be at least one read-write dbfile available in the dbspace.

  • You must commit or roll back all transactions that use older versions of tables on the dbfile.

Task
  1. Search the global temporary table schema using the system tables. Run DROP TABLE commands to relocate all objects resident on the dbfile.
    SELECT * FROM systable WHERE table_type = 'GBL TEMP'
  2. Verify that all space on the dbfile is free.
    sp_iqfile IQ_SYSTEM_TEMP
    If the OkToDrop column contains "Y", you may drop the dbfile.
  3. Drop the dbfile. For a multiplex database, use an absolute path.
    ALTER DBSPACE IQ_SYSTEM_TEMP DROP FILE FileHist3