sybase ASE代理表的建立

1、确认系统的基础配置满足要求,主要是Component Integration Services (CIS) 是否配置正确。

   (1)开启CIS组件

    

 use master sp_configure "enable cis", 1 

    如果设置了此选项,需要重新启动server,才能生效。ASE-12后此功能组件默认开启。

    (2)配置RPC

     在ASE-15中,此设置默认是0,需要开启

 sp_configure "cis rpc handling", 1 

 

         (3)设置CIS的允许最大连接数

       在ASE-15中,此设置默认是0,最好调到20以上。

 sp_configure "max cis remote connections", 20 
(3)设置CIS的允许最大连接数
2、在双方服务器interfaces中添加对方服务器信息
 vi /syb64bit/ASE-15/中的interfaces文件
 添加本地服务器名称     使用isql连接进入服务器Server1,Server2     1>select @@servername     2>go     确定服务器本地名称已经生效     如果返回NULL,     1>sp_addserver Server_name,local     2>go     Server_name应该跟interfaces中所用服务器名称一致     重新启动服务器,让本地名称生效, 确认 CIS 集成服务已经启动。
3、添加远程服务器信息及登录信息
A. 添加远程服务器信息
在Server1上执行如下命令:
isql -Usa -P -SServer1
exec sp_addserver Server2, ASEnterprise, Server2 

B. 添加远程登录信息
isql -Usa -P -SServer1
exec sp_addremotelogin Server2, sa, sa 
exec sp_remoteoption Server2, sa, sa, trusted, true 
go
或者
isql -Usa -P -SServer1
exec  sp_addexternlogin Server2, sa, sa , xxxxxx  (xxxxxx为远程服务器Server2上sa的口令)  (可以不是sa,该用户要具有登录权限)
 
4、建立代理表
    在Server2数据库pubs2建立表t_testproxy
    create table t_testproxy (id int,name char(10))
    在Server1数据库test中添加代理表信息
     use test
     go
     create proxy_table t_testproxy at "Server2.pubs2.dbo.t_testproxy"

     代理表名与原表名可以不同
 
 
5、附上主要的脚本
 
  (1)成功脚本
    sp_addserver SHZ_TULIP01_SRV,ASEnterprise,SHZ_TULIP01_SRV 
 
    sp_addexternlogin SHZ_TULIP01_SRV,tulip,tulip,password
 
    create proxy_table tulip.USR00NOC at "SHZ_TULIP01_SRV.tulipdb.tulip.USR00NOC"
 
    grant select on tulip.USR00NOC to tulip
  (2)失败时的删除脚本
   sp_dropserver SHZ_TULIP01_SRV
 
   sp_dropexternlogin SHZ_TULIP01_SRV,tulip
   
   drop table tulip.USR00NOC







 

你可能感兴趣的:(sybase ASE代理表的建立)