简体   繁体   English

我的MSSQL生产数据库突然用没有数据的新模式重新创建了所有表:-(

[英]My MSSQL production database suddently recreated all tables in new schema with NO data :-(

In our system, we suddenly lost all data. 在我们的系统中,我们突然丢失了所有数据。 Noone could log into the system and the data was suddenly empty. 没有人可以登录到系统,并且数据突然空了。

A closer look into the database showed, that there is now double the tables that there was before, just with another schema name in front of it instead of the standard DBO, it is not Timenord.tablename. 仔细查看数据库可以发现,现在有两倍于以前的表,只是在它前面有另一个模式名称而不是标准DBO,它不是Timenord.tablename。 All the data is still in the DBO tables, but the system is trying to use the new tables. 所有数据仍在DBO表中,但是系统正在尝试使用新表。

We havent been making any update to the system for a couple of days, so why this sudden behavior? 几天来我们一直没有对系统进行任何更新,那么为什么会出现这种突然的行为呢?

How do I fix it? 我如何解决它? Im using .net core 2.2, and i have never seen this issue before. 我使用的是.net core 2.2,我以前从未见过此问题。

Dont even know how to tell the system to use the other schema..... 甚至不知道如何告诉系统使用其他架构。

From comments above, temporary fix at least till you can find the cause of the issue is to set default schema: How to set the default schema of a database in SQL Server 2005? 通过以上评论,临时修复至少可以找到问题的根源是设置默认架构: 如何在SQL Server 2005中设置数据库的默认架构?

The default schema should look at a specific schema first (if you dont specify in your code like this dbo.TableName) so it will look for dbo. 默认模式应首先查看特定的模式(如果您未在代码中指定此dbo.TableName这样的名称),因此它将查找dbo。 and if it finds the object should use that one. 如果找到该对象,则应使用该对象。

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

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