Friday, March 30, 2012

SQL Server database marked as suspect

Today the Dynamics AX 2012 service couldn't start in my Test Server , after looking to log file i found  the administrator doesn't  have access to  Dynamics ax 2012 database , switch to Sqlserver i found that my AX database  is marked Suspect ,after Google this problem I found the  following script
and able to solve this issue



EXEC sp_resetstatus 'MicrosoftDynamicsAX';
ALTER DATABASE MicrosoftDynamicsAX SET EMERGENCY
DBCC checkdb('MicrosoftDynamicsAX')
ALTER DATABASE MicrosoftDynamicsAX SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('MicrosoftDynamicsAX', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE MicrosoftDynamicsAX SET MULTI_USER


Happy DAX