Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Dumping all the sql statements as backup

Reply
Thread Tools

Dumping all the sql statements as backup

 
 
andrea crotti
Guest
Posts: n/a
 
      07-25-2012
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
 
Reply With Quote
 
 
 
 
Robert Miles
Guest
Posts: n/a
 
      08-30-2012
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.

 
Reply With Quote
 
 
 
 
Jason Friedman
Guest
Posts: n/a
 
      08-31-2012
>> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Dumping all the sql statements as backup andrea crotti Python 0 07-25-2012 03:31 PM
Re: Dumping all the sql statements as backup Jack Python 0 07-25-2012 02:52 PM
Prepare Statements VS Statements Vince Java 12 01-21-2008 01:18 PM
component statements within architecture statements Neil Zanella VHDL 8 10-20-2006 09:05 AM
if statements with or w/o else statements Harry George Python 6 02-23-2004 06:48 PM



Advertisments