?
Solved

Shrink Database Log

Posted on 2008-11-13
6
Medium Priority
?
522 Views
Last Modified: 2012-05-05
I am trying to run the following script to shrink down our log file.  

Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE (GPSAIRTLog, EMPTYFILE)

and I receive the following error.

Could not locate file 'GPSAIRTLog' for database 'AIRT' in sys.database_files. The file either does not exist, or was dropped.

I have ran the following script to check the files

select * from sys.database_files

These are my results.......
1      9BB88248-A693-4BA1-BA06-477541ACF1EE      0      ROWS      1      GPSAIRTDat.mdf      D:\GPdata\GPSAIRTDat.mdf      0      ONLINE      353896      -1      20      0      0      0      1      0      NULL      NULL      NULL      NULL      5439000036835400237      4E169688-AE76-41D2-AD6F-F8C991C19F24      2008-11-13 16:22:43.027      NULL      NULL      NULL      NULL      NULL
2      D43F4590-0428-42A8-8F89-8FB46D8E697C      1      LOG      0      GPSAIRTLog.ldf      D:\GPdata\GPSAIRTLog.ldf      0      ONLINE      6330824      268435456      25      0      0      0      1      0      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL

Im stumped.

0
Comment
Question by:Dynamics_Girl
  • 3
  • 2
6 Comments
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22954317
Your logical name includes the .MDF or .LDF -- which is unusual.  Please try:

DBCC SHRINKFILE (GPSAIRTLog.log, EMPTYFILE)

Open in new window

0
 
LVL 1

Author Comment

by:Dynamics_Girl
ID: 22954352
No Go
It says

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
0
 
LVL 1

Author Comment

by:Dynamics_Girl
ID: 22954366
I tried this and if gives me the same error

Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE ('GPSAIRTLog.log', EMPTYFILE)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Assisted Solution

by:Daniel Wilson
Daniel Wilson earned 1200 total points
ID: 22954406
what about

DBCC SHRINKFILE ([GPSAIRTLog.log], EMPTYFILE)

Open in new window

0
 
LVL 1

Accepted Solution

by:
Dynamics_Girl earned 0 total points
ID: 22954416
Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE ('GPSAIRTLog.ldf', EMPTYFILE)
0
 
LVL 41

Expert Comment

by:graye
ID: 22960015
Now that  you've successfully shrunk the log file, you might consider reading the following article on how to use periodic log backups to prevent  this from happenign again.....
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm 
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Suggested Courses

850 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