• SQL 2012 alwayson设置只读路由


    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd]  MODIFY REPLICA ON   N'maxiangqian1' WITH   (SECONDARY_ROLE (ALLOW_CONNECTIONS = READ_ONLY));

    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd]  MODIFY REPLICA ON

    N'maxiangqian1' WITH (SECONDARY_ROLE (READ_ONLY_ROUTING_URL = N'TCP://maxiangqian1.maxiangqian.local:1433'));

    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd]  MODIFY REPLICA ON

    N'maxiangqian2' WITH  (SECONDARY_ROLE (ALLOW_CONNECTIONS = READ_ONLY));

    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd]  MODIFY REPLICA ON

    N'maxiangqian2' WITH  (SECONDARY_ROLE (READ_ONLY_ROUTING_URL = N'TCP://maxiangqian2.maxiangqian.local:1433'));

    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd] MODIFY REPLICA ON

    N'maxiangqian1' WITH (PRIMARY_ROLE (READ_ONLY_ROUTING_LIST=('maxiangqian2','maxiangqian1')));

    ALTER AVAILABILITY GROUP [sqlmaxiangqianbd] MODIFY REPLICA ON

    N'maxiangqian2' WITH (PRIMARY_ROLE (READ_ONLY_ROUTING_LIST=('maxiangqian1','maxiangqian2')));

    maxiangqian1​,maxiangqian2是两台主机的主机名,sqlmaxiangqianbd是高可用性组的名字

  • 相关阅读:
    通过SQLServer的数据库邮件来发送邮件
    sql生成数据库的序列号
    存储过程备份数据库
    LED客显的类
    坦克大战java版
    连连看java版
    贪吃蛇java版
    分享插件 javascript
    js实现上传图片及时预览
    json返回date类型转为字符串
  • 原文地址:https://www.cnblogs.com/shengdimaya/p/5455615.html
Copyright © 2020-2023  润新知