February 5, 2008 at 2:49 pm
Hello ,
I am encountering an issue with one of the MSDB table: sysjobstepslogs, which occupies 34G.
I deleted bunch of steps using sp_delete_job_step_log and it seems that it is not releasing the 34G of space and I also removed the steps from
the sqlagent jobs where it logged info to database.
Any other idea how I can reclaim the space from this table:
sysjobstesplogs
This is the result from sp_spaceused: sysjobsstepslogs
row Reserved date Index_size
Unused
0 31251096 KB 31246968 KB 16 KB
4112 KB
Thanks Farhad
January 22, 2009 at 2:51 pm
I deleted bunch of steps using sp_delete_job_step_log and it seems that it is not releasing the 34G of space and I also removed the steps from
Have you checked the table to see if rows are actually being deleted? According to BOL, you would need to use sp_delete_jobsteplog. Below is code from BOL on how to delete logs before a certain date for a specific job.
USE msdb ;
GO
EXEC dbo.sp_delete_jobsteplog
@job_name = N'Weekly Sales Data Backup',
@older_than = '10/25/2005 12:00:00',
@larger_than = 104857600;
GO
Also, when looking at space used - the usage may need to be updated after all the deletions. Here is the code to do so.
sp_spaceused @objname = sysjobstepslogs, @updateusage = N'True'
Hope this helps. 🙂
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply