Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 883
  • 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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

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