I want to get all table definition for all my tables. And I want to do it fast (it is part of a script that I'm running a lot)
I am using oracle 11g, and I have 700 tables. On a plain jdbc code it takes 4 minutes and does:
s = con.statement("select DBMS_METADATA.GET_DDL(object_type,object_name) from user_objects where object_type = 'TABLE');
s.execute();
rs = s.getResultSet();
while(rs.next()){
rs.getString(1);
}
SO I want to optimize this code and reach around 20 sec.
I have already reached 40-50 sec by creating 14 threads that each opens a connection to the database and reads a part of the information, using mod on the rownum.
But this is not enough.
I am thinking in these directions:
http://docs.oracle.com/cd/B10501_01/java.920/a96654/connpoca.htm#1063660 - connection caching. can it help speed up things by replacing my 14 connections with connectionCaching?
Is it possible to keep the tables accessed by this function, in the KEEP buffer cache area?
Anyway of indexing some of the information here?
Any other suggestions will be greatly appreciated.
Thank you