• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 880
  • Last Modified:

backup log mydb with truncate_only

backup log mydb with truncate_only
backup log mydb with no_log

is not working and does not truncate the log file of mydb ? how can I fix it.
0
pinaldave
Asked:
pinaldave
  • 5
  • 4
  • 2
  • +1
2 Solutions
 
gpompeCommented:
Keep in mind that those command will purge ONLY committed transactions and will not change the size of transacion log.
0
 
Scott PletcherSenior DBACommented:
DBCC SHRINKFILE (log_logical_file_name)
0
 
Scott PletcherSenior DBACommented:
If you don't know the logical file name, use the first column of this output to find out :-) :

EXEC mydb.dbo.sp_helpfile
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
pinaldaveAuthor Commented:
Yes, I would like to purge the file. Shrinkfile does not work either I already tried.
0
 
MNelson831Commented:
Use MyDatabaseName
go

Backup log MyDatabaseName with Truncate_Only
dbcc shrinkfile("MyDatabaseLogFileName",0)
0
 
MNelson831Commented:
Sorry scott.. you posted whilst I was looking up syntax
0
 
pinaldaveAuthor Commented:
MNelson,
I tried that but it would not do the trick. That is the problem.
0
 
pinaldaveAuthor Commented:
Still need help.
0
 
MNelson831Commented:
verify the logical file name of the log
0
 
pinaldaveAuthor Commented:
i did that. but it is correct.
0
 
pinaldaveAuthor Commented:
One of the process were interfearing to backup process. I killed that process and my original command worked.

Thank you for guidance.

0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now