Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Copying table structure programmatically

Re: Copying table structure programmatically

From: Dave Godbey <luhbey_at_erols.com>
Date: Tue, 31 Oct 2000 20:52:34 -0500
Message-ID: <39FF7761.59CE3DEE@erols.com>

Use the Oracle data dictionary. Look at USER_TABLES and COLS. Pepper your result set with the CREATE command, etc. You can use PL/SQL with DBMS_OUTPUT.PUT_LINE to create output from sqlplus. You can get the tablespaces, extents, etc. using this procedure. It might take a bit of time, especially if you don't know the data dictionary that well, and to what level of detail you need. We use this sort of scheme to capture and recreate indexes as well.
Dave

adnanbader_at_my-deja.com wrote:

> I believe that the import/export utility is only an Oracle tool. Or is
> there a way to programmatically control it from my java program?
>
> I couldn't find any related info. in oracle's JDBC driver. So any help
> in that regard is appreciated.
>
> Thanks.
>
> Adnan
>
> In article <8tlv2i$8ss$1_at_news.bicos.de>,
> "Andreas Walter" <andreas.walter_at_moellergroup.com> wrote:
> > Hi,
> >
> > have you thought of the export and import-utility with the ROWS=NO
 option
> > ?
> >
> > regards,
> > Andreas
> >
> > <adnanbader_at_my-deja.com> schrieb im Newsbeitrag
> > news:8tlqvg$3qf$1_at_nnrp1.deja.com...
> > > Hi All,
> > >
> > > I have an Oracle DB with a whole bunch of tables. What I want to do
 is
> > > create a copy DB using the tables/structures/constraints from the
> > > existing DB but without any data. And I want to achieve it
> > > programmatically, preferrably using Java/JDBC.
> > >
> > > The consturction of the new DB needs to be performed table-wise,
 i.e.
> > > all the information for one table needs to be extracted from the
 source
> > > DB and used to create that table with those constraints in the
 target
> > > DB. And some tables from the source DB may not be required to be
 moved
> > > over to the target DB at all.
> > >
> > > Any hints??
> > >
> > > Thanks in advance.
> > >
> > >
> > > Adnan
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Oct 31 2000 - 19:52:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US