[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Discover which DB .ldf belongs to?

Posted on 2008-10-07
11
Medium Priority
?
324 Views
Last Modified: 2012-05-05
I have a database log file that is pretty large, but I can't see what database owns it.  I've looked at all the existing databases, and none of them seem to use it.  I can't rename it, either because it's locked.  Anyone know a good way to discover which DB this .ldf belongs to?  Thanks.
0
Comment
Question by:IntercareSupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22662419
check this script results:
exec sp_msforeachdb 'select * from ?.sys.files '

Open in new window

0
 

Author Comment

by:IntercareSupport
ID: 22662521
I get this:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'master.sys.files'.
Msg 208, Level 16, State 1, Line 1
Invalid object name 'tempdb.sys.files'.
Msg 208, Level 16, State 1, Line 1
Invalid object name 'model.sys.files'.
Msg 208, Level 16, State 1, Line 1
Invalid object name 'msdb.sys.files'.
Msg 208, Level 16, State 1, Line 1
Invalid object name 'CM.sys.files'.

...And so on.  I tried some different variations of the sp, but nothing.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22662562
is this then sql 2000, actually?
exec sp_msforeachdb 'select * from ?.dbo.sysfiles '

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:IntercareSupport
ID: 22662584
Oh sorry.  Yes and no.  It's 2005 that has is running in 2000 mode because of the application that uses it.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22665828
>>I have a database log file that is pretty large, but I can't see what database owns it. <<
It should be pretty easy to find out which one:  It is the Transaction Log you have failed to backup, that is why it is so big.
0
 

Author Comment

by:IntercareSupport
ID: 22669728
Well, I've looked at all the databases and no luck.  Everything looks like it backed up.  Help.  I thought the first idea was on to something.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22670977
maybe you have another instance of sql server running?
0
 

Author Comment

by:IntercareSupport
ID: 22671020
Nope.  I just double checked.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22671607
ok, use filemon to find out which process accesses that file:
technet.microsoft.com/en-us/sysinternals/bb896642.aspx
0
 

Author Comment

by:IntercareSupport
ID: 22671713
Ok, that was a brilliantly simple solution.  And guess what?  Nothing is locking that file anymore.  That is very annoying.  There was just a big fuss over disk space here and I got sloppy.  Thanks!
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22675306
Now that you know which database it belongs to, make sure you start doing regular backups on the Transaction Log or it will continue to grow until you run out of space and then you will have to post another question here.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

649 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