updating DB from one computer to another

  • fung

    fung - 2004-09-16

    Hi All,

    We have two databases DB1 and DB2. DB1 is in computer C1 and DB2 is in another computer C2. First we export DB1 in C1 by running RUN_DBExport.bat and import it into DB2 in C2 by running RUN_DBRestore.bat. Then users of C2 input data in some tables (say A and B). At the same time, in DB1, we edit the table (say E and F) by creating more columns, as the result we also edit the AD_Column, AD_Field.

    Question is: How could we import those update from DB1 into DB2? As the users have input data, we cant just import the whole database, which will make all the input data lost.

    Any greate idea?

    Thanks a lot!!!

    • petershen

      petershen - 2004-09-25

      1, export the db1
      2, import the db1 into the db2 as another schema,let's say reference
      3, run merge sql
      (merge is a sql command in oracle)

      for example:

      Merge into compiere.AD_Element c1
        using reference.AD_Element c2
      when Matched then
         update Set AD_CLIENT_ID = c2.AD_CLIENT_ID  ,                                  
                  AD_ORG_ID    = c2.AD_ORG_ID     ,                                         
                  ISACTIVE     = c2.ISACTIVE      ,                                       
                  CREATED      = c2.CREATED      ,                                  
                  UPDATED         = c2.UPDATED      ,                  
                  CREATEDBY    = c2.CREATEDBY    ,                                      
                  UPDATEDBY      = c2.UPDATEDBY   ,                                                   
                  NAME           = c2.NAME       ,                                        
                  DESCRIPTION    = c2.DESCRIPTION   ,                                              
                  HELP           = c2.HELP       ,  
                  ENTITYTYPE     = c2.ENTITYTYPE    ,                           
                  COLUMNNAME     = c2.COLUMNNAME   ,                                 
                  PRINTNAME     = c2.PRINTNAME    ,            
                  PO_NAME  = c2.PO_NAME,                                         
                  PO_PRINTNAME    = c2.PO_PRINTNAME          ,
                  PO_DESCRIPTION    = c2.PO_DESCRIPTION  ,               
                  PO_HELP       = c2.PO_HELP 
          when not Matched then

      Peter Shen

    • fung

      fung - 2004-09-26

      That's great!! Thank you very much!!!

      In addition to the table AD_Field and AD_Column, what other tables should i merge?


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks