方法一、用PL/SQL DEVELOPER 來比較
1.登陸資料庫A.
2.開啟TOOLS選單下的Compare User Objects
3.點Target Session,登陸資料庫B
4.執行Compare
5.返回的是所有不同的物件以及更新語句[@more@]方法二、
1、對需要比較的表進行分析(可全表可抽樣,自選),否則統計資訊不準;
2、透過dba_tab_col_statistics表的column_name欄位進行比較
select tz.table_name ,tz.column_name from dba_tab_col_statistics tz
WHERE tz.owner = "BSS" AND TZ.TABLE_NAME LIKE "BSS_%"
and (TZ.TABLE_NAME ,TZ.COLUMN_NAME) not in(
select TZT.TABLE_NAME ,TZT.COLUMN_NAME
from dba_tab_col_statistics@tz_bsstzt tzt
WHERE tzt.owner = "BSS" AND TZT.TABLE_NAME LIKE "BSS_%")
方法一、用PL/SQL DEVELOPER 來比較
1.登陸資料庫A.
2.開啟TOOLS選單下的Compare User Objects
3.點Target Session,登陸資料庫B
4.執行Compare
5.返回的是所有不同的物件以及更新語句[@more@]方法二、
1、對需要比較的表進行分析(可全表可抽樣,自選),否則統計資訊不準;
2、透過dba_tab_col_statistics表的column_name欄位進行比較
select tz.table_name ,tz.column_name from dba_tab_col_statistics tz
WHERE tz.owner = "BSS" AND TZ.TABLE_NAME LIKE "BSS_%"
and (TZ.TABLE_NAME ,TZ.COLUMN_NAME) not in(
select TZT.TABLE_NAME ,TZT.COLUMN_NAME
from dba_tab_col_statistics@tz_bsstzt tzt
WHERE tzt.owner = "BSS" AND TZT.TABLE_NAME LIKE "BSS_%")