Solved

How do I find a phantom .mdf file in explorer?

Posted on 2011-03-14
7
245 Views
Last Modified: 2012-06-21
I created a database using SQL Server Management Studio.  I have a maintenance plan for my databases - the whole nine yards.  I've been working with the tables etc. for over a year with a Visual Studio interface.  Others are using the database as well.  

So, I need to restore a backup and I cannot find it!  I can't even find the .mdf files!!!!!  This is the path for database file:   d:\program files\ Microsoft SQL Server\ MSSQL.1\MSSQL\Data  I've got our network expert on it as well and we are coming up with nothing in all our searches.

Anyone out there ever have a mystery such as this?  Did you ever solve it?
0
Comment
Question by:Karen Wilson
  • 4
  • 2
7 Comments
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
Can you access the server and the database still? If you do just run following sql against it:

select * from sys.sysdatabases

And check the "filename" column

For backup files you could run:


SELECT *  FROM [master].[sys].[backup_devices]

and check "physical_name"
0
 
LVL 13

Accepted Solution

by:
Wizilling earned 500 total points
Comment Utility
Run these queries.
--- to get the correct machine name
select CAST(SERVERPROPERTY('MachineName') as varchar(25)) AS MachineName

-- to find the database location. check the path of your db here.
select * from sys.sysaltfiles

-- find the backup location.
 select * from msdb.dbo.backupmediafamily
 where media_set_id IN (
      select backup_set_id
       from msdb.dbo.backupset
       where database_name ='YOUR DB NAME HERE'
        and database_creation_date > GETDATE()-30
 
 )
 
 
0
 

Author Comment

by:Karen Wilson
Comment Utility
Okay, we know the file name... and it comes up on Wiz's second query.  

We can't find that file name on the server!!  It's so bizarre....  
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Karen Wilson
Comment Utility
Here is the filename

d:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Energy.mdf

So I went to explorer and tried to map it the directory because I know that d: = WSTF-Apps.  

I got an error and ran the troubleshooter.  It says that WSTF-Apps exists but Program Files doesn't.  

Any suggestions?  I'm off to a Kid Rock concert so I will check on this later.  Thanks for any direction!!  

0
 
LVL 13

Expert Comment

by:Wizilling
Comment Utility
are you looking in the d drive of the machine name returned by my first query?

also the file can be hidden(not likely) but have you enabled folder options to view hidden files.

do u have admin access to the sever?
0
 

Author Comment

by:Karen Wilson
Comment Utility
I am going to try and work with another person today.  Unfortunately, I do not have admin rights to the server.  The server sits across the country so I can't just walk over there and be demanding either.  Thanks for the direction.  I'll keep you posted.  
0
 

Author Closing Comment

by:Karen Wilson
Comment Utility
I found out that theother contractor's DBAs changed our server name so the maintenance plans were hosed!!  Therefore the phantom file was really a non-existant one!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now