Dumping all the sql statements as backup

Discussion in 'Python' started by andrea crotti, Jul 25, 2012.

  1. I have some long running processes that do very long simulations which
    at the end need to write things on a database.

    At the moment sometimes there are network problems and we end up with
    half the data on the database.

    The half-data problem is probably solved easily with sessions and
    sqlalchemy (a db-transaction), but still we would like to be able to
    keep a backup SQL file in case something goes badly wrong and we want to
    re-run it manually..

    This might also be useful if we have to rollback the db for some reasons
    to a previous day and we don't want to re-run the simulations..

    Anyone did something similar?
    It would be nice to do something like:

    with CachedDatabase('backup.sql'):
    # do all your things
    andrea crotti, Jul 25, 2012
    #1
    1. Advertising

  2. andrea crotti

    Robert Miles Guest

    On 7/25/2012 8:56 AM, andrea crotti wrote:
    > I have some long running processes that do very long simulations which
    > at the end need to write things on a database.
    >
    > At the moment sometimes there are network problems and we end up with
    > half the data on the database.
    >
    > The half-data problem is probably solved easily with sessions and
    > sqlalchemy (a db-transaction), but still we would like to be able to
    > keep a backup SQL file in case something goes badly wrong and we want to
    > re-run it manually..
    >
    > This might also be useful if we have to rollback the db for some reasons
    > to a previous day and we don't want to re-run the simulations..
    >
    > Anyone did something similar?
    > It would be nice to do something like:
    >
    > with CachedDatabase('backup.sql'):
    > # do all your things


    I'm now starting to do something similar, but in C, not Python.
    Apparently not using SQL.

    The simulations this is for often last a month or more.
    Robert Miles, Aug 30, 2012
    #2
    1. Advertising

  3. >> I have some long running processes that do very long simulations which
    >> at the end need to write things on a database.
    >>
    >> At the moment sometimes there are network problems and we end up with
    >> half the data on the database.
    >>
    >> The half-data problem is probably solved easily with sessions and
    >> sqlalchemy (a db-transaction), but still we would like to be able to
    >> keep a backup SQL file in case something goes badly wrong and we want to
    >> re-run it manually..
    >>
    >> This might also be useful if we have to rollback the db for some reasons
    >> to a previous day and we don't want to re-run the simulations..
    >>
    >> Anyone did something similar?
    >> It would be nice to do something like:
    >>
    >> with CachedDatabase('backup.sql'):
    >> # do all your things

    >


    " ... at the end need to write things on a database ... "

    Is it necessary to write those things during the process, or only at
    the end? If only at the end, can you write locally first, and then
    write that local store to your remote database?
    Jason Friedman, Aug 31, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gavino
    Replies:
    13
    Views:
    1,039
  2. Bigus

    Dumping all Variables

    Bigus, May 1, 2009, in forum: Perl Misc
    Replies:
    8
    Views:
    165
    ccc31807
    May 1, 2009
  3. Jack
    Replies:
    0
    Views:
    208
  4. andrea crotti
    Replies:
    0
    Views:
    227
    andrea crotti
    Jul 25, 2012
  5. Replies:
    0
    Views:
    578
Loading...

Share This Page