DBCC CheckDB遇到a database snapshot could not be created

简介:

在备份一个客户的数据库时(数据库版本为SQL 2005 Express版本),做DBCC CHECKDB时遇到了下面错误信息:

 

dbcc checkdb('DB_NAME');

消息 5030,级别 16,状态 12,第 1 行

The database could not be exclusively locked to perform the operation.

消息 7926,级别 16,状态 1,第 1 行

Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.

 

一般导致创建数据库快照失败的原因有两个:

1:数据库有只读的文件组。

2:没有支持稀疏文件(Parse file)的文件系统

 

英文原文如下

     No Parse file support by the file system.

                A. Parse file is not supported in FAT32 check the file system of the datafiles. If you use FAT32   use DBCC CheckDB with Tablock Option

                B. To get the volume information of file system in which we have the datafiles we use  !GetVolumeInformation API.

                This API would fail if SQLServer startup account do not have full permission on Volume in which the data file is located.

                Grant full permission for the startup account of SQLServer on the root volume of all the datafies.

 

我 检查了数据库发现没有设定为只读的文件组,这台PC是Window Xp,文件系统系统确实为FAT32,使用DBCC CHECKDB('db_name') WITH  TABLOCK 依然报错,其实当文件系统为FAT32时,DBCC CHECKDB只能在单用户模式才能成功。所以我在该数据库做DBCC CHECKDB时会遇到这个错误,为此,我特意在测试环境测试了一下,如下所示:

 

测试FAT32文件系统下的DBCC CHECKDB问题:

1: 新建的数据库TEST的文件位于FAT32磁盘上。如果没有会话访问数据库TEST(相当于单用户模式),DBCC CHECKDB成功,如果在新开一个窗口访问TEST,然后再另外一个窗口执行DBCC CHECKDB('TEST')则会报如下错误,另外DBCC CHECKDB('db_name') WITH  TABLOCK也需要在单用户模式下才能成功。

clipboard

相关文章
|
7月前
|
消息中间件 Oracle 关系型数据库
实时计算 Flink版操作报错合集之报错io.debezium.DebeziumException: The db history topic or its content is fully or partially missing. Please check database history topic configuration and re-execute the snapshot. 是什么原因
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
394 0
|
7月前
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
96 2
|
7月前
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
168 1
|
7月前
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
64 1
|
6月前
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
54 0
|
7月前
|
人工智能 Oracle 关系型数据库
一篇文章弄懂Oracle和PostgreSQL的Database Link
一篇文章弄懂Oracle和PostgreSQL的Database Link
|
7月前
|
SQL Oracle 安全
Oracle Database Vault Access Control Components
Oracle Database Vault Access Control Components
58 0
|
7月前
|
Oracle 安全 关系型数据库
What Is Oracle Database Vault?
The Oracle Database Vault security controls protect application data from unauthorized access, and helps you to comply with privacy and regulatory requirements. You can deploy controls to block privileged account access to application data and control sensitive operations inside the database using
42 0