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

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

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

軟件介紹

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

功能:

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

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

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ù)庫(kù)

其他版本下載

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

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

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

發(fā)表評(píng)論

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

TOP
軟件下載