免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3219 | 回复: 4
打印 上一主题 下一主题

菜鸟问一个问题,请问sybase中有无类似dblink的东西呀 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-22 09:23 |只看该作者 |倒序浏览
请问sybase中有无类似dblink的东西呀,本人初学sybase请高手指教。今天在线等待了

论坛徽章:
0
2 [报告]
发表于 2006-11-22 17:11 |只看该作者
proxy table  
具体的看手册 System Administration Guide

论坛徽章:
0
3 [报告]
发表于 2006-11-22 21:29 |只看该作者

回复 1楼 heley7983 的帖子

代理表演示:

例子两台ASE服务器名称为 Server1,Server2,需要在Server1中建立代理表

1.  在双方服务器interfaces中添加对方服务器信息


    添加本地服务器名称
    使用isql连接进入服务器Server1,Server2
    1>select @@servername
    2>go
    确定服务器本地名称已经生效
    如果返回NULL,
    1>sp_addserver Server_name,local
    2>go
    Server_name应该跟interfaces中所用服务器名称一致

    重新启动服务器,让本地名称生效, 确认 CIS 集成服务已经启动。

2.
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的口令)

3. 建立代理表
    在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"

     代理表名与原表名可以不同

     Server1上查看代理表 信息如下:

Name                           Owner                          Object_type                     
----                           -----                          -----------                     
t_testproxy                    dbo                            user table                       

Data_located_on_segment        When_created                  
-----------------------        ------------                  
default                        Nov 28 2002 11:59AM            

Column_name     Type            Length      Prec        Scale       Nulls       Default_name    Rule_name       Access_Rule_name               Identity   
-----------     ----            ----------- ----------- ----------- ----------- ------------    ---------       ----------------               -----------
id              int                       4        NULL        NULL           0 NULL            NULL            NULL                                     0
name            char                     10        NULL        NULL           0 NULL            NULL            NULL                                     0

exp_row_size reservepagegap fillfactor  max_rows_per_page identity_gap
------------ -------------- ----------- ----------------- ------------
           1              0           0                 0            0

concurrency_opt_threshold
-------------------------
                        0

Object is Remote/External
-------------------------
presales.pubs2.dbo.t_testproxy            //可从此处看出代理表所指向的真正对象

Object created with 'existing' option

Object does not have any indexes.
No defined keys for this object.
Object is not partitioned.
Lock scheme Allpages
The attribute 'exp_row_size' is not applicable to tables with allpages lock scheme.
The attribute 'concurrency_opt_threshold' is not applicable to tables with allpages lock scheme.

论坛徽章:
0
4 [报告]
发表于 2006-11-28 11:40 |只看该作者

回复 3楼 Blackrose 的帖子

非常感谢你的帖子。我回去就试试。写得非常得好。再次感谢!

论坛徽章:
0
5 [报告]
发表于 2006-11-28 13:50 |只看该作者
写得经典
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP