1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Help on Migration Scripts

Discussion in 'General' started by Ravizzz, Dec 15, 2009.

  1. Ravizzz

    Ravizzz Guest


    I am new to Oracle, and the task I have with me is to migrate database tables of one version of an application to another.

    With the help of few forums and ebooks, I have achieved few basic things, but I am stuck with a strange problem, not very sure on how to go by.

    The scenario I have is:-

    I have table X, which is having 4 columns in old version of application let’s call it as A.1, with 20 rows of data filled in it of which I know the ID using which I can migrate to new table.

    In the new version of application, let’s call it as ‘A.2’ which is having same table X is having 5 columns. And it is having the old 20 rows plus 2 new rows added. (Please note addition of new column field.)

    If we directly install the A.2 all the rows and columns are present so application will work fine.

    Customer using this application is moving from A.1 to A.2.

    Customer is having 10 more rows of data filled in X table in A.1 in addition to 20 Rows data we have provided with A.1, of whose we don’t have a way to get the ID’s..

    I have managed to write a script which would migrate the 20 rows provided in A.1, also have added data into the new column which is required as per A.2.

    Also here the requirement changes, for one single row in A.1 I need to insert 4 Rows
    1) By modifying ID to new ID as well.
    2) Adding appropriate data into the new Column.

    So my query is
    1) How to move the rest of the 10 rows?
    2) Problem here is the range of ID that User might have generated is not generic or does not fall into specific range.
    3) Please do note that, I should not modify anything w.r.t 20 row data which came with A.1, but I have to modify only data which Customer as added newly after 20 row data in A.1 to suit A.2
    4) There is no restriction on what ID I have to use for new 10 rows I have to add, (ideally 10*4 rows, as for each row of A.1 would be inserted with 4 rows with different values of ID and new column value)
    5) I am not very sure on how to fetch this Data for insertion at first place here, as there is no common thing that I am sure that customer would have inserted.

    Hope I am clear with my queries, Any ideas and help is much appreciated.
  2. zargon

    zargon Community Moderator Forum Guru

    Likes Received:
    Trophy Points:
    Aurora, CO
    Please move this to the proper forum area.