How to remove a device from a sybase database?

  • Many thanks in advance.

  • sp_dropdevice not working?

     

  • If a device is not allocated to a database, sp_dropdevice works. After allocating a device to a database, I got the error message: the device is in use!

    Actually, I just would like to remove a device from a database, not drop it from a database.

    Sybase is much harder to manage than SQL Server.

    Thank you so much for your input.

  • You have me confused. 

    Perhaps you are trying to do what MSSQL allows you to do: detach and attach.  If that is the case it is not allowed in Sybase. (Disclaimer: last time I looked was syb system 10, last time I taught sybase was the version before that).

    Once a device is in use it needs to stay in use until you want to get rid of everything.  So then you have to ,drop databases using it then drop the device.  If you want to move to a different device, it was not a simple thing (though as long as size/allocations were the same I think you could dump-dropdb-dropdev-init-createdb-restore).

    While microsoft's features of attach and detach are handy, they make old school database people like me cringe.  (But I still use attach and detach all the time on my laptop server.)

    EDIT: on second read I think I get it you have a database spanning devices and want to eliminate one of them.  There may be fancier tools/methods in latest edition, but from what I remember, you'd have to do the dump, create a same size diskinit on a different drive to replace the device you want to get rid of drop the database, allocate database in same device segments orders before restoring the database. 

  • Could you attach the results of dbname..sp_helpdb dbname ? 

    What version of Sybase and what EBF level are you at ?

    Is the device that you need to remove a data device or a log device ?

    Is the device to be removed the last device that you allocated to the database ?

    Once you have answered these questions I can let you know if it possible since I have  performed this in the past. Be wary though, you will need to have ts_support_role enables for the sa account and you will have to edit a system table or two. There are a couple of 'unsupported' methods. One from the internet and another I acquired from Sybase Support.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply