Hello All,
Somehow our TFS server database is corrupted, So I copied all database files (.mdf and .ldf) to other SQL server and trying to attach the files but I am getting following error
==============================================================
An inconsistency was detected during an internal operation. Please contact technical support.
Could not open new database ''. CREATE DATABASE is aborted.
File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL13.TFSSQL\MSSQL\DATA\Tfs_TEST_log.ldf" may be incorrect. (Microsoft SQL Server, Error: 5243)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=5243&LinkId=20476
===================================================================
Also I have tried follwing Steps
1. Created a new database with same name
2. dettach the database and copied currpted databs in datbase folder
3. going to attach corrupted database its giving me above metioned error.
4.
EXEC sp_resetstatus 'Tfs_TEST';
ALTER DATABASE Tfs_TEST SET EMERGENCY
DBCC checkdb('Tfs_TEST')
ALTER DATABASE Tfs_TEST SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC
CheckDB('Tfs_TEST',REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE Tfs_TEST
SET MULTI_USER
========================================================================
Please guide me how I can restore the database
Thanks Ravikant Chaturvedi