为什么每次服务器重启时都会重新创建TempDB。 。 。 。 [英] Why Really TempDB Re-creates every time when server restarts . . . .

查看:324
本文介绍了为什么每次服务器重启时都会重新创建TempDB。 。 。 。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



请问有人告诉我为什么每次服务器重启时都会重新创建TempDB。

什么是这背后的实际原因,没有人说出确切的理由。我也无法在谷歌中找到相同的东西。



请告诉我们。 。 。 。 。









Regard's,

Thrilok。

Dear Friends,

Can u please anybody tell me that why TempDB Re-creates every time when server restarts.
What is the actual reason behind this, Nobody is telling exact reason. I am not able to find same thing in google also.

Please tell me guys . . . . .




Regard's,
Thrilok.

推荐答案

让我猜一下:垃圾收集。想象一下,TempDB经常被改变。尽管SQL Server的ODS可能是完美的,但仍然需要像DBCC这样的工具。究竟谁会在TempDB上运行DBCC。好吧,微软给出的解决方案解决了这个问题:当你重新启动服务器时,你得到一个干净的。



但我认为微软的回答 [ ^ ]非常清楚:

Let me guess: garbage-collection. Imagine that TempDB is really often altered. As perfect the ODS of SQL Server might be, there is still need of tools like DBCC. Who on earth would ever run DBCC on TempDB. Well, the solution given by Microsoft resolves the problem: when you restart server, you get a clean one.

But I think that Microsoft's answer[^] is pretty clear:
引用:

tempdb中的操作记录最少。这样可以回滚事务。 每次启动SQL Server时都会重新创建tempdb,以便系统始终以数据库的干净副本启动。临时表和存储过程在断开连接时自动删除,并且当连接时没有活动连接系统关闭。因此,tempdb中永远不会有任何内容从SQL Server的一个会话保存到另一个会话。 tempdb上不允许进行备份和恢复操作。

Operations within tempdb are minimally logged. This enables transactions to be rolled back. tempdb is re-created every time SQL Server is started so that the system always starts with a clean copy of the database. Temporary tables and stored procedures are dropped automatically on disconnect, and no connections are active when the system is shut down. Therefore, there is never anything in tempdb to be saved from one session of SQL Server to another. Backup and restore operations are not allowed on tempdb.



猜猜:google给了我这个...


And guess what: google gave me this...


TempDB是临时的,按照定义将不会持续。



由于性能原因,它会被清除并重新创建。
TempDB is temporary and by definition will not last.

It is cleared and recreated for performance reasons.


这篇关于为什么每次服务器重启时都会重新创建TempDB。 。 。 。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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