473,809 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weekly Mass Data Relocation

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 db each
week and currently, I run a backup on the table using the MySql
Administrator.. . then I run restore on my website's mysql server.
This deletes the whole table and reinserts each row. This isn't needed
and is a long process.
Is there a way to select a range of rows from the localhost table and
"migrate" those rows to my website's mysql server without following the
process I just described? Thanks in advance!

Greg

Apr 5 '06 #1
2 1598
Bac2Day1 wrote:
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 db each
week and currently, I run a backup on the table using the MySql
Administrator.. . then I run restore on my website's mysql server.
This deletes the whole table and reinserts each row. This isn't needed
and is a long process.
Is there a way to select a range of rows from the localhost table and
"migrate" those rows to my website's mysql server without following the
process I just described? Thanks in advance!


mysqldump has an option "--where" which allows you to specify a
condition for selecting a subset of rows. I assume this is to be used
when you specify a single table when backing up.

See http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Unfortunately, there does not seem to be a GUI for specifying this
option in MySQL Administrator's Backup screen. I'd recommend writing a
BAT script to run the backup. For example, if your records have a
column called `data_entry_dat e` which records the date the row was created:

mysqldump --no-create-db --no-create-info --extended-insert
--complete-insert --where='data_ent ry_date > CURDATE() - INTERVAL 4
WEEK' database_name table_name > four_week_dump. sql

Note the use of the --no-create-* options, which omit the CREATE
DATABASE and CREATE TABLE statements from the dump output.

Regards,
Bill K.
Apr 5 '06 #2
Would an incremental solution be better?

Keep 5 weeks of data on local (4 previous + current week)

Each day:

mysqldump --no-create-db --no-create-info --extended-insert
--complete-insert --where='data_ent ry_date between CURDATE() - INTERVAL
1
DAY and CURDATE()' database_name table_name > 1_dump.sql
## gets yesterdays data

ftp to web server and apply plus:
delete from table_name where data_entry_date < CURDATE() - interval 4
week;

You will incur no downtime by having to truncate the table and reinsert
all 200MB. Your processing will be much more efficient.

Depending on your version you may have to use INTERVAL 30 DAY

Apr 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2192
by: w00t | last post by:
I am running Suse 9.0 and have been working with postgresql 7.3.3 When I run psql as psql -v or psql -V and even psql --help I get a relocation error psql: relocation error: /usr/lib/libreadline.so.4: undefined symbol: BC Is there anyway to fix this with out reinstalling postgresql. Thanks,
1
2160
by: willie | last post by:
Hi all: I have a clustering SQL Server on Node1 and Node2, the Node1 has named Instance1 and Node2 has named Instance2, no default instance. We tested it that everthing is OK, then we decide to move to DR location. The relocation kept the same virtual and phusical server name, and we did not change SQL Server server network utility. But server IP addresses were changed(vitual and physical). We can start the clustering SQL Server as...
1
1873
by: kartik | last post by:
Hi , I am in need to find a way, to mass copy the data from db2 table running in mainframe to universal database db2 on NT. I know that DB2 connect gives the flexiblity of connecting and communicate the db2 application running in mainframe. but i want to know that whether i can do mass transfer data between the two system . i like to do as a night job that runs for many hrs.I like to know any protocol is used for such connectivity and...
0
1646
by: sylvain | last post by:
http://groups.yahoo.com/group/HiTechUnited (Source of articles about the HiTech Underemployment Crisis) HiTechUnited is a weekly newsletter, delivered Mondays, written by and for underemployed/unemployed HiTech workers. Subscribers believe something can be done to improve our situation and we can "Work It Out" together. If you've been downsized from HiTech and care about the revival of the HiTech industry(in whatever new form), make a...
3
2372
by: Strasser | last post by:
In Access2000 mass emailing worked perfectly (very powerful tool!). Doesn't work when using XP version of both Access and Outlook, even though I checked the box to ensure that I was sending the email. Any ideas? Thanks in advance.
4
4583
by: termiflyer | last post by:
Does anyone have any recommendations (books, links to class web pages, etc) for straight-forward learning about everything in between C programming and assembler? I know C fairly well, and I know assembler fairly well (as far as using the instruction set to get things done). What I'm short on is the in between parts: position independent code, relocation, different sections (SDA, BSS, etc), placing them in flash, relocating to RAM, how to...
0
1252
by: Nadav | last post by:
Hi I am trying to intercept Win32 API, to achieve that I wish to manipulate the relocation table ( the API addresses table that is being created upon process startup/DLL Loading ), I have succeeded getting the IMAGE_NT_HEADERS for the created process and succeeded getting the PIMAGE_BASE_RELOCATION of the ".reloc" section BUT I can't figure out where to go from here... how should the PIMAGE_BASE_RELOCATION pointer be used to access and...
1
1922
by: Timothy Larson | last post by:
I've been scanning groups and Googling and can't figure out why I'm getting this error. I've read about using the -fPIC flag but I've been doing that. Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: R_PPC_REL24 relocation at 0x0e56191c for symbol `floor' out of range Lots of people post about this problem but I can't find solutions. The symbol out of range changes, but the...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10637
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.