Msg 3702:Cannot drop the database 'gcard' because it is currently in use.
刪除資料庫時提示資料庫正在使用,無法刪除問題
1> select db_name()
2> go
------------------------------------------------------------
master
(1 row affected)
1> drop database gcard
2> go
Msg 3702, Level 16, State 4:
Server 'SYBASE', Line 1:
Cannot drop the database 'gcard' because it is currently in use.
1>
1> alter database gcard set single_user with rollback immediate
2> go
Msg 156, Level 15, State 2:
Server 'SYBASE', Line 1:
Incorrect syntax near the keyword 'with'.
1>
解決辦法:
1、使用sp_who檢視與所要刪除資料庫的相關程式資訊
1> sp_who
2> go
fid spid status loginame origname hostname blk_spid dbname tempdbname cmd block_xloid threadpool
------ -------- -------------------- ---------------- ---------------- ---------------- ---------------- ------------ -------------------- ---------------------------------- ---------------------- --------------------------------
0 11 background NULL NULL NULL 0 gcard tempdb REP AGENT 0 NULL
(12 rows affected)
(return status = 0)
1>
2、kill掉相關程式
1> kill 11 with force
2> go
1> sp_who
2> go
3、刪庫
1> drop database gcard
2> go
-------------END-----------
1> select db_name()
2> go
------------------------------------------------------------
master
(1 row affected)
1> drop database gcard
2> go
Msg 3702, Level 16, State 4:
Server 'SYBASE', Line 1:
Cannot drop the database 'gcard' because it is currently in use.
1>
1> alter database gcard set single_user with rollback immediate
2> go
Msg 156, Level 15, State 2:
Server 'SYBASE', Line 1:
Incorrect syntax near the keyword 'with'.
1>
解決辦法:
1、使用sp_who檢視與所要刪除資料庫的相關程式資訊
1> sp_who
2> go
fid spid status loginame origname hostname blk_spid dbname tempdbname cmd block_xloid threadpool
------ -------- -------------------- ---------------- ---------------- ---------------- ---------------- ------------ -------------------- ---------------------------------- ---------------------- --------------------------------
0 11 background NULL NULL NULL 0 gcard tempdb REP AGENT 0 NULL
(12 rows affected)
(return status = 0)
1>
2、kill掉相關程式
1> kill 11 with force
2> go
1> sp_who
2> go
3、刪庫
1> drop database gcard
2> go
-------------END-----------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29634949/viewspace-1991316/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PostgreSQL DBA(138) - PG 13(Drop database force)SQLDatabase
- ORA-01623: log is current log for thread - cannot dropthread
- Error:Cannot build artifact xxx:war exploded‘ because it is included into a circular dependencyErrorUI
- ORA-01102: cannot mount database in EXCLUSIVE modeDatabase
- Cannot load from short array because "sun.awt.FontConfiguration.head" is nullNull
- 6、MySQL刪除資料庫(DROP DATABASE語句)MySql資料庫Database
- sqlserver bulk insert報錯Cannot bulk load because the file could not be opened.SQLServer
- [20200416]ORA-01187 cannot read from file because it failed verification tests.AI
- [20181011]ORA-65086 cannot openclose the pluggable database.txtDatabase
- SQL1116N A connection to or activation of database "TESTDB" cannot be madeSQLDatabase
- Dynamics CRM the field cannot be deleted because it is used in one or more process的解決方法delete
- iis 0x80070032 Cannot read configuration file because it exceeds the maximum file size
- [20181011]ORA-44777 – Pluggable database service cannot be started.txtDatabase
- CMake Error: add_executable cannot create target ““ because another target with the same name已解決Error
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- msg檔案檢視工具:Msg Viewer Pro for Mac 直裝版ViewMac
- oracle ORA-01102: cannot mount database in EXCLUSIVE mode(無法起到獨佔模式)OracleDatabase模式
- solidity的msg.valueSolid
- JDK 載入jar中的檔案資源出現Cannot be resolved to absolute file path because it does not reside in the file systemJDKJARIDE
- cornerstone中msg型別解析型別
- 規範你的commit msgMIT
- Vultr賬號被封:Your account is currently closed
- SQL__DROPSQL
- JavaScript drop 事件JavaScript事件
- 在 ROS 中使用 Protobuf 替代 ros msgROS
- 訊息通知 使用 [ Web-msg-sender]Web
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- 【ERROR】su user報'This account is currently not available'錯誤 for linuxErrorAILinux
- drag &drop 拖拽事件事件
- drag & drop 拖拽事件事件
- torch--drop out
- win10系統msg格式如何開啟_win10系統msg的檔案怎麼開啟Win10
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- yum 提示 Another App is currently holding the yum lock; waiting for it to exit...APPAI
- Unity 解決 Because you are not a member of this projectUnityProject
- because it is a JDK dynamic proxy that implements 問題JDK
- drop apply INSTANTIATION for one tableAPP