Sintomi
Si supponga di avere un database che contiene filegroup di sola lettura in Microsoft SQL Server 2014. Quando si esegue DBCC CHECKDB nel database, il comando DBCC non può creare uno snapshot del database per il database. Se non ci sono altre connessioni al database, l'operazione DBCC viene completata senza errori. Tuttavia, viene visualizzato il messaggio di errore seguente:
DBCC CHECKDB non controlla la coerenza di SQL Server Catalog o Service Broker perché non è stato possibile creare uno snapshot del database o perché con TABLOCK è stato specificato.
Se sono presenti altre connessioni al database, l'operazione DBCC non riesce e viene visualizzato il messaggio di errore seguente:
Msg 5030, livello 16, stato 12, database di 1Il linea non può essere bloccato esclusivamente per eseguire l'operazione. Msg 7926, livello 16, stato 1, istruzione line 1Check Aborted. Il database non può essere controllato come non è stato possibile creare uno snapshot del database e non è stato possibile bloccare il database o la tabella. Vedere la documentazione online per informazioni dettagliate su quando è previsto questo comportamento e quali sono le soluzioni alternative esistenti. Vedere anche gli errori precedenti per altri dettagli.
Risoluzione
Informazioni sull'aggiornamento cumulativo
Il problema è stato risolto per la prima volta nel seguente aggiornamento cumulativo di SQL Server.
Ogni nuovo aggiornamento cumulativo per SQL Server contiene tutti gli hotfix e tutti gli aggiornamenti della sicurezza inclusi nell'aggiornamento cumulativo precedente. È consigliabile scaricare e installare gli aggiornamenti cumulativi più recenti per SQL Server:
Ulteriori informazioni
Per riprodurre il problema, eseguire i comandi seguenti in SQL Server:
-- Open a new query that is named conn1, and then create a new database. CREATE DATABASE DbTest GO -- Add a new file group. ALTER DATABASE DbTest ADD FILEGROUP FGTest GO -- Add a file to the new file group. ALTER DATABASE DbTest ADD FILE (NAME=DbTest_Data2, FILENAME=''C:\temp\DbTest_Data2.ndf') TO FILEGROUP FGTest GO -- Change the file group to read-only. ALTER DATABASE DbTest MODIFY FILEGROUP FGTest READONLY GO -- Run the DBCC CHECK command in the conn1 query. DBCC CHECKDB (DbTest) -- The DBCC CHECK command runs correctly. However, you may receive the following message: "DBCC CHECKDB will not check SQL Server catalog or Service Broker consistency because a database snapshot could not be created or because WITH TABLOCK was specified." -- Open a new query window that is named conn2, and then set the database as DbTest. This action opens a connection to the DbTest database. -- Return to the conn1 query, and run the DBCC command again. DBCC CHECKDB (DbTest) -- Notice the error message that is mentioned in the "Symptoms" section.
Stato
Microsoft ha confermato che questo problema si verifica nei prodotti elencati nella sezione "Si applica a".