在不运行服务的情况下配置 SQL-SERVER [英] Configure SQL-SERVER without running service

查看:44
本文介绍了在不运行服务的情况下配置 SQL-SERVER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在不启动 SQL-Server 的情况下更改 temp.mdf 或其他文件的位置?

我想重新激活旧服务器,但其中一个 USB 硬盘已在其他地方使用.现在我无法在配置管理器中启动 SQL-Server 服务.

事件日志有以下条目:

事件类型:错误事件源:MSSQLSERVER活动类别:(2)事件 ID:17207日期:30.08.2011时间:15:53:10用户:不适用计算机:SQLSERV描述:

<块引用>

FCB::Open: Betriebssystemfehler 3(error not found) beim Erstellen oderÖffnen der Datei 'M:\temp.mdf'.诊断与诊断den Betriebssystemfehler, und wiederholen Sie den Vorgang.

有关此错误的信息.

问: 那么如何在不启动 SQL-SERVER 服务的情况下更改引用非现有驱动器的数据库文件的位置?我还没有在配置管理器中看到一个选项.或者在 SQL-Server 中有某种安全模式"?

解决方案

查看 MSDN

您可以通过 SQLCMD 使用 ALTER 命令启动服务器并修改 TEMPDB 的位置.

或者,您可以临时添加另一个驱动器,以便存在正确的路径 - TempDB 在启动时重新创建,因此只需确保路径可用就足够了.然后,您可以在服务器运行时根据需要移动文件位置.

Is it possible to change the location of the temp.mdf or other files without starting SQL-Server?

I wanted to reactivate an old server but one of it's USB hard disk was been already used somewhere else. Now i'm unable to start the SQL-Server service in Configuration Manager.

The event log has following entry:

Event Type: Error
Event Source:   MSSQLSERVER
Event Category: (2)
Event ID:   17207
Date:       30.08.2011
Time:       15:53:10
User:       N/A
Computer:   SQLSERV
Description: 

FCB::Open: Betriebssystemfehler 3(error not found) beim Erstellen oder Öffnen der Datei 'M:\temp.mdf'. Diagnostizieren und korrigieren Sie den Betriebssystemfehler, und wiederholen Sie den Vorgang.

Here are informations on this error.

Q: So how can i change the location of database files that reference non existing drives without having SQL-SERVER service started? I haven't seen an option in Configuration-Manager. Or is there some kind of "safe-mode" in SQL-Server?

解决方案

Take a look at the options here in MSDN

You can start up the server and amend the location of TEMPDB using an ALTER command through SQLCMD.

Alternatively you could just add another drive temporarily so that the correct path exists - TempDB is recreated on start up so just ensuring the path is available should be sufficient. You can then move the file locations if needed when the server is running.

这篇关于在不运行服务的情况下配置 SQL-SERVER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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