Contents IndexThe Compression utility The Information utility

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 39. SQL Anywhere Components
      The Erase utility

With the Erase utility, you can erase a database file or write file and its associated transaction log, or you can erase a transaction log file or transaction log mirror file. All SQL Anywhere database files, write files, and transaction log files are marked read-only to prevent accidental damage to the database or accidental deletion of the database files. Deletion of a database file that references other dbspaces does not automatically delete the dbspace files.

If you erase a database file or write file, the associated transaction log and transaction log mirror are also deleted. If you erase a transaction log for a database that also maintains a transaction log mirror, the mirror is not deleted.

You can access the Erase utility in the following ways:

Top of page


Erasing a database from Sybase Central

To erase a database file:

  1. Open the Database Utilities folder in the left panel.
  2. Double-click Erase Database in the right panel. The Erase a Database Wizard is displayed.
  3. Follow the instructions in the Wizard.

For full information on erasing a database from Sybase Central, see the Sybase Central online Help.

Top of page


Erasing a database from the ISQL Database Tools window

To use the Erase utility from the ISQL Database Tools window:

  1. Select Database Tools from the Window menu.
  2. Click Erase Database or Write File on the Tools list.
  3. Enter the filename (with path).
  4. Click Erase, and select from the options displayed in the dialog.
  5. Click OK to erase the selected files.

Top of page


Erasing a database using the DBTOOL statement

Syntax

The syntax for the Erase utility from the ISQL DBTOOL statement is as follows:

     drop database database-file [ noconfirm ]

The database-file may be a database file, write file, or transaction log file. The full filename must be specified, including extension. If a database file or write file is specified, the associated transaction log file (and mirror, if one is maintained) is also erased.

Example

The following statement erases the database file C:\TEMP.DB and its associated transaction log file, prompting to confirm deletion.

     DBTOOL DROP DATABASE 'c:\temp.db'

Top of page


The DBERASE command-line utility

Syntax

     dberase [switches] database-file

Windows 3.x syntax

     dberasew [switches] database-file

Switch Description
-o Output log messages to file
-q Operate quietly---do not print messages
-y Erase files without confirmation

The database-file may be a database file, write file, or transaction log file. The full filename must be specified, including extension. If a database file or write file is specified, the associated transaction log file (and mirror, if one is maintained) is also erased.

  For more information about the command-line switches, see "Erase utility options".

Top of page


Erase utility options

Output log messages to file (-o ) Redirect log messages to the named file. Do not display messages on a window For the DBERASE command-line utility, this is the -q command-line switch. This option is available only from the command-line utility.

Operate without confirming actions (-y ) Without this option, you are prompted to confirm the deletion of each file.

Top of page


Contents IndexThe Compression utility The Information utility