2 MDF FILES WITH THE SAME NAME ?

  • I was just moving my mdf and ldf files from the c drive to d drive when i came across that i have 2 mdf files with the same name for some system databases like master , msdbdata etc ....

    PFA for 2 different locations in the C drive where 2 mdf files are kept for same database .

    I was wondering why same files with the exact same name.

    Please calrify .

  • Look at the modification dates... only one will current. The other is a left over from a previous installation or perhaps you have two instances on the same hardware?

    The probability of survival is inversely proportional to the angle of arrival.

  • Hi

    To verify , I check using the command sp_helpdb 'database name' for master in all the 3 instances i have on my server and here is what i got as a result :

    C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\master.mdf - location for the 1st instance

    C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\master.mdf- location for the 1st instance

    C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\master.mdf- location for the 1st instance

    i can see all are the same ....then why 2 mdf files in 2 different locations .

    Your views .

  • For one thing, if you have 3 instances on the same server they can't all be using the same mdf files, unless all servers are an exact duplicate. Besides, the file is opened for exclusive access and no two instances can be using them at the same time.

    As to why an mdf file exists in another location, I have no idea. It is eather an old one, left over from a previous installation or it is in use by another database.

    The actual name of the mdf file does not have to match the name of the database it is a part of.

    The probability of survival is inversely proportional to the angle of arrival.

  • Thanks its a good method

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply