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

  • 相关阅读:
    oracle教程:PLSQL常用方法汇总
    CORBA_TAO的环境配置
    安装使用Sybase ASE 12.5
    Oracle数据库备份命令Exp/Imp
    30个非常流行的提示信息插件(jQuery Tooltip Plugin)
    Spring.NET学习笔记——目录(转)
    JavaScript trim函数大赏 (转)
    使用基于 Informix Dynamic Server 的 Server Studio JE
    接触 CORBA 内幕: IOR、GIOP 和 IIOP
    Oracle数据库SQL
  • 原文地址:https://www.cnblogs.com/x-poior/p/5354217.html
Copyright © 2011-2022 走看看