Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    2

    Unanswered: how to force delete a database in Sybase ?

    I have a sybase 12.5 database in my Windows machine. I accidentally deleted the "database device" for that database. As a result I don't have the Data file and Log file for the database and therefore cannot put it to "online"

    When I open Sybase Central, that database gets listed and I cannot open it. If I try to delete the entry, it gives an error saying " Device <<>> .... has not been correctly activated at startup time. Please contact a user with System Administrator (SA) role.".

    If I try to delete the database device for that DB, it gives an error, "Device is being used by a database. You can't drop it"

    I don't want this DB to be listed and would like to delete it anyway.

    Please help me.

    Regards,
    Jayaprakash

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    You can probably do this manually (but be careful!)

    sp_configure 'allow update', 1
    go
    begin tran
    go
    delete from sysusages where dbid = <dbid of database to be dropped>
    go
    -- check to make sure that only the correct rows have been deleted!!
    -- if OK:
    commit
    go
    begin tran
    go
    delete from sysdatabases where dbid= <the dbid...>
    go
    -- check to make sure that only the one you want to remove is gone
    -- if ok
    commit
    go

    shutdown with nowait

    and now restart your database...

    Michael

  3. #3
    Join Date
    May 2006
    Posts
    2
    Thanks Michael !

    It worked like a charm. :-))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •