I'm on a SQL Server 2008 R2 box.
According to SQL Server, my TempDB
looks like this:
CREATE DATABASE [tempdb] ON PRIMARY
( NAME = N'tempdev', FILENAME = N'D:\Program Files\Microsoft SQL
Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\tempdb.mdf' , SIZE = 6499584KB , MAXSIZE =
81920000KB , FILEGROWTH = 10%)
LOG ON
( NAME = N'templog', FILENAME = N'T:\Program Files\Microsoft SQL
Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\templog.ldf' , SIZE = 512KB , MAXSIZE =
UNLIMITED, FILEGROWTH = 10%)
GO
Which is fine... Except I have 2 Tempdb
files: Tempdb.mdf
and Tempdb2.mdf
.
I can't find it anywhere in sys.masterdatafiles
, I can't delete it in windows -- because it says Windows is using it, and when the first tempdb
file grows, it does too, so I know SQL Server is using it.
How can I find this file in SQL Server so I can remove it from use?
results:
file_id name physical_name 1 tempdev D:\..\Data\tempdb.mdf 2 templog T:\..Data\templog.ldf Mysterious D:\..\Data\tempdb2.mdf not showing. Therein the dilemma. – Dave Clary Jan 06 '13 at 21:27