这是使用Microsoft SQL Server 2012。
我有一个有多个版本的程序,每个版本都对底层SQL数据库进行了一些模式更改。在尝试进行一些手动升级时,一些数据库从当前版本中分离或删除,一些备份被还原。在尝试和错误过程中,多个数据库发生了无法遵循的附加/还原/分离/删除混乱。
我们现在尝试从头开始,我们删除了示例中的所有数据库,并尝试重新运行安装程序。数据库创建脚本总是失败。我无法轻松地指出创建脚本的哪个部分失败了,但我的直觉是,它与留在sys表中的某种对象有关。但实际上并不在示例中,因此数据库创建脚本会跳过一些步骤,因为它们认为某些东西存在(它们正在检查sys表以确定是否存在)。
长话短说,我们时间紧迫,并试图找出是否有一种方法,我们可以“工厂重置”现有的SQL示例,或如果我们需要找到一种方法,让SQL安装程序回到系统上,删除现有的示例,并添加一个新的。
3条答案
按热度按时间vwkv1x7d1#
我认为你将被迫做一个重新安装,你 * 可能 * 运气与修复选项。
如果您将不得不走这条路,重新安装,我一定会删除所有剩余的文件从主数据库和临时数据库只是为了安全起见。
如需了解更多信息:MSDN Uninstall
我还想借此机会评估一下您的备份策略,并为您的SQL Server对象实施源代码控制,如果您目前还没有这样做的话。
zte4gxcn2#
如果您有master、model和msdb的副本,并且可以还原它们,则您将拥有所需的内容。您可能不必重新安装二进制文件(如您所述)。如果没有这些备份,您将必须重新安装SQL Server。
https://msdn.microsoft.com/en-us/library/ms190679.aspx
vhipe2zx3#