mdf file in SQL 2012

coreybyrne
Member Posts: 1
in SQL General
Hello everybody!
I’m working with sql database for couple months. Today I have opened it and see pop-up window: “The header for file 'xxxx.mdf' is not a valid database file header. The FILE SIZE property is incorrect.”
I don’t know what to do next, some ideas?
Thanks in advance!
I’m working with sql database for couple months. Today I have opened it and see pop-up window: “The header for file 'xxxx.mdf' is not a valid database file header. The FILE SIZE property is incorrect.”
I don’t know what to do next, some ideas?
Thanks in advance!
0
Answers
-
The best I found is this: https://datanumen.com/sql-recovery/ but I never tried it.
The only other option is called "restore the latest backup". You do have one recent backup I hope?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
That's basically a corrupt data file.
No proper SQL backup sets available?0 -
Guide below will help you with usual corruption of sql server data, but if it can't assist, then you may look at following resources for getting more methods
https://www.repairtoolbox.com/sqlserverrepair.html SQL Server Repair Toolbox
http://support.oreilly.com/oreilly/topics/it_seems_our_sql_database_is_corrupted?rfm=1
http://www.sqlservercentral.com/Forums/Topic1602448-266-1.aspx
Sometimes when you connect to your database server, you may find it in suspect mode. Your database server won’t allow you to perform any operation on that database until the database is repaired.
A database can go in suspect mode for many reasons like improper shutdown of the database server, corruption of the database files etc.
To get the exact reason of a database going into suspect mode can be found using the following query,
DBCC CHECKDB (‘YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS
Output of the above query will give the errors in the database.
To repair the database, run the following queries in Query Analyzer,
EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(‘yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (‘yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
And you are done.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions