Akai123
asked on
How to get object discription from databases using a script.
Hi,
I have a data base having 160 tables. I need a SQL script which can output table name and its description
accessing oracle metadata.
The script should spool output the Describe Table for each and every table in following way.
1) desc TableA
id1 number
c1 varchar2(150)
n1 nuber(p,s)
d1 date
2) desc TableB
id2 number
n2 nuber
c2 varchar2(150)
n3 nuber(p,s)
d2 date
Basically I want to compare the same set of tables between the 2 data bases to find the deviations since they exists in our environment.
deviations like 2 different data types
more columns in one DB and less in other for the same table.
If I can spool information in a text file I can find diff using a tool. If there is another easier way without creating db_links I will go for it.
Please help me to find a way without comparing table by table manually.
Thanks
I
I have a data base having 160 tables. I need a SQL script which can output table name and its description
accessing oracle metadata.
The script should spool output the Describe Table for each and every table in following way.
1) desc TableA
id1 number
c1 varchar2(150)
n1 nuber(p,s)
d1 date
2) desc TableB
id2 number
n2 nuber
c2 varchar2(150)
n3 nuber(p,s)
d2 date
Basically I want to compare the same set of tables between the 2 data bases to find the deviations since they exists in our environment.
deviations like 2 different data types
more columns in one DB and less in other for the same table.
If I can spool information in a text file I can find diff using a tool. If there is another easier way without creating db_links I will go for it.
Please help me to find a way without comparing table by table manually.
Thanks
I
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I recommend SchemaSpy, it will create nice HTML documentation and it's released under GNU General Public License.
;)
Or...you can re-invent the wheel.
:p
;)
Or...you can re-invent the wheel.
:p
this will provide the output you are looking for
select table_name,column_name,dat
order by table_name,column_name