[Compare structure] : Tables & columns

Publié le par Majda

HIDDEN CONTENT

--> Compare tables

--> Compare column_name ( could be extented simply by adding column_id, data_type, DATA_LENGTH)

      No matter about position, type, lenght of the columns 

 

prompt comparaison TABLES
select '&util','Miss',  table_name from dba_tables where owner='AS2ETALON'
minus
select '&util','Miss',  table_name from dba_tables where owner='&util'
;

prompt comparaison COLONNES in existante tables ONLY
select * FROM
(

select '&util','Miss',  table_name, column_name  from dba_tab_columns where owner='AS2ETALON'
minus
select '&util','Miss',  table_name, column_name  from dba_tab_columns where owner='&util'
)
where
table_name in (select table_name from dba_tables where owner='&util'
intersect select table_name from dba_tables where owner='AS2ETALON')
;

 

Output :

comparaison TABLES
'AS2CARAT'                       'NEW'        TABLE_NAME
-------------------------------- ------------ ------------------------------
AS2CARAT                         Miss          ACTION_30102008
AS2CARAT                         Niss          ATTR_BINARY_VALUE_022009

 

comparaison COLONNES

'AS2CARAT'                       'NEW'       TABLE_NAME           COLUMN_NAME
-------------------------------- -------------------------------- ------------
AS2CARAT                         Miss        PACKEDEMAILMESSAGE   MAILTYPE


Majda.

Publié dans [Comparison]

Pour être informé des derniers articles, inscrivez vous :
Commenter cet article