Refresh a Schema - Data Only [message #344082] |
Thu, 28 August 2008 13:58 |
klabu
Messages: 4 Registered: October 2006 Location: DC
|
Junior Member |
|
|
10gR2
I want to refresh a shema - data only
If I'm to use expdp to export "scott" from Production and use impdp to import to "scott" on Test....
What is the best approach on the import ?
1) Should I drop all tables under "scott" or truncate them ?
2) What about table constraints/Ref. Integrities...how do I deal with them ?
thanks
|
|
|
|
|
|
Re: Refresh a Schema - Data Only [message #344110 is a reply to message #344082] |
Thu, 28 August 2008 15:42 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
klabu wrote on Thu, 28 August 2008 14:58 | 10gR2
I want to refresh a shema - data only
.
.
.
1) Should I drop all tables under "scott" or truncate them ?
|
If you were "refreshing data only" you would not drop tables.
TRUNCating will leave all your indexes in place, making an import very slow.
DROPping the schema will invalidate all objects relying on any object in the SCOTT schema.
So it's up to you to decide which one will be easier and/or cause less headaches.
|
|
|
Re: Refresh a Schema - Data Only [message #344133 is a reply to message #344110] |
Thu, 28 August 2008 17:09 |
klabu
Messages: 4 Registered: October 2006 Location: DC
|
Junior Member |
|
|
joy_division wrote on Thu, 28 August 2008 16:42 |
If you were "refreshing data only" you would not drop tables.
TRUNCating will leave all your indexes in place, making an import very slow.
DROPping the schema will invalidate all objects relying on any object in the SCOTT schema.
So it's up to you to decide which one will be easier and/or cause less headaches.
|
Hi if I take the TRUNCATE route, can you tell me what to do with constraints/RIs in the target schema tables ? (or I don't have to worry about them ???)
thanks
|
|
|
|
Re: Refresh a Schema - Data Only [message #344167 is a reply to message #344082] |
Fri, 29 August 2008 00:19 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
why are you dont want to drop the schema while refreshing as told by Anacedent.That is the most convenient method to refresh schema from production to development.Use parameter remap_tablespace and remap_schema while importing.
Regards,
Varun Punj,
|
|
|
Re: Refresh a Schema - Data Only [message #344236 is a reply to message #344135] |
Fri, 29 August 2008 03:03 |
klabu
Messages: 4 Registered: October 2006 Location: DC
|
Junior Member |
|
|
anacedent wrote on Thu, 28 August 2008 18:13 | >
The truncates have to be done "in order"; do child tables before parent tables.
Loading new data must be done "in order"; load parent tables before child tables.
|
Thanks for the explanation - yes drop/recreate the user is the easiest way of doing this.
|
|
|