Question: I want to move all db objects
from one schema to another schema.
How do I copy an Oracle schema?
Answer: To clone a schema, I would use
either of these methods:
- Copy schema with Data Pump export/import: Use
expdp to export the old schema and import into the new
schema using
impdp with the "remap schema" parameter. The Rampant
Oracle Utilities book has full examples of copying a schema.
- Copy schema with CTAS: Create the new schema owner,
use
CTAS to copy the tables, and then punch & re-add constraints
and indexes using
dbms_metadata. Parallelized CTAS is a faster way to copy a
schema than using Data Pump, but the copy steps are more
complex.
See the link for a working example of a
script to copy an Oracle user.
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|