Question

I have restored 4 databases into my new SQL 2008 R2 Server. Two databases came from a SQL 2000 Backup, the other two from SQL 2005. How come when I look at the folder where the Row Data files are stored and also look at the Database Properties under files, the 2000 database files have MDF extensions with the type SQL Database Primary Data File, and the ones that came from 2005 have no extensions with the type "File"?

All databases are working properly.

Était-ce utile?

La solution

I'd guess because the files don't have .mdf extensions in Windows Explorer. This isn't necessarily a terrible thing, it just means that the people who set up the original databases used a CREATE DATABASE statement and forgot to use extensions when they named the physical file names.

If you want to fix this, you can follow this process:

ALTER DATABASE whatever SET OFFLINE;

ALTER DATABASE whatever MODIFY FILE (name = 'logical_name', 
  filename = 'path with .mdf added to the end');

-- repeat for log file with .ldf extension

Now manually rename the files in Windows Explorer, adding the extension.

Then:

ALTER DATABASE whatever SET ONLINE;

At least one place where this missing extension can be a problem is if you have virus or malware software running, and it's set to ignore SQL Server files, for example, it can't ignore files with no extension.

Autres conseils

Database can have three files as an internal part of it, And they are 1).mdf file 2).ldf file
3).ndf file By default data files are MDF and log files are LDF. Additional data files typically have a .NDF extensions.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top