单实例oracle ha,单实例和RAC打造的ORACLE STREAM(完)

第十二步,备库下创建应用进程:

USER is "SCOTT"

SQL> conn strmadmin/strmadmin

Connected.

SQL> begin

2  dbms_streams_adm.add_schema_rules(

3  schema_name => 'scott',

4  streams_type => 'apply',

5  streams_name => 'apply_storm',

6  queue_name => 'strmadmin.storm_queue',

7  include_dml => true,

8  include_ddl => true,

9  include_tagged_lcr => false,

10  source_database => 'ora',

11  inclusion_rule => true);

12  end;

13  /

PL/SQL procedure successfully completed.

第十三步,主库备库分别启动stream:

备库:

SQL> begin

2  dbms_apply_adm.start_apply(

3  apply_name => 'apply_storm');

4  end;

5  /

PL/SQL procedure successfully completed.

主库:

SQL> begin

2  dbms_capture_adm.start_capture(

3  capture_name => 'capture_ora');

4  end;

5  /

PL/SQL procedure successfully completed.

第十四步,测试过程:

1,主库下以scott用户登陆并创建一张表:

SQL> conn scott/tiger

Connected.

SQL> CREATE TABLE TTT(id NUMBER PRIMARY KEY,name VARCHAR2(50));

Table created.

2,备库下进行查看是否有相应表:

$ sqlplus scott/tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 19 15:45:54 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> desc ttt

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

ID                                        NOT NULL NUMBER

NAME                                               VARCHAR2(50)

storm2:

SQL> desc ttt;

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

ID                                        NOT NULL NUMBER

NAME                                               VARCHAR2(50)

3,主库下插入数据:

SQL> insert into ttt values (1,'storm is a good guy');

1 row created.

SQL> select * from ttt;

ID NAME

---------- --------------------------------------------------

1 storm is a good guy

4,备库下进行检验:

SQL> select * from ttt;

no rows selected

这时看到没有任何数据生成,在这个地方需要注意的是,主库插入了数据但是并没有提交,所以备库无法查看数据生成结果。

5,主库进行提交:

SQL> commit;

Commit complete.

6,备库再次查看:

SQL> select * from ttt;

ID NAME

---------- --------------------------------------------------

1 storm is a good guy

storm2:

SQL> select * from ttt;

ID NAME

---------- --------------------------------------------------

1 storm is a good guy

至此,整个实验过程宣告结束。仔细对比两次实验可以发现,两个单实例构建的stream和单实例、RAC构建的stream的基本步骤都是相同的,所不同的地方只是体现在归档模式的设置,只要本着一个数据库的概念,一切都能顺利完成了。

全文毕。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值