- 論壇徽章:
- 34
|
本帖最后由 wfcjz 于 2015-09-21 10:44 編輯
一、先刪除設(shè)備
- sp_dropsegment "default",saptempdb,saptempdb_device_name //你的saptempdb掛載的設(shè)備名)
- sp_dropsegment "system",tempdb,saptempdb_device_name //你的saptempdb掛載的設(shè)備名)
- -- 轉(zhuǎn)master庫
- use master
- sp_configure "allow update",1
- delete sysusages where dbid=2 and vstart=150994944 //vstart可sp_helpdevice獲取
- sp_configure "allow update",0
- sp_dropdevice saptempdb_device_name // //你的saptempdb掛載的設(shè)備名)
復(fù)制代碼 二、刪除數(shù)據(jù)庫
1、如果數(shù)據(jù)庫的狀態(tài)正常,直接使用就可以刪除數(shù)據(jù)庫
2、如果數(shù)據(jù)庫為可疑狀態(tài),則使用 dbcc命令 刪除,命令格式如下- dbcc dbrepair(pubs,dbdrop)
復(fù)制代碼 sybase的官方說法: If a database has a large enough number of inconsistencies,the server may consider the databASE to be corrupt。In this situation,the database cannot be dropped wITh the drop database command
The database can be dropped only with dbcc dbrepair Syntax:
dbcc dbrepair(dbname,dropdb)
Example:
dbcc dbrepair(pubs2,dropdb)
Note: sa_role is required to run dbcc dbrepair.
3.如果還不行,那么就這樣-
- sp_configure "allow update",1
- update sysdatabases set status=320 where name = yourdatabasename
- shutdown with nowait
復(fù)制代碼 再啟動SYBASE,- delete from sysdatabase where name =database_name
- delete from sysusages where dbid=database_id
- sp_configure "allow update",0
-
復(fù)制代碼 Good luck! |
|