Solved

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

Posted on 2011-03-14
7
269 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
ID: 35132683
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
ID: 35132734
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
ID: 35132878
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Karen Wilson
ID: 35132980
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
ID: 35134002
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
ID: 35136891
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
ID: 35232694
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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