插入数据库db_huihis中的表T_流水号时报错:
1105:未能为数据库 db_huihis 中的对象 T_流水号 分配空间,因为文件组 PRIMARY 已满。
数据库有二百万条记录
Q:执行SQL Executive-based tasks失败并有下列讯息如何处理?
Error: 1105, Severity : 17, State 2
Cant allocate space for object %.*s in database %.*s because the %.*s segment is full. If you ran out of space in Syslogs, dump the transaction log. Otherwise, use ALTER DATABASE or sp_extendsegment to increase the size of the segment.
A:
发生此种状况因为MSDB database已满,系统管理员可手动删除旧的项目或参照下列方式建立一个store procedure,再执行此stored procedure:
use master
go
sp_configure allow, 1
go
reconfigure with override
go
drop proc sp_cleanbackupRestore_log
go
create proc sp_cleanbackupRestore_log
@DeleteBeforeDate datetime
as
begin
Delete from msdb.dbo.sysbackupdetail where backup_id
in (Select backup_id from msdb.dbo.sysbackuphistory where
backup_start <=
@DeleteBeforeDate)
Delete from msdb.dbo.sysbackuphistory where backup_start <=
@DeleteBeforeDate
Delete from msdb.dbo.sysrestoredetail where restore_id
in (Select restore_id from msdb.dbo.sysrestorehistory where
backup_start <=
@DeleteBeforeDate)
Delete from msdb.dbo.sysRestorehistory where backup_start<=
@DeleteBeforeDate
end
go
sp_configure allow, 0
go
reconfigure with override
若要删除 Apr 30,1998之前的项目,则执行exec sp_cleanbackupRestore_log 4/30/98
应该是磁盘空间不足!