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

Home -> Community -> Usenet -> c.d.o.misc -> "Legacy" Data Conversion Design

"Legacy" Data Conversion Design

From: Oscar Bowyer <oscarbow_at_earthlink.net>
Date: Tue, 05 Aug 2003 22:28:42 GMT
Message-ID: <ucWXa.7151$WM4.6343@newsread1.news.atl.earthlink.net>


I have a "Legacy" data conversion project. I've done this sort of thing in the past using SQL scripts, but this particular project appears to be a bit more complex and I'm considering some alternate design ideas. Below is the basic info.

Thanks for any and all input.

Conversion Design Plan

Constraints/Requirements:

  1. Source data in flat file layout (46 columns).
  2. Destination data in relational layout with 5 (maybe more) tables.
  3. Raw import of source data into Oracle table complete (raw varchar2 columns).
  4. Initial source conversion of Date and numeric columns complete.
  5. Initial conversion/load of records into 1 top level table complete (using SQL script).
  6. Primary key (sequence) numbers must be maintained between destination tables. Destination tables have no referential integrity constraints defined so conversion process will be responsible for this.
  7. Source record count approx 400k rows. Destination rows will be approx 1.2 million all tables combined.
  8. Invalid source data must be written out to error table for review and possible remediation.
  9. Conversion process is planned to run ONCE, and run time is not critical. If any problems are discovered, then the conversion code may be revised and rerun.
  10. Destination tables have between 10 and 40 columns.
  11. Source data is NOT being used by ANY other application, so concurrency issues "should not" be a problem.

Next Step:

  1. Evaluate complex if/then/decode logic to convert source data into 4 (or more) remaining destination tables.

Options/Questions:

  1. Continue using SQL Script. This means massive/complex SQL with many/nested DECODEs Advantages:
  2. SQL "should" be faster than procedural code. Disadvantages:
  3. Getting this SQL working and verified to load each destination is not easy.
  4. Misplacing a single ( or , in this SQL could take an hour to find.
  5. Maintaining this SQL will be difficult due to sheer size and complexity.
  6. What is Oracle's max SQL string size?
  7. SQL could take hours to run, causing waits before results can be verified. Questions:
  8. Would you use SQL? Why?
  9. Use PL/SQL code to load each (or one) source row and process into all destination tables. Advantages:
  10. each column conversion step will be isolated, so maintainability is better.
  11. can process small groups of records, avoid waits before verifying results.
  12. could break conversion steps into separate procedures to reduce complexity, ease maintenance.
  13. can write invalid rows into error table as each row is being processed. Disadvantages:
  14. Slower than SQL? Questions:
  15. I have a plan to commit after each source row is processed into the destination tables by inserting its key into a "processed" table. This could allow the conversion to start at the first failed row and avoid starting over from the beginning. Does this sound like a good idea?
  16. How to avoid rollback segment overrun?

As you can see, I'm leaning toward PL/SQL but I would like to hear other ideas/opinions?

Thanks,
Oscar Bowyer Received on Tue Aug 05 2003 - 17:28:42 CDT

Original text of this message

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