如何预热休眠的 SQL Server 数据库 [英] How to warm up a sleeping SQL Server database

查看:39
本文介绍了如何预热休眠的 SQL Server 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一项每天早上在 CruiseControl.net 中运行的作业,用于将数据文件导入数据库.我们的问题似乎是有些晚上 DB 会彻夜难眠.当我们在早上运行脚本时,我们的连接超时而我们等待数据库预热.我们试过增加超时等,但没有运气.有没有办法告诉 SQL Server 在设定的时间预热或让它保持温暖?

We have a job which runs every morning in CruiseControl.net to import a datafile into a DB. Our problem seems to be that some nights the DB goes to sleep over night. When we run the script in the morning our connection times out while we wait for the DB to warm up. We've tried upping timeouts etc. but with no luck. Is there a way to tell SQL Server to warm up at a set time or to tickle it to keep it warm?

到目前为止,我们运行了两次作业,一次是在上午 9 点进行预热,但 80% 的时间都失败了,但至少它可以预热服务器,并且在一个小时后再次运行,这几乎总是有效.

So far we run the job twice, once at 9am to warm it up which fails 80% of the time but at least it warms the server up and again an hour later which nearly always works.

我宁愿不运行它两次,因为它是一项大工作并且非常占用 CPU.有什么想法吗?

I'd rather not run it twice as its a big job and very CPU intensive. Any ideas?

推荐答案

这是哪个版本的 SQL Server?听起来数据库开启了自动关闭设置,这是 EXPRESS 的默认设置,但可能会导致这样的行为.

Which version of SQL Server is this? It sounds like the database has the Auto Close setting on, which is the default for EXPRESS but can lead to behaviour like this.

这篇关于如何预热休眠的 SQL Server 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆