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

  • 相关阅读:
    【Flutter学习】页面布局之基础布局组件
    【Flutter学习】基本组件之AppBar顶部导航栏
    【Flutter学习】基本组件之BottomNavigationBar底部导航栏
    开发日记:JsonCSharpHelp
    会议抢订
    C# WinForm 技巧十: winfrom 全屏自适应屏幕分辨率
    阿里云 轻量应用服务器(LAMP) 使用日志记录
    常见模块设计--权限管理(auth)
    PHP获取项目所有控制器方法名称
    想要开发自己的PHP框架需要那些知识储备?
  • 原文地址:https://www.cnblogs.com/x-poior/p/5354217.html
Copyright © 2020-2023  润新知