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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Drop DatabaseDatabase
- Exclusive access could not be obtained because the database is in useAIDatabase
- flashback drop/query/table/database/archiveDatabaseHive
- How to drop Oracle RAC database manually?OracleDatabase
- alter database drop datafile 與 drop tablespace file 的區別Database
- cannot mount database in EXCLUSIVE modeDatabase
- Message "This Database is currently being used by someone else. In order to share a Notes database,Database
- drop database---ora-01586Database
- PostgreSQL DBA(138) - PG 13(Drop database force)SQLDatabase
- alter database datafile 4 offline drop;Database
- Oracle 10g新增DROP DATABASE命令Oracle 10gDatabase
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- Error:Cannot build artifact xxx:war exploded‘ because it is included into a circular dependencyErrorUI
- WCF The service cannot be activated because it does not support ASP.NET compatibilityASP.NET
- Dynamics CRM the field cannot be deleted because it is used in one or more process的解決方法delete
- ORA-02429: cannot drop index used for enforcement of unique/primary keyIndex
- sqlserver bulk insert報錯Cannot bulk load because the file could not be opened.SQLServer
- ERROR 1577 (HY000): Cannot proceed because system tables used by Event ScheduleError
- alter database offline 與 alter database offline drop效果比對Database
- MySQL 5.6 drop database時,table metadata lock等待MySqlDatabase
- alter database datafile .... offline drop的問題Database
- 6、MySQL刪除資料庫(DROP DATABASE語句)MySql資料庫Database
- alter database datafile offline drop相關問題Database
- CMake Error: add_executable cannot create target ““ because another target with the same name已解決Error
- How To Drop, Create And Recreate DB Control In A 10g DatabaseDatabase
- ORA-01102: cannot mount database in EXCLUSIVE modeDatabase
- 12C-ORA-65086: cannot open/close the pluggable databaseDatabase
- Fatal Error: TXK Install Service,Cannot install Oracle Database HomeErrorOracleDatabase
- ORA-01102 cannot mount database in EXCLUSIVE modeDatabase
- List of currently operational QOTD serversServer
- [Oracle] ORA-01102: cannot mount database in EXCLUSIVE modeOracleDatabase
- 關於ORA-01102: cannot mount database in EXCLUSIVE modeDatabase
- Oracle ORA-01102故障: cannot mount database in EXCLUSIVE modeOracleDatabase
- iis 0x80070032 Cannot read configuration file because it exceeds the maximum file size
- SQL1116N A connection to or activation of database "TESTDB" cannot be madeSQLDatabase
- RAC 11.2.0.3 ORA-01102: cannot mount database in EXCLUSIVE mode”Database
- Error 945 Database cannot be opened due to inaccessible files or insufficient memory or disk spaceErrorDatabase
- msg檔案檢視工具:Msg Viewer Pro for Mac 直裝版ViewMac