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:
For full information on erasing a database from Sybase Central, see the Sybase Central online Help.
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.
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'
dberase [switches] database-file
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".
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.