database tools, oracle, sql server, db2, monitor, monitoring, performance
home
who are we
products
database product monitor
database product reorg
database product capacity planning
external alerting device
customers
partners
links
competition us and them
oracle dba scripts
contact us
our mail list
[ Jan, 2008 ]
B.G.S Software products are becoming popular in china. (See Brochure)

[ Jan, 2008 ]
We have a BLOG for feedbacks and information sharing. (Visit our blog)

[ Oct, 2006 ]
Capacity Planning Package for Oracle Database is now included in the monitor!. More...

[ Jul, 2006 ]
Build a package of the monitor especially to monitor your application and database. Provide a monitoring tool 'built in' in your product. More...

[ Jul, 2006 ]
New object called "History Keeper" was added to the monitor. This object allows saving history of the monitor into a repository in the database.
It's possible to define the frequency of saving a sample, and the number of days to keep in the repository.

[ Jun, 2006 ]
New electronic equipment called "External alerting device" (made by B.G.S.) was added to the monitor.
The device connects to the PC's parallel port and can activate a siren & light alert (wired or wireless). It's possible to define thresholds and statuses to activate the alert.

Oracle Database Scripts


Compare Table structure between two users:

Compare table structure between the two users identified by variables: 'user_source' and 'user_dest'.
(Compare column names, data types, length, precision, column order, nullable).
The Script's output is the list of tables that have difference in structure between the two schemas or tables that exist in only one of the schemas.


The Script:


set serveroutput on

declare
   user_source varchar2(30) default 'SYSTEM'; --Source user
   user_dest varchar2(30) default 'SYS'; --Destination user
begin
   for crs in (select distinct TABLE_NAME from
    ((select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID
    from dba_tab_columns where owner = upper(user_source)
    minus
    select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID
    from dba_tab_columns where owner = upper(user_dest))
    union
    (select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID
    from dba_tab_columns where owner = upper(user_dest)
    minus
    select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID
    from dba_tab_columns where owner = upper(user_source)))) loop
      dbms_output.put_line(crs.table_name);
   end loop;
end;
/

Donate 5$

If you found this information useful, don't be cheap, donate 5 dollars (with PayPal):