473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to store data in a table to use as a backup

zorgi
431 Expert 256MB
Hi

Basically I have table TABLE_1 with number of fields being updated all the time. Once a month I run cron job and all the records in TABLE_1 become not needed for my next cron job. Now I need to somehow back up all used records and prepare my TABLE_1 for new updates. Old records are needed mainly for stats purposes. What from the following would be the best practice to do this:
  1. Create new table identical to TABLE_1 and copy all the used records into it and than delete all the records from TABLE_1 OR
  2. Include an extra field to mark record as used so that next cron job can skip it OR
  3. something else

Thank you for your input.
Jan 27 '10 #1

✓ answered by Atli

Hey.

Ideally you would want to avoid having to actually delete the data after using it, so I would recommend trying your second method.

If there is a LOT of activity on the primary table, you could also consider things like Replication. By which I mean; you could set up a second server which replicates the active server. Then when it comes to running the Cron, you disconnect the slave from the master, clear the table on the master and run your Cron job and archive scripts on the slave. - This way your master server doesn't have to suffer any performance hits when the Cron is running.

2 1650
Atli
5,058 Expert 4TB
Hey.

Ideally you would want to avoid having to actually delete the data after using it, so I would recommend trying your second method.

If there is a LOT of activity on the primary table, you could also consider things like Replication. By which I mean; you could set up a second server which replicates the active server. Then when it comes to running the Cron, you disconnect the slave from the master, clear the table on the master and run your Cron job and archive scripts on the slave. - This way your master server doesn't have to suffer any performance hits when the Cron is running.
Jan 27 '10 #2
zorgi
431 Expert 256MB
Thank you Atli for clearing up for me.

Replication sounds good. Must admit solution No1 did sound bit sloppy :)
Jan 27 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: cover | last post by:
The question is, we have two options to store images, either in a Database (MySQL, Postgres, ...) like blob data, or in the hard disk the file and the path in database. Which option is better?...
0
by: Binay Agarwal | last post by:
------=_NextPart_000_0046_01C3612B.931DFD50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everybody, I have backed(backup.sql) up one Mysql...
1
by: LineVoltageHalogen | last post by:
Greetings All, I was wondering if any of you would share some of your experiences regarding the task of loading a data store from an Oltp source. We are using Analysis Services in a BI product...
2
by: William Cleveland | last post by:
I'm working on a system right now where I have a database (two, actually, but one is discarded halfway through), but it's created and used as part of a process (reporting), rather than as the...
11
by: Heather | last post by:
I need suggestions on possible ways to implement the following: 10 users on a network need to infrequently add data to a backend database on the network. The data would be a couple of records...
4
by: Lars Netzel | last post by:
I just saw this program called Handy Backup 4.5 where you can add backup jobs as such... and I wonder where you normally save data in an application. I come from an ASP world and have started to...
2
by: Bac2Day1 | last post by:
I've got a table located on my website and localhost. The table maintains a size of about 200MB. The table holds a running 4 weeks of data (50MB/week). I have a winapp that updates my localhost...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
6
by: sara440 | last post by:
i want to take backup of one table(tables's data) of database, on hard disk or cd.i have a button "backup" on my form that should ask for backup when clicked.(it should allow to take backup on Cd). ...
5
by: Dmitriy Lapko | last post by:
Hallo all Is it possible to change schema of table in DB2 v.8.2 without recreating and coping a table into a new schema? I need it for several purposes, one of them - refactoring of existing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.