数据库比对工具是一款绿色小巧的数据库对比软件
该软件作用是将两个数据库(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;
/
未经书面许可,严禁将本网内容作为AI训练资源。
33台词PC版 0.1
文件批量改名Bulk Rename Utility v3.4.1 中文绿色版
PDF快转(SanPDF) v2.0.6.66 官方版
菲菲更名宝贝之得意非凡FFRenamePro V4.0专业版
查找大文件(WizTree) v3.35 绿色版
文件比较查重工具WinMerge v2.16.8.0 中文版
Windows文件管理器(WinNc) v9.4.0.0 官方安装版
文件压缩档案提取(Explzh) v8.18 官方版
WinMerge v2.16.7.0 官方多语中文版
UltraCompare文件比较工具汉化修正中文版 V21.10.0.20免费64位注册码绿色版
文档自动转换工具BlackIce BiBatchConverter v4.80.632 官方版
批量文本文件处理器 V1.4绿色版
MAXHUB文档客户端 v1.3.1官方PC版
文件校验工具(EF CheckSum Manager) v20.02 官方版
全速pdf转换成excel转换器 v7.8.0.0官方版