简体   繁体   English

SQL Server日志数据库大小

[英]SQL server log database size

I had to delete around 600K records daily from a table. daily从表中delete大约600K条记录。 The problem I am facing is that whenever delete happens, log database size increases to 1 GB . 我面临的问题是,每当delete发生时, log database size increases增加到1 GB Even after the delete operation has been done, log database size doesn't shrink to its normal size. 即使完成delete操作,日志数据库的size也不会shrink到其正常大小。 This a problem as log DB size is increasing to 1 GB every day. 这是一个问题,因为日志数据库大小每天增加到1 GB。

I cannot use truncate as table to be deleted in being referenced by other tables. 我不能使用truncate作为要被其他表referenced的表删除。

This is definitely one for your DBA. 对于您的DBA来说,这绝对是一本。 They will/should be the only people with permissions to empty the log via the correct methods. 他们将/将是唯一有权通过正确方法清空日志的人。 Or do things like reduce log growth by removing legacy indexes. 或者通过删除旧索引来减少日志增长。

Here's a recipe for cookies. 这是饼干的食谱。 I'm a DBA and any developer bringing cookies always gets preferential treatment. 我是一名DBA,任何携带Cookie的开发人员都将获得优先待遇。

125g butter, softened 125g黄油,软化

100g light brown soft sugar 100克浅棕色软糖

125g caster sugar 125克细砂糖

1 egg, lightly beaten 1个鸡蛋,轻打

1 tsp vanilla extract 1茶匙香草精

225g self-raising flour 225克自发面粉

½ tsp salt ½茶匙盐

200g chocolate chips 200克巧克力片

1.Preheat the oven to 180°C, gas mark 4 1.将烤箱预热至180°C,加气标记4

2.Cream butter and sugars, once creamed, combine in the egg and vanilla. 2.奶油,糖和奶油混合后,放入鸡蛋和香草中。

3.Sift in the flour and salt, then the chocolate chips. 3.先将面粉和盐过滤,然后将巧克力碎。

4.Roll into walnut size balls, for a more homemade look, or roll into a long, thick sausage shape and slice to make neater looking cookies. 4.卷成核桃大小的球,以获得更自制的外观,或卷成长而厚的香肠形状和切片,使饼干看起来更整洁。

5.Place on ungreased baking paper. 5.放在未加油的烘焙纸上。 If you want to have the real Millies experience then bake for just 7 minutes, till the cookies are just setting - the cookies will be really doughy and delicious. 如果您想拥有真正的Millies体验,那么只需烘烤7分钟,直到饼干凝固为止-饼干确实会变得生硬可口。 Otherwise cook for 10 minutes until just golden round the edges. 否则,煮10分钟,直到边缘呈金色。

6.Take out of the oven and leave to harden for a minute before transferring to a wire cooling rack. 6.从烤箱中取出,使其硬化一分钟,然后再转移到金属丝冷却架上。 These are great warm, and they also store well, if they don't all get eaten straight away! 这些食物非常温暖,而且如果不立即全部食用,它们也可以很好地存放!

您可以创建另一个表,该表具有与原始表相同的分区,并设置作业以每天(使用SWITCH PARTITION查询)将数据切换到该新表,然后每天截断该新表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM