zoukankan      html  css  js  c++  java
  • SqL数据库发布订阅非聚集索引没有被复制到订阅服务器的解决方案

    Non-Clustered Indexes not copying in Transactional Replication : SQL Server 2008

     方法1:  

    You have transactional replication and want to move Non-clustered index from Publisher to Subscriber and  set the non-clustered indexes property in the properties of the publishing articles to “True” and generated a new snapshot, this seemed to work, but You have come into work this morning to find the property has reset to “False” and You have no indexes on the table again. Why is this happening and is there any way you can resolve the matter so the indexes are copied over concurrently?
     
    Solution:
    You can use a post-replication SQL script to create the indexes. Whatever articles you’re publishing open up the indexes drop down list of the article in object explorer, right-click on an index and levitate over Script Index as, then Create-to, then click New Query Window editor.
    Up will pop up a new query window with the resulting index. Work your way through all the indexes on all the articles of the publication, copy and pasting just the create index line and below of each script, pull them all together into one query window.
    Once you’re done find a safe folder somewhere on your hard drive and save the SQL query as an “***.sql” file.
    Right click on the publication and go to properties. Click on the “Snapshot” tab, in there should be a section saying “Run additional scripts”. Choose the browse button next to “After applying the Snapshot; execute this script:”
    Navigate to your script file and choose it. Once done click ok and it’ll prompt you that something has changed and if you’d like to generate a new snapshot, make sure you do or it won’t work.
    That’s it, you’ll find once the publication has bulk copied over the subscriptions successfully there are non clustered indexes on the tables.
    

    意思大概是 需要重新生成 Create 每一个非聚集索引的脚本,然后批量保存到一个文件夹,然后再下图中 批量执行脚本。

    方法2:用 "Aqua Data"工具批量生成该数据库的所有非聚集索引的脚本,然后执行即可。

     方法3:选择复制选项,在选择发布属性,进行以下设置即可。

    参考:http://www.cnblogs.com/TeyGao/p/3521231.html

     【ps,这个貌似不管用】

  • 相关阅读:
    Core的学习三:容器的使用实例
    Core的学习二:【四步完成】.Net Core中Log4net的使用,配置,【框架.NET5】
    C#7 的一些新语法
    C#6 的一些新语法
    Core的学习一:Core部署在IIS下
    C# 特性【Attribute】【什么是特性?以及特性的一些修饰】
    C#反射
    泛型 -Generic 【why,原理,与普通方法,object的性能对比如何?泛型类、泛型方法、泛型接口、泛型委托,泛型约束,协变 逆变,泛型缓存】
    springboot通过切面编程实现系统请求操作日志记录
    Linux 【安装配置VM虚拟机】
  • 原文地址:https://www.cnblogs.com/x-poior/p/5354217.html
Copyright © 2011-2022 走看看