Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 tran log located in another location

Author  Topic 

Ginger8990
Starting Member

28 Posts

Posted - 2011-08-08 : 13:48:08
I have a transaction log ---ldf file located outside of mdf file location.

I cannot dbcc shrink it , every time it shown error saying cannot find the file. The log grown over 35GB, how do I shrink it which is on different location?

Thanks!!

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-08-08 : 14:29:10
Location doesn't matter, SQL knows what log file is associated with what DB, it can be on a completely different drive to the data file, doesn't matter.

Do you know which DB the log file is part of? Do you know why the log has grown so much? Do you know how much free space is in the log?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Ginger8990
Starting Member

28 Posts

Posted - 2011-08-08 : 14:45:17
It is the application DB and log(Not system DB)

It won't recognize the location, it keeps saying no file found for xxx_log.ldf. mdf is on under SQL\data\xxx.mdf but xxx.ldf is on d:\SQL

quote:
Originally posted by GilaMonster

Location doesn't matter, SQL knows what log file is associated with what DB, it can be on a completely different drive to the data file, doesn't matter.

Do you know which DB the log file is part of? Do you know why the log has grown so much? Do you know how much free space is in the log?

--
Gail Shaw
SQL Server MVP

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-08 : 14:48:07
You need to specify the logical name, not the physical name. Right click on the database and check its properties to see the logical names. If you've used the defaults, then the tlog logical name is the database name with _log appended to it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-08-08 : 15:46:08
Or pass shrinkfile the file_id of the log file. If the DB only has one log file that'll be 2

quote:
It is the application DB and log(Not system DB)

Doesn't change a thing that I said.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Ginger8990
Starting Member

28 Posts

Posted - 2011-08-08 : 16:21:14

It works using logic name not physical name. THANKS!!!


quote:
Originally posted by tkizer

You need to specify the logical name, not the physical name. Right click on the database and check its properties to see the logical names. If you've used the defaults, then the tlog logical name is the database name with _log appended to it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page
   

- Advertisement -