One of the most frustrating situations for a DBA (Database Administrator) would be corruption of the database. If the database contains highly precious data then it might lead to disaster. Database such as SQL Server does not guarantee that its database files are immune to corruption. But these database files are prone to corruption and they can get corrupted at any time due to particular reason.
One of the common reasons behind the corruption of database can be done by virus attack, bug infection, hardware fault or crash of system or sometimes due to human errors play an important role in corruption. The database users store their files on a compressed volume or folder that have more disk space. This may cause corruption in the database files thus makes them inaccessible and unsuitable. So you need to avoid storing SQL server database files in compressed volumes or folders.
The MS SQL Server database files are saved with the MDF extension. These files stores a large number of data and information in form of tables and other file objects such as views, triggers, indexes, keys, constraints, stored procedures, rules and many more. But due to corruption these files and objects can become inaccessible. There are some useful Database console commands i.e DBCC in MS SQL server that can be applied to check logical and physical integrity of all files and objects contained in MDF file. DBCC DBREPAIR and DBCC CHECKDB are useful to some extent if the corruption is not of severe level.
For Example:
You are working in an SQL Server database from few days, for storing some of your important stuffs. But one day you come to know that your database file has encountered some issues of corruption. Or you may have some problem while connecting to the database. In such a situation your database might be on risk as it may get corrupted.
Here is a manual solution to fix corruption issues of MDF files:
• Firstly open the Microsoft SQL Server Management Studio on the system.
• Then click on the New Query button.
• This will open the new query page where you have to write below script:
EXEC sp_resetstatus [YourDatabase];
ALTER DATABASE [YourDatabase] SET EMERGENCY
DBCC checkdb ([YourDatabase])
ALTER DATABASE [YourDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC DATABASE ([YourDatabase], REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE [YourDatabase] SET MULTI_USER
• After it click on the Execute button.
This will eliminate the corruptions that are encountered on your SQL MDF files. But if your files are severely corrupted then you can try using SQL MDF File Repair Tool. It helps to fix your corrupted MDF files and recovers all your crucial data from them. This tool is designed to perform safe recovery of corrupted MDF files without causing any changes and letting any harm or loss of data from your database files. It efficiently repairs and restores almost every item from the corrupted database including keys, views, stored procedures, triggers, tables, indexes, deleted records and so on. It is really easy and simple to operate.
Try Sql database recovery is the advance and a brilliant tool to recover both primary and secondary (MDF and NDF) database. The software is able to repair large sized MDF file with all database objects like table, views, rules, triggers, stored procedure etc.
ReplyDeleteDownload it from here- http://www.recoverydeletedfiles.com/sql-database-recovery-software.html
You can also take the help of these links to fix SQL Server error 824: http://sqltechtips.blogspot.in/2015/11/troubleshooting-error-824.html
ReplyDeletehttp://www.toadworld.com/platforms/sql-server/b/weblog/archive/2016/08/23/resolve-microsoft-sql-server-error-code-824