The Erase utility
94
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 database files, write files, and transaction log
files are marked read-only to prevent accidental damage to the database and
accidental deletion of the database files.
Deleting a database file that references other dbspaces does not automatically
delete the dbspace files. If you want to delete the dbspace files on your own,
change the files from read-only to writable, and then delete the files
individually. As an alternative, you can use the DROP DATABASE
statement to erase a database and its associated 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.
The database to be erased must not be running when this utility is used.
You can access the Erase utility in the following ways:
♦ From Sybase Central
♦ From the system command line, using the
dberase
command-line utility.
This is useful for incorporating into batch or command files.
$ For more information, see the "DROP DATABASE statement" on
page 507.
Erasing a database from Sybase Central
v To erase a database file:
1 Open the Utilities folder in the left panel.
2 Double-click Erase Database in the right panel. The Erase a Database
wizard appears.
3 Follow the instructions in the wizard.
Tip
You can also access this wizard by clicking Tools➤Adaptive Server
Anywhere➤Erase Database.