西西软件园多重安全检测下载网站、值得信赖的软件下载站!
西西首页 电脑软件 安卓软件 电脑游戏 安卓游戏 排行榜 专题合集

数据库比对工具

v1.0 绿色版
  • 数据库比对工具v1.0 绿色版
  • 软件大小:10KB
  • 更新时间:2013-10-09 14:17
  • 软件语言:中文
  • 软件厂商:
  • 软件类别:国产软件 / 免费软件 / 数据库类
  • 软件等级:4级
  • 应用平台:WinAll, WinXP
  • 官方网站:暂无
  • 应用备案:
好评:50%
坏评:50%

软件介绍

数据库比对工具是一款绿色小巧的数据库对比软件

功能:

该软件作用是将两个数据库(sql server)进行表结构比对,软件界面简洁,操作简单方便。

数据库对比方法:

alter session set sort_area_size=1024000000;

set serveroutput on;
declare
state1 varchar2(250);
state2 varchar2(250);
type cur_sor is ref cursor;
cur_1 cur_sor;
cur_2 cur_sor;
num1 number;
num2 number;
num3 number;
begin

--alter session set sort_area_size=1024000000;

delete from w_tab_cols;
delete from w_tab_only;
delete from w_tab_lob;

commit;

for rec in
(select distinct table_name from user_tab_cols@s_link where table_name in(select table_name from user_tab_cols@s_link where data_type like '%LOB%' or data_type like '%LONG%'))
loop
insert into w_tab_lob
values('s_link',rec.table_name);
end loop;

for rec in
(select distinct table_name from user_tab_cols@d_link where table_name in(select table_name from user_tab_cols@d_link where data_type like '%LOB%' or data_type like '%LONG%'))
loop
insert into w_tab_lob
values('d_link',rec.table_name);
end loop;

for rec in
(select table_name,column_name,data_type,data_length from user_tab_cols@s_link where table_name not in(select table_name from user_tab_cols@s_link where data_type like '%LOB%' or data_type like '%LONG%'))
loop
insert into w_tab_cols
values('s_link',rec.table_name,rec.column_name,rec.data_type,rec.data_length);
end loop;

for rec in
(select table_name,column_name,data_type,data_length from user_tab_cols@d_link where table_name not in(select table_name from user_tab_cols@d_link where data_type like '%LOB%' or data_type like '%LONG%'))
loop
insert into w_tab_cols
values('d_link',rec.table_name,rec.column_name,rec.data_type,rec.data_length);
end loop;

for rec in
(select table_name from w_tab_cols where side='s_link' and table_name not in
(select table_name from w_tab_cols where side='d_link'))
loop
insert into w_tab_only
values(rec.table_name,'s_link');
end loop;

for rec in
(select table_name from w_tab_cols where side='d_link' and table_name not in
(select table_name from w_tab_cols where side='s_link'))
loop
insert into w_tab_only
values(rec.table_name,'d_link');
end loop;



--

for rec in
(select distinct table_name from w_tab_cols
where table_name not in (select table_name from w_tab_only))
loop
num1:=0;
num2:=0;
num3:=0;

select count(*) into num1 from w_tab_cols where table_name=rec.table_name and side='s_link';
select count(*) into num2 from w_tab_cols where table_name=rec.table_name and side='d_link';
select count(*) into num3 from (select table_name,column_name,data_type,data_length from w_tab_cols where side='s_link' and table_name=rec.table_name intersect
select table_name,column_name,data_type,data_length from w_tab_cols where side='d_link' and table_name=rec.table_name);


if num1=num2 and num2=num3 and num3=num1
then
insert into w_tab_only
values(rec.table_name,'both');
end if;
end loop;


for rec in
(select distinct table_name from w_tab_cols where side='s_link' and table_name not in
(select table_name from w_tab_only))
loop
insert into w_tab_only
values(rec.table_name,'struct_diff');
end loop;

commit;

for rec in
(select table_name from w_tab_only where side='both' and table_name not like 'BIN$%')
loop

num1:=0;
num2:=0;
state1:='select count(*) from (select * from '||rec.table_name||'@s_link'||' minus '||'select * from '||rec.table_name||'@d_link)';
execute immediate state1 into num1;

state2:='select count(*) from (select * from '||rec.table_name||'@d_link'||' minus '||'select * from '||rec.table_name||'@s_link)';
execute immediate state2 into num2;

if num1>0 or num2>0
then
update w_tab_only set side='data_diff' where table_name=rec.table_name;
end if;
end loop;

commit;

end;
/

软件标签: 数据库

软件截图

数据库比对工具 v1.0 绿色版

其他版本下载

最新评论查看所有(1)条评论 >

第 1 楼 四川省成都市 网友 客人 发表于: 2011/4/13 17:58:22
能够很轻易的对于2个数据库,很方便啊

支持( 0 ) 盖楼(回复)

发表评论

昵称:
表情: 高兴 可 汗 我不要 害羞 好 下下下 送花 屎 亲亲
TOP
软件下载