2021. 4. 6. 14:43
SQL SERVER
USE msdb
GO
ALTER TABLE [dbo].[sysmaintplan_log] DROP CONSTRAINT [FK_sysmaintplan_log_subplan_id];
GO
ALTER TABLE [dbo].[sysmaintplan_logdetail] DROP CONSTRAINT [FK_sysmaintplan_log_detail_task_id];
GO
TRUNCATE TABLE msdb.dbo.sysmaintplan_logdetail;
GO
TRUNCATE TABLE msdb.dbo.sysmaintplan_log;
GO
ALTER TABLE [dbo].[sysmaintplan_log] WITH CHECK ADD CONSTRAINT [FK_sysmaintplan_log_subplan_id] FOREIGN KEY([subplan_id])
REFERENCES [dbo].[sysmaintplan_subplans] ([subplan_id]);
GO
ALTER TABLE [dbo].[sysmaintplan_logdetail] WITH CHECK ADD CONSTRAINT [FK_sysmaintplan_log_detail_task_id] FOREIGN KEY([task_detail_id])
REFERENCES [dbo].[sysmaintplan_log] ([task_detail_id]) ON DELETE CASCADE;
GO
www.sqlrx.com/large-msdb-database-from-sysmaintplan_logdetail-table/
'SQL SERVER' 카테고리의 다른 글
TDE 암호화 해제 (0) | 2021.04.26 |
---|---|
DB별 여러가지통계정보(CPU, I/O, Duration 등) (0) | 2021.04.22 |
sql server Lock정보 확인 (0) | 2020.12.09 |
패스워드 만료(Expiration) 조회 (0) | 2020.12.08 |
Extended Event Data Table 로 가져오기 (0) | 2020.10.13 |