sybase 快速刪除大資料庫的手順方法

2021-07-29 15:51:34 字數 843 閱讀 6519

問題描述:一般情況下,刪除資料庫通過 drop database ***x(資料庫名),但是,當資料庫比較大,好幾十個g甚至幾百g時,通過這個方法刪除資料庫是非常花時間的,有沒有辦法能夠快速刪除呢?請看以下手順。

快速刪除手順方法:

1.通過如下sql,檢視需要刪除db的dbid

select name,dbid from sysdatabases

查詢結果應該是如下形式

我們假定要刪除 test資料庫

2. 通過isql 進入資料庫,進行如下操作

sp_configure  "allow update",1go

update   sysdatabases   set   status=320   where   name='test' go

shutdown   with   nowait (注:此處重啟資料庫)go

再次通過isql進入資料庫

delete   from   sysdatabases   where   name='test'

godelete   from   sysusages   where   dbid=5 (上面查詢的結果是5)go

sp_configure  "allow update",0go

3.此時,資料中倫理資料庫已經刪除掉了,可以通過,select name,dbid from sysdatabases檢視,資料test已經不存在,但是,

還有最後一步,刪除test資料庫對應的device檔案,這個可以直接找到對應的device檔案直接刪除。 

SYBASE資料庫總結

sybase中插入資料的方式有 1.insert into b header temp cust record id select min id from c record temp group by out order no 2.select rowid identity 18 t.into b ...

sybase資料庫恢復

一 對tempdb的恢復 測試 在資料庫執行狀態下,在系統中rm刪除了擴充套件的tempdb裝置tempdbdev.dat,initializing virtual device 6,syb data tempdbdev.dat error 822,severity 20,state 2 恢復 停止...

Sybase資料庫簡介

sybase資料庫簡介 八卦一下 剛開始sybase的資料庫一般叫作sybase sql server,你沒仔細瞧還以為是微軟的sql server呢.實際上兩者是有很大關聯的.sql server最初是由microsoft sybase與ashton tate三有公司共同研發的.到最後大家合不來就...