SQL Server dbcc clonedatabase​​ -​​ Gotch

Published Feb 08 2022 06:46 AM 962 Views
Microsoft
Moved from: bobsql.com

 

The dbcc clonedatabase is a​​ handy command to clone metadata and​​ information such as​​ query disk store.​​ ​​ Then​​ you can​​ use the​​ database​​ for various​​ activities, usually reporting​​ -​​ Performance Tuning with Query Store in SQL Server and Azure”​​ 

SQL Server Books Online documentation for​​ clonedatabase​​ contains a special note​​ that I want to focus this post on.

 

“The new database generated from DBCC CLONEDATABASE is primarily intended for troubleshooting and diagnostic purposes. In order for the cloned database to be supported for use as a production database, the VERIFY_CLONEDB option must be used.”

 

I have been testing​​ SQL Server​​ High Availability failovers​​ in combination with database creates and drops, including clonedatabase. ​​ As​​ the​​ books online​​ references​​ highlight the clonedatabase is created in multiple stages:

 

  • Create new database

  • Copy metadata

  • Copy Schema

The clone is marked as complete and verifiable once all stages of the command complete. ​​ The​​ gotcha occurs when the clonedatabase command is interrupted (Ex: failover, power outage, …) ​​ leaving a partially cloned database, perhaps even as part of an availability group and replicated.

 

The​​ interruption leaves partial metadata or schema in​​ the​​ cloned database leading to SQL Server assertions and errors​​ often​​ generating​​ dumps (SQLDump*’s.) ​​ It is common for a partially cloned database to generate lots of ​​ dumps as the background processes (ghost, QDS, …) periodically attempt to use the database, triggering​​ the asserts and high severity error conditions. ​​​​ The persistent errors and associated dumps can be a factor​​ leading to​​ high availability​​ failovers.

 

I have been working with the team​​ which​​ owns dbcc clonedatabase to address the partial clone scenarios. ​​ Until​​ a​​ solution is provided in a SQL Server​​ product​​ be sure to drop a partially cloned database from your system to avoid unwanted impacts.

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3136868%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3ESQL%20Server%20dbcc%20clonedatabase%20-%20Gotch%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3136868%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CH6%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%20id%3D%22%5C%26quot%3Btoc-hId-1763627325%5C%26quot%3B%22%20id%3D%22toc-hId-1763627356%22%20id%3D%22toc-hId-1763627356%22%20id%3D%22toc-hId-1763627356%22%3E%3CSPAN%3EMoved%20from%3A%20bobsql.com%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FH6%26gt%3B%5Cn%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3EThe%20dbcc%20clonedatabase%20is%20a%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ehandy%20command%20to%20clone%20metadata%20and%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Einformation%20such%20as%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Equery%20disk%20store.%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%3EThen%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eyou%20can%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Euse%20the%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Edatabase%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Efor%20various%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eactivities%2C%20usually%20reporting%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3E-%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CA%20title%3D%22%5C%26quot%3B%5C%26quot%3B%22%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fsqlbits.com%2Finformation%2Fevent20%2FPerformance_Tuning_with_Query_Store_in_SQL_Server_and_Azure%2Ftrainingdetails%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_top%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnofollow%20nofollow%20noopener%20noreferrer%22%20noopener%3D%22%22%20noreferrer%3D%22%22%3E%3CSPAN%20class%3D%22%5C%26quot%3BT2%5C%26quot%3B%22%3E%E2%80%9C%26lt%3B%5C%2FSPAN%26gt%3B%3CSPAN%20class%3D%22%5C%26quot%3BT3%5C%26quot%3B%22%3EPerformance%20Tuning%20with%20Query%20Store%20in%20SQL%20Server%20and%20Azure%E2%80%9D%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FA%26gt%3B%20%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3ESQL%20Server%20Books%20Online%20documentation%20for%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CA%20title%3D%22%5C%26quot%3B%5C%26quot%3B%22%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Ft-sql%2Fdatabase-console-commands%2Fdbcc-clonedatabase-transact-sql%3Fview%3Dsql-server-ver15%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_top%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3E%3CSPAN%20class%3D%22%5C%26quot%3BHyperlink%5C%26quot%3B%22%3Eclonedatabase%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FA%26gt%3B%20%26nbsp%3B%3CSPAN%3Econtains%20a%20special%20note%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ethat%20I%20want%20to%20focus%20this%20post%20on.%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BP4%5C%26quot%3B%22%3E%3CSPAN%3E%E2%80%9CThe%20new%20database%20generated%20from%20DBCC%20CLONEDATABASE%20is%20primarily%20intended%20for%20troubleshooting%20and%20diagnostic%20purposes.%20In%20order%20for%20the%20cloned%20database%20to%20be%20supported%20for%20use%20as%20a%20production%20database%2C%20the%20VERIFY_CLONEDB%20option%20must%20be%20used.%E2%80%9D%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BP4%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3EI%20have%20been%20testing%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3ESQL%20Server%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3EHigh%20Availability%20failovers%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ein%20combination%20with%20database%20creates%20and%20drops%2C%20including%20clonedatabase.%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3EAs%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ethe%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ebooks%20online%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ereferences%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ehighlight%20the%20clonedatabase%20is%20created%20in%20multiple%20stages%3A%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3CUL%20class%3D%22%5C%26quot%3BLFO2%5C%26quot%3B%22%3E%5Cn%3CLI%3E%3CP%20class%3D%22%5C%26quot%3BP5%5C%26quot%3B%22%3E%3CSPAN%3ECreate%20new%20database%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%5C%26quot%3BP6%5C%26quot%3B%22%3E%3CSPAN%3ECopy%20metadata%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%5C%26quot%3BP7%5C%26quot%3B%22%3E%3CSPAN%3ECopy%20Schema%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%5C%26quot%3BP8%5C%26quot%3B%22%3E%3CSPAN%3E%E2%80%A6%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%26lt%3B%5C%2FLI%26gt%3B%5Cn%26lt%3B%5C%2FUL%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3EThe%20clone%20is%20marked%20as%20complete%20and%20verifiable%20once%20all%20stages%20of%20the%20command%20complete.%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3EThe%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Egotcha%20occurs%20when%20the%20clonedatabase%20command%20is%20interrupted%20(Ex%3A%20failover%2C%20power%20outage%2C%20%E2%80%A6)%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eleaving%20a%20partially%20cloned%20database%2C%20perhaps%20even%20as%20part%20of%20an%20availability%20group%20and%20replicated.%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3EThe%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Einterruption%20leaves%20partial%20metadata%20or%20schema%20in%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ethe%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ecloned%20database%20leading%20to%20SQL%20Server%20assertions%20and%20errors%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eoften%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Egenerating%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Edumps%20(SQLDump*%E2%80%99s.)%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3EIt%20is%20common%20for%20a%20partially%20cloned%20database%20to%20generate%20lots%20of%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Edumps%20as%20the%20background%20processes%20(ghost%2C%20QDS%2C%20%E2%80%A6)%20periodically%20attempt%20to%20use%20the%20database%2C%20triggering%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ethe%20asserts%20and%20high%20severity%20error%20conditions.%26lt%3B%5C%2FSPAN%26gt%3B%26nbsp%3B%20%26nbsp%3B%3CSPAN%3EThe%20persistent%20errors%20and%20associated%20dumps%20can%20be%20a%20factor%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eleading%20to%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ehigh%20availability%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Efailovers.%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%20class%3D%22%5C%26quot%3BNormal%5C%26quot%3B%22%3E%3CSPAN%3EI%20have%20been%20working%20with%20the%20team%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ewhich%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eowns%20dbcc%20clonedatabase%20to%20address%20the%20partial%20clone%20scenarios.%26nbsp%3B%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3EUntil%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ea%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Esolution%20is%20provided%20in%20a%20SQL%20Server%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Eproduct%26lt%3B%5C%2FSPAN%26gt%3B%20%26nbsp%3B%3CSPAN%3Ebe%20sure%20to%20drop%20a%20partially%20cloned%20database%20from%20your%20system%20to%20avoid%20unwanted%20impacts.%26lt%3B%5C%2FSPAN%26gt%3B%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-TEASER%20id%3D%22%5C%26quot%3Blingo-teaser-3136868%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3C%2FLINGO-TEASER%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ESQL%20Server%20dbcc%20clonedatabase%20-%20gotcha.%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-teaser%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3136868%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EBobSQL%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FSPAN%3E%3C%2FH6%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3136868%22%20slang%3D%22en-US%22%3ESQL%20Server%20dbcc%20clonedatabase%20-%20Gotch%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3136868%22%20slang%3D%22en-US%22%3E%3CH6%20class%3D%22Normal%22%20id%3D%22toc-hId-1763627325%22%20id%3D%22toc-hId--43827107%22%3E%3CSPAN%3EMoved%20from%3A%20bobsql.com%3C%2FSPAN%3E%3C%2FH6%3E%0A%3CP%20class%3D%22Normal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3EThe%20dbcc%20clonedatabase%20is%20a%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ehandy%20command%20to%20clone%20metadata%20and%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Einformation%20such%20as%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Equery%20disk%20store.%3C%2FSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%3EThen%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eyou%20can%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Euse%20the%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Edatabase%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Efor%20various%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eactivities%2C%20usually%20reporting%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3E-%3C%2FSPAN%3E%20%26nbsp%3B%3CA%20title%3D%22%22%20href%3D%22https%3A%2F%2Fsqlbits.com%2Finformation%2Fevent20%2FPerformance_Tuning_with_Query_Store_in_SQL_Server_and_Azure%2Ftrainingdetails%22%20target%3D%22_top%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%3CSPAN%20class%3D%22T2%22%3E%E2%80%9C%3C%2FSPAN%3E%3CSPAN%20class%3D%22T3%22%3EPerformance%20Tuning%20with%20Query%20Store%20in%20SQL%20Server%20and%20Azure%E2%80%9D%3C%2FSPAN%3E%3C%2FA%3E%20%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3ESQL%20Server%20Books%20Online%20documentation%20for%3C%2FSPAN%3E%20%26nbsp%3B%3CA%20title%3D%22%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Ft-sql%2Fdatabase-console-commands%2Fdbcc-clonedatabase-transact-sql%3Fview%3Dsql-server-ver15%22%20target%3D%22_top%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%20class%3D%22Hyperlink%22%3Eclonedatabase%3C%2FSPAN%3E%3C%2FA%3E%20%26nbsp%3B%3CSPAN%3Econtains%20a%20special%20note%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ethat%20I%20want%20to%20focus%20this%20post%20on.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22P4%22%3E%3CSPAN%3E%E2%80%9CThe%20new%20database%20generated%20from%20DBCC%20CLONEDATABASE%20is%20primarily%20intended%20for%20troubleshooting%20and%20diagnostic%20purposes.%20In%20order%20for%20the%20cloned%20database%20to%20be%20supported%20for%20use%20as%20a%20production%20database%2C%20the%20VERIFY_CLONEDB%20option%20must%20be%20used.%E2%80%9D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22P4%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3EI%20have%20been%20testing%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3ESQL%20Server%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3EHigh%20Availability%20failovers%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ein%20combination%20with%20database%20creates%20and%20drops%2C%20including%20clonedatabase.%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3EAs%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ethe%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ebooks%20online%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ereferences%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ehighlight%20the%20clonedatabase%20is%20created%20in%20multiple%20stages%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%20class%3D%22LFO2%22%3E%0A%3CLI%3E%3CP%20class%3D%22P5%22%3E%3CSPAN%3ECreate%20new%20database%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%20class%3D%22P6%22%3E%3CSPAN%3ECopy%20metadata%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%20class%3D%22P7%22%3E%3CSPAN%3ECopy%20Schema%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%20class%3D%22P8%22%3E%3CSPAN%3E%E2%80%A6%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3EThe%20clone%20is%20marked%20as%20complete%20and%20verifiable%20once%20all%20stages%20of%20the%20command%20complete.%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3EThe%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Egotcha%20occurs%20when%20the%20clonedatabase%20command%20is%20interrupted%20(Ex%3A%20failover%2C%20power%20outage%2C%20%E2%80%A6)%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eleaving%20a%20partially%20cloned%20database%2C%20perhaps%20even%20as%20part%20of%20an%20availability%20group%20and%20replicated.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3EThe%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Einterruption%20leaves%20partial%20metadata%20or%20schema%20in%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ethe%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ecloned%20database%20leading%20to%20SQL%20Server%20assertions%20and%20errors%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eoften%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Egenerating%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Edumps%20(SQLDump*%E2%80%99s.)%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3EIt%20is%20common%20for%20a%20partially%20cloned%20database%20to%20generate%20lots%20of%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Edumps%20as%20the%20background%20processes%20(ghost%2C%20QDS%2C%20%E2%80%A6)%20periodically%20attempt%20to%20use%20the%20database%2C%20triggering%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ethe%20asserts%20and%20high%20severity%20error%20conditions.%3C%2FSPAN%3E%26nbsp%3B%20%26nbsp%3B%3CSPAN%3EThe%20persistent%20errors%20and%20associated%20dumps%20can%20be%20a%20factor%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eleading%20to%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ehigh%20availability%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Efailovers.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22Normal%22%3E%3CSPAN%3EI%20have%20been%20working%20with%20the%20team%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ewhich%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eowns%20dbcc%20clonedatabase%20to%20address%20the%20partial%20clone%20scenarios.%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3EUntil%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ea%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Esolution%20is%20provided%20in%20a%20SQL%20Server%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Eproduct%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%3Ebe%20sure%20to%20drop%20a%20partially%20cloned%20database%20from%20your%20system%20to%20avoid%20unwanted%20impacts.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3136868%22%20slang%3D%22en-US%22%3E%3CP%3ESQL%20Server%20dbcc%20clonedatabase%20-%20gotcha.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3136868%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBobSQL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Feb 08 2022 06:46 AM
Updated by: