• 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,这个貌似不管用】

  • 相关阅读:
    VMWare Workstation的激活码 亲测有效
    虚拟机搭建appRtcDemo的appr.tc服务器
    windows webrtc支持H264的源码编译
    windows webrtc 编译
    获取windows系统分屏个数
    windows cmd窗口光标闪动效果消失
    win10 检测系统是不是正版的 以及slmgr.vbm -dlv命令不生效
    symfonos2
    利用ARP欺骗进行MITM(中间人攻击)
    内网学习之MySQL服务提权
  • 原文地址:https://www.cnblogs.com/x-poior/p/5354217.html
Copyright © 2020-2023  润新知