简体   繁体   English

绕过SQL Server 2008 R2 Express 10 Go限制

[英]Bypass SQL Server 2008 R2 Express 10 go limit

The limit of 10 GB is reached and different constraints force to circumvent this limit the time that a set of patches can be put in place. 已达到10 GB的限制,并且有不同的限制条件来规避此限制,即可以放置一组修补程序的时间。 An appropriate license is already in place on another server but unfortunately the migration can not be done in a reasonable time. 另一台服务器上已经有适当的许可证,但是很遗憾,迁移不能在合理的时间内完成。 To address the most pressing, we must find the way to override the limit imposed by SQL Server Express. 为了解决最紧迫的问题,我们必须找到一种方法来替代SQL Server Express施加的限制。 Shrinkage, aliasing, file splitting, index changes, all of these were attempted without success. 收缩,锯齿,文件分割,索引更改,所有这些尝试均未成功。 Suggestions? 有什么建议吗?

Since the 10GB limit is per database you can use the following trick to split the data among several databases. 由于每个数据库 10GB的限制,因此您可以使用以下技巧在多个数据库之间分配数据。 Warning : people with strong DB beliefs please close your eyes now :-) 警告 :坚信数据库的人请立即闭上眼睛:-)

  • Move some tables to other database, choosing a set of tables than doesn't break foreign key constraints. 将一些表移到其他数据库,选择一组表不会破坏外键约束。
  • For each table create a view with the same name in the original database like this: 为每个表在原始数据库中创建一个具有相同名称的视图,如下所示:

     create view TableName as select * from TheOtherDB..TableName 

In this way you use the view as the table and you don't have to change a single query, SQL Server allows INSERT , UPDATE and DELETE on that type of views as if they were a table, but the data is stored in the other DB. 这样,您就可以将视图用作表,而不必更改单个查询,SQL Server允许对该类型的视图INSERTUPDATEDELETE就好像它们是表一样,但是数据存储在另一个视图中D B。

Of course after you migrate to the new server you should move the data back to one database. 当然,在迁移到新服务器之后,您应该将数据移回一个数据库。

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

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