西西軟件園多重安全檢測下載網(wǎng)站、值得信賴的軟件下載站!
西西首頁 電腦軟件 安卓軟件 電腦游戲 安卓游戲 排行榜 專題合集

數(shù)據(jù)庫比對工具

v1.0 綠色版
  • 數(shù)據(jù)庫比對工具v1.0 綠色版
  • 軟件大小:10KB
  • 更新時間:2013-10-09 14:17
  • 軟件語言:中文
  • 軟件廠商:
  • 軟件類別:國產(chǎn)軟件 / 免費(fèi)軟件 / 數(shù)據(jù)庫類
  • 軟件等級:4級
  • 應(yīng)用平臺:WinAll, WinXP
  • 官方網(wǎng)站:暫無
  • 應(yīng)用備案:
好評:50%
壞評:50%

軟件介紹

數(shù)據(jù)庫比對工具是一款綠色小巧的數(shù)據(jù)庫對比軟件

功能:

該軟件作用是將兩個數(shù)據(jù)庫(sql server)進(jìn)行表結(jié)構(gòu)比對,軟件界面簡潔,操作簡單方便。

數(shù)據(jù)庫對比方法:

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;
/

軟件標(biāo)簽: 數(shù)據(jù)庫

其他版本下載

最新評論查看所有(1)條評論 >

第 1 樓 四川省成都市 網(wǎng)友 客人 2011/4/13 17:58:22
能夠很輕易的對于2個數(shù)據(jù)庫,很方便啊

支持( 0 ) 蓋樓(回復(fù))

發(fā)表評論

昵稱:
表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
查看所有(1)條評論 > 字?jǐn)?shù): 0/500

TOP
軟件下載