免费注册 查看新帖 |

Chinaunix

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

RS到IQ之间的复制能不能实现? [复制链接]

论坛徽章:
2
数据库技术版块每日发帖之星
日期:2015-08-23 06:20:00数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-04 16:25 |只看该作者 |倒序浏览
replication server 到 IQ之间的复制能不能实现?

如果能如何实现的?

论坛徽章:
0
2 [报告]
发表于 2009-06-07 22:56 |只看该作者
可以,和ase一样

论坛徽章:
2
数据库技术版块每日发帖之星
日期:2015-08-23 06:20:00数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
3 [报告]
发表于 2009-06-08 10:28 |只看该作者
在add server时选那个选项?
ASE?

论坛徽章:
0
4 [报告]
发表于 2009-06-08 11:40 |只看该作者
你可以通过脚本的方式在RS中创建连接,方式和ASE一样。
另外:
小数据量的复制可以通过RS,但是对一些大数据量复制,则不推荐直接复制,因为IQ的插入操作比ASE慢两个数量级。推荐用中间暂存库load数据。

论坛徽章:
2
数据库技术版块每日发帖之星
日期:2015-08-23 06:20:00数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
5 [报告]
发表于 2009-06-08 17:40 |只看该作者
创建了连接以后,DSIdown l了。
报错如下:
E. 2009/06/08 15:49:09. ERROR #1028 DSI(214 zbiqsvr01.zbiqsvr01) - \dsioqid.c(202
        Message from server: Message: 201, State 0, Severity 16 -- 'ASA Error -615: Parameter '' not found in procedure '???''.
E. 2009/06/08 15:49:09. ERROR #5046 DSI(214 zbiqsvr01.zbiqsvr01) - \dsioqid.c(2042)
        When executing the rs_get_lastcommit function in database 'zbiqsvr01.zbiqsvr01', received data server errors. See logged data server errors for more information.
我已在IQ总建立了rs_get_lastcommit 过程还是报这个错 。
建立连接的时候我没找到IQ的连接,就选择了ASA的。

论坛徽章:
0
6 [报告]
发表于 2009-06-09 10:53 |只看该作者
$REP/scripts/rs_install_replicate.sql 这个脚本在iq上运行了吗?

论坛徽章:
2
数据库技术版块每日发帖之星
日期:2015-08-23 06:20:00数据库技术版块每日发帖之星
日期:2015-09-21 06:20:00
7 [报告]
发表于 2009-06-09 14:23 |只看该作者
/*
** Confidential property of Sybase, Inc.
** (c) Copyright Sybase, Inc. 1985 to 1991.
** All rights reserved
*/

/*
** generic/script/%M%:                %I%        %G%        %U%
**
** This prepares a SQL Server to receive replicated data.
*/

/* Drop the table, if it exists. */
if exists (select name
                from sysobjects
                where name = 'rs_lastcommit' and type = 'U')
begin
        drop table rs_lastcommit
end
go

/*
** Create the table.
** We pad each row to be greater than a half page but less than one page
** to avoid lock contention.
*/

create table rs_lastcommit
        (
        origin                int,
        origin_qid        binary(36),
        secondary_qid        binary(36),
        origin_time        datetime,
        dest_commit_time        datetime,
        pad1                binary(255),
        pad2                binary(255),
        pad3                binary(255),
        pad4                binary(255),
        pad5                binary(4),
        pad6                binary(4),
        pad7                binary(4),
        pad8                binary(4)
        )
go
create unique clustered index rs_lastcommit_idx on rs_lastcommit(origin)
go

if exists (select name
                from sysobjects
                where name = 'rs_threads' and type = 'U')
begin
        drop table rs_threads
end
go

/*
** Create the table.
** We pad each row to be greater than a half page but less than one page
** to avoid lock contention.
*/

create table rs_threads
        (
        id                  int,
        seq              int,
        pad1            char(255),
        pad2            char(255),
        pad3            char(255),
        pad4            char(255),
        )
go
create unique clustered index rs_threads_idx on rs_threads(id)
go

grant select on rs_threads to public
go

/* Drop the procedure to update the table. */
if exists (select name
                from sysobjects
                where name = 'rs_update_lastcommit' and type = 'P')
begin
        drop procedure rs_update_lastcommit
end
go
/* Create the procedure to update the table. */
create procedure rs_update_lastcommit
        @origin                int,
        @origin_qid        binary(36),
        @secondary_qid        binary(36),
        @origin_time        datetime
as
        update rs_lastcommit
                set origin_qid = @origin_qid, secondary_qid = @secondary_qid,
                        origin_time = @origin_time,
                        dest_commit_time = getdate()
                where origin = @origin
        if (@@rowcount = 0)
        begin
                insert rs_lastcommit (origin, origin_qid, secondary_qid,
                                origin_time, dest_commit_time,
                                pad1, pad2, pad3, pad4, pad5, pad6, pad7, pad
                        values (@origin, @origin_qid, @secondary_qid,
                                @origin_time, getdate(),
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
        end
go

/* Drop the procedure to get the last commit. */
if exists (select name
                from sysobjects
                where name = 'rs_get_lastcommit' and type = 'P')
begin
        drop procedure rs_get_lastcommit
end
go

/* Create the procedure to get the last commit for all origins. */
create procedure rs_get_lastcommit
as
        select origin, origin_qid, secondary_qid
                from rs_lastcommit
go

/* Drop the procedure to update the table. */
if exists (select name
                from sysobjects
                where name = 'rs_update_threads' and type = 'P')
begin
        drop procedure rs_update_threads
end
go
/* Create the procedure to update the table. */
create procedure rs_update_threads
        @rs_id                 int,
        @rs_seq                int
as
        update rs_threads set seq = @rs_seq where id = @rs_id
        if (@@rowcount = 0)
        begin
                insert into rs_threads
                        (id, seq, pad1, pad2, pad3, pad4)
                        values(@rs_id, @rs_seq, "", "", "", ""
        end
go

grant all on rs_update_threads to public
go
/* Drop the procedure to update the table. */
if exists (select name
                from sysobjects
                where name = 'rs_get_thread_seq' and type = 'P')
begin
        drop procedure rs_get_thread_seq
end
go
/* Create the procedure to update the table. */
create procedure rs_get_thread_seq
        @rs_id             int
as
        select seq from rs_threads where id = @rs_id
go

grant all on rs_get_thread_seq to public
go

/* Drop the procedure to update the table. */
if exists (select name
                from sysobjects
                where name = 'rs_initialize_threads' and type = 'P')
begin
        drop procedure rs_initialize_threads
end
go
/* Create the procedure to update the table. */
create procedure rs_initialize_threads
        @rs_id          int
as
        delete from rs_threads where id = @rs_id
        insert into rs_threads values (@rs_id, 0, 0x0, 0x0, 0x0, 0x0)
go
grant all on rs_initialize_threads to public

/* Drop the procedure to mark the log. */
if exists (select name
                from sysobjects
                where name = 'rs_marker' and type = 'P')
begin
        drop procedure rs_marker
end
go

if exists (select name from sysobjects
                where name = 'rs_ticket_report' and type = 'P')
begin
        drop proc rs_ticket_report
end
go

/*
** Name: rs_ticket_report
**   Append PDB timestamp to rs_ticket_param.
**   DSI calls rs_ticket_report if DSI_RS_TICKET_REPORT in on.
**
** Parameter
**   rs_ticket_param: rs_ticket parameter in canonical form.
**
** rs_ticket_param Canonical Form
**   rs_ticket_param ::= <section> | <rs_ticket_param>;<section>
**   section         ::= <tagxxx>=<value>
**   tag             ::= V | H | PDB | EXEC | B | DIST | DSI | RDB | ...
**   Version value   ::= integer
**   Header value    ::= string of varchar(10)
**   DB value        ::= database name
**   Byte value      ::= integer
**   Time value      ::= hh:mm:ss.ddd
**
** Note:
**   1. Don't mark rs_ticket_report for replication.
**   2. DSI calls rs_ticket_report iff DSI_RS_TICKET_REPORT in on.
**   3. This is an example stored procedure that demonstrates how to
**      add RDB timestamp to rs_ticket_param.
**   4. One should customize this function for parsing and inserting
**      timestamp to tables.
*/
create procedure rs_ticket_report
@rs_ticket_param varchar(255)
as
begin
set nocount on

declare @new_cmd varchar(255),
        @c_time  datetime,
        @c_secs  numeric(6,3)

select @c_time = getdate()
select @c_secs = datepart( millisecond, @c_time)
select @c_secs = datepart( second, @c_time) + @c_secs/1000
select @new_cmd = @rs_ticket_param + ";RDB(" + db_name()
                + "=" + convert( varchar(2), datepart( hour, @c_time))
                + ":" + convert( varchar(2), datepart( minute, @c_time))
                + ":" + convert( varchar(6), @c_secs)

-- print @new_cmd
end
go

grant execute on rs_ticket_report to public
go

是这个过程么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP