Dynamics_Girl
asked on
Shrink Database Log
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-47 7541ACF1EE 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-F8 C991C19F24 2008-11-13 16:22:43.027 NULL NULL NULL NULL NULL
2 D43F4590-0428-42A8-8F89-8F B46D8E697C 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.
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-47
2 D43F4590-0428-42A8-8F89-8F
Im stumped.
ASKER
No Go
It says
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
It says
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
ASKER
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)
Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE ('GPSAIRTLog.log', EMPTYFILE)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm
Open in new window