免费注册 查看新帖 |

Chinaunix

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

如何测试sota同步HELLO WORLD [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-10-22 15:51 |只看该作者 |倒序浏览
测试同步HELLO WORLD

一、测试校验
校验源数据库与备库的数据是否具有一致性,首先确定源数据库与备库中都不存在表名为scott.test_hello的表。
使用sqlplus 命令desc scott.test_hello
SQL> desc scott.test_hello;
如显示 ERROR:
       ORA-04043: object scott.test_hello does not exist
则表示数据库中不存在该表,否则则有。
二、数据准备
测试源数据库名为tt,备库名为orcl;
数据库版本:  ORACLE 11.2.0.1.0;
操作系统:  UBUNTU 12.04  64位
需用到的SQL 语句:
desc scott.test_hello;
create table scott.test_hello(str varchar2(20));
insert into scott.test_hello values('hello world');
三、使用过程
A. 在源数据库中产生hello world
使用sqlplus在源数据库tt中先创建一张表:
SQL> create table scott.test_hello(str varchar2(20));
Table created.
向表中添加数据:
SQL> insert into scott.test_hello values('hello world');
1 row created.
B. 在备库中查看hello world
使用sqlplus在备octl中查看是否有scott.test_hello表,然后查看表中是否有hello world 数据。
SQL>select owner,table_name from all_tables where owner='SCOTT' and table_name='TEST_HELLO';

OWNER                               TABLE_NAME
------------------------------ ------------------------------
SCOTT                               TEST_HELLO
C. 备库中存在表scott.test_hello。
操作描述        sqlplus显示        结果
查看源库 scott.test_hello的表结构:        SQL> desc scott.test_hello;
Name                                           Null?    Type
----------------------------------------- -------- ----------------------------
STR                                                    VARCHAR2(20)         说明目标数据库与源库中的表结构一致。
查看备库 scott.test_hello的表结构:        SQL> desc scott.test_hello;
Name                                           Null?    Type
----------------------------------------- -------- ----------------------------
STR                                                    VARCHAR2(20)        
查看源库scott.test_hello表数据        SQL> select * from scott.test_hello;

STR
--------------------
hello world         说明源库与备库的数据一致。
查看备库scott.test_hello表数据        SQL> select * from scott.test_hello;

STR
--------------------
hello world        


四、源库、备库同步
从上述结果可以看出在源库tt中所做的操作,全部同步到了备库orcl上。Sota系统完成了数据库的同步。
如果有疑问请咨询沃信科技公司的技术人员,有兴趣着请登录沃信科技网站了解相关的内容。









您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP