Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Idea for database migration using parallelism at the table level
The Oracle 9i Database Utilities document contains a section
entitled How to Use Export and Import to Partition a Database
Migration. It describes a method to break up the migration into
parallel imports of schemas. Unfortunately for me, that won't
work because most of my databases don't have equally sized
schemas. There's usually one schema that's bigger than all the
others combined by far. What I need is a method to break up the
migration into parallel imports of tables. I've thought this out
and come up with the following strategy. I would greatly
appreciate it if readers would review it and see if there are any
holes in this strategy.
Note: Where exp is piped into imp, the necessary details to achieve this via named pipes are omitted, but hopefully you understand the intention.
Phase 1 - Migrate meta-data
Each of the following phases will use a script to generate the table list and then spawn N processes to process the list in parallel.
Phase 2 - Tables that are fkey parents only (data, indexes,
contraints)
Phase 3 - Tables that are fkey parents and children (just the
data, to avoid constraint conflicts)
Phase 4 - Tables that are fkey parents and children (just the
indexes, so constraints in next phase work)
Phase 5 - Tables that are fkey parents and children (just the
constraints)
Phase 6 - Tables that are not fkey parents (data, indexes,
constraints)
Phase 7 - Non-Table Triggers (anything else missed)
Appendix A - SQL to determine table order
CASE WHEN c.child_of > 0 THEN 2 ELSE 1 END ELSE 3
,x.total_bytes / 1024 extents_kb ,t.owner ,t.table_name ,t.partition_name ,p.parent_of ,c.child_of
NOT t.owner = 'SYS' AND t.owner = p.table_owner(+) AND t.table_name = p.table_name(+)) t
NOT p.owner = 'SYS' AND p.constraint_name = c.r_constraint_name AND c.constraint_type = 'R'
t.owner = x.owner AND t.table_name = x.segment_name AND t.partition_name = x.partition_name AND t.owner = p.owner(+) AND t.table_name = p.table_name(+) AND t.owner = c.owner(+) AND t.table_name = c.table_name(+)ORDER BY
,2 DESC ,3 ,4