Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Import indexfile=blah - What about constraints ?
Doug Cowles wrote:
>
> Yes..this annoys me also. You need to run a separate script to get all the
> constraints..
>
> Neil Cudd wrote:
>
> > I'm trying to export a schema from my prod'n db and import into my test
> > server after modifying the initial extent allocation (short on disk space
> > !).
> >
> > I did an import with indexfile='filename' to get the table and index DDL and
> > modified all the initial allocations - no problemo. But I've just noticed
> > that no constraint ddl was generated with the indexfile='filename'.
> > Unfortunately all my primary keys were created as constraints !
> >
> > Any ideas greatly appreciated.
> >
> > Regards,
> >
> > neil.
(assuming unix here)
exp file=xyz rows=n
strings xyz.dmp | grep 'ADD CONSTRAINT' | sed 's/$/\;/g'
looks for constraint defn's and add's a ";" at the end so they can be run in SQL Plus...Chuck another sed clause in and you can also add "unrecoverable" to speed your index builds...
I think its two spaces after the "add"...
otherwise grep for "PRIMARY KEY" etc etc
HTH --
"Some days you're the pigeon, and some days you're the statue." Received on Mon Aug 09 1999 - 09:35:50 CDT