zoukankan      html  css  js  c++  java
  • 创建链接服务器

    use master
    go
    select  * from sysservers  
    
    
    if  not  exists (select * from master.sys.servers where name='CGserver' )
    begin
    --创建链接服务器
    exec sp_Addlinkedserver 'CGserver',--被访问的服务器别名
                            '',--数据源的产品名称默认为空
                            'SQLOLEDB',
                            '188.188.100.11'--要访问的服务器
    --创建登录映射
    Exec  sp_addlinkedsrvlogin 'CGserver',--被访问的服务器别名
                               'false',--确定是否通过模拟本地登录名来连接链接服务器   
                                null,
                                'sa'--登录用户名
                                '123'--登录密码                                     
                            
    
    end
    
    --删除登录映射
    exec sp_droplinkedsrvlogin 'CGserver',--被访问的服务器别名
                                null
                                
    --删除链接服务器
    exec sp_dropserver  'CGserver' --被访问的服务器别名                          
    

    之后出现的错误:

    出现该错误的原因是:我们的服务器从内网分离出来之后,由于内网防火墙的设置访问不了内网中的服务器。

      

  • 相关阅读:
    为zabbix穿上一件漂亮的外衣
    CentOS7 Ceph分布式集群部署
    SSH 免秘钥登录
    zabbix监控Tomcat/JVM 实例性能
    zabbix 监控 IPMI
    2装饰者模式
    1代理模式
    3单例模式
    2抽象工厂模式
    1工厂模式
  • 原文地址:https://www.cnblogs.com/YanYongSong/p/4548728.html
Copyright © 2011-2022 走看看