#计算数据库表相似度
SELECT a.table_name,
d.target_table,
a.col_total,
d.col_num,
d.col_num/a.col_total row_ratio
FROM
(SELECT a.table_name,
count(*) col_total
FROM user_tab_columns a
GROUP BY a.table_name) a
LEFT OUTER JOIN
(SELECT a.table_name source_table,
b.table_name target_table,
count(*) col_num
FROM user_tab_columns a,user_tab_columns b
WHERE a.table_name<>b.table_name
AND a.column_name=b.column_name
GROUP BY a.table_name,
b.table_name) d ON a.table_name=d.source_table
WHERE d.col_num>=a.col_total*0.5
ORDER BY 1,5 DESC
select a.owner,a.name,a.type
from dba_dependencies a
where a.referenced_name='RECORD10W'
and a.referenced_type in ('TABLE','VIEW')
and a.type='PROCEDURE'
select a.owner,a.name,a.type
from sys.all_source a
where type='PROCEDURE'
and upper(text) like '%RECORD10W%'
本文分享自 python与大数据分析 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!