Monday, April 11, 2011

List of New Tables and Columns in a given module

This query can provide list new tables and count of new columns in existing tables after upgrade of Oracle application. This query is run from lower version instance and assumes that a db link exist from lower version instance to higher version instance and link name is Rel12.


select table_name, count(*), nvl((select 'N' from dba_tables where table_name = a.table_name),'Y') new_table
from ( select table_name, column_name, data_type, owner
from dba_tab_columns@Rel12 where owner = 'AP'
minus
select table_name, column_name, data_type, owner
from dba_tab_columns where owner = 'AP'
order by 1,2
) a group by table_name
order by 3,2 desc

No comments:

Post a Comment