Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Database
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-02-2007, 10:58 AM   #1
tucj7
 
tucj7's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MySQLdump and restore on very large DB

Hi,

I have a very large database > 1.5GB running on 2 servers all MyISAM
tables. One is a staging server and one the live server.

On the staging server the data is manipulated, so rows are modified/
removed/added constantly. The live server has a copy of these tables
and other tracking tables that are not on the staging server.

Once a day I update the live data with the data from the staging
server. I use MySQL dump and then a basic import to overwrite the
existing tables with the new data.

This, however is taking extremely long and the DB table on the live
server is unavailable during the import which is not ideal.

Is there a better way to do this? Is replication the answer? I've
never used it and wouldn't know where to start. The only issue being
that the live server contains some tables that are not on the staging
server and I would like to keep it that way.

Any expert help would be greatly appreciated. Thanks

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 07-02-2007, 10:58 AM   #2
Axel Schwenke
 
Axel Schwenke's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MySQLdump and restore on very large DB

tucj7 <kevin.tucker@gmail.com> wrote:
>
> I have a very large database > 1.5GB running on 2 servers all MyISAM
> tables. One is a staging server and one the live server.


Hehe. 1.5GB is not considered large :-)

> On the staging server the data is manipulated, so rows are modified/
> removed/added constantly. The live server has a copy of these tables
> and other tracking tables that are not on the staging server.
>
> Once a day I update the live data with the data from the staging
> server. I use MySQL dump and then a basic import to overwrite the
> existing tables with the new data.
>
> This, however is taking extremely long and the DB table on the live
> server is unavailable during the import which is not ideal.
>
> Is there a better way to do this? Is replication the answer?


Yes. And Yes.

> I've never used it and wouldn't know where to start.


Then start reading the manual:

http://dev.mysql.com/doc/refman/5.0/...ion-intro.html
http://dev.mysql.com/doc/refman/5.1/...ion-howto.html


some notes from me:

- I intentionally gave the link to 5.1 manual because replication
chapters have been restructured to be better understandable.

- I suggest to use the mysqldump --master-data method to get a
clean copy of your staging server (master) to your live server
(slave)

- There is no need to have the slave process running all time.
If you want to stay with daily synchronization, just start the
slave once a day (START SLAVE) and when it has replicated all
changes (seen in Seconds_Behind_Master from SHOW SLAVE STATUS)
then just stop it (STOP SLAVE)

- You should set a sensible max. binlog size on your master and/or
rotate the binlog (e.g. with FLUSH LOGS). There are more options
re. replication and binary log:

http://dev.mysql.com/doc/refman/5.0/...n-options.html
http://dev.mysql.com/doc/refman/5.0/en/binary-log.html

- If you stay with daily synchronization, you should setup a routine
like this:
1. FLUSH LOGS on master to start a new binlog
2. START SLAVE, wait until the slave reached the new binlog
3. STOP SLAVE
4. PURGE MASTER LOGS TO '<insert current binlog>'

> The only issue being
> that the live server contains some tables that are not on the staging
> server and I would like to keep it that way.


This is no problem and will work out of the box.


XL
--
Axel Schwenke, Support Engineer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-02-2007, 10:58 AM   #3
lark
 
lark's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MySQLdump and restore on very large DB

== Quote from Axel Schwenke (axel.schwenke@gmx.de)'s article
> tucj7 <kevin.tucker@gmail.com> wrote:
> >
> > I have a very large database > 1.5GB running on 2 servers all MyISAM
> > tables. One is a staging server and one the live server.

> Hehe. 1.5GB is not considered large :-)
> > On the staging server the data is manipulated, so rows are modified/
> > removed/added constantly. The live server has a copy of these tables
> > and other tracking tables that are not on the staging server.
> >
> > Once a day I update the live data with the data from the staging
> > server. I use MySQL dump and then a basic import to overwrite the
> > existing tables with the new data.
> >
> > This, however is taking extremely long and the DB table on the live
> > server is unavailable during the import which is not ideal.
> >
> > Is there a better way to do this? Is replication the answer?

> Yes. And Yes.
> > I've never used it and wouldn't know where to start.

> Then start reading the manual:
> http://dev.mysql.com/doc/refman/5.0/...ion-intro.html
> http://dev.mysql.com/doc/refman/5.1/...ion-howto.html
> some notes from me:
> - I intentionally gave the link to 5.1 manual because replication
> chapters have been restructured to be better understandable.
> - I suggest to use the mysqldump --master-data method to get a
> clean copy of your staging server (master) to your live server
> (slave)
> - There is no need to have the slave process running all time.
> If you want to stay with daily synchronization, just start the
> slave once a day (START SLAVE) and when it has replicated all
> changes (seen in Seconds_Behind_Master from SHOW SLAVE STATUS)
> then just stop it (STOP SLAVE)
> - You should set a sensible max. binlog size on your master and/or
> rotate the binlog (e.g. with FLUSH LOGS). There are more options
> re. replication and binary log:
> http://dev.mysql.com/doc/refman/5.0/...n-options.html
> http://dev.mysql.com/doc/refman/5.0/en/binary-log.html
> - If you stay with daily synchronization, you should setup a routine
> like this:
> 1. FLUSH LOGS on master to start a new binlog
> 2. START SLAVE, wait until the slave reached the new binlog
> 3. STOP SLAVE
> 4. PURGE MASTER LOGS TO '<insert current binlog>'
> > The only issue being
> > that the live server contains some tables that are not on the staging
> > server and I would like to keep it that way.

> This is no problem and will work out of the box.
> XL


Axel,
Do you by any chance have a generic script that does the 4 step synch process?

--
POST BY: lark with PHP News Reader
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-02-2007, 10:58 AM   #4
Axel Schwenke
 
Axel Schwenke's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MySQLdump and restore on very large DB

lark <hamzee@sbcglobal.net> wrote:
> == Quote from Axel Schwenke (axel.schwenke@gmx.de)'s article


<cut>

> Axel,
> Do you by any chance have a generic script that does the 4 step synch process?


Nope.

<joking>
If you buy a platinum support contract I will happily write you one
</joking>


XL
--
Axel Schwenke, Support Engineer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-02-2007, 10:59 AM   #5
lark
 
lark's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MySQLdump and restore on very large DB

Axel Schwenke wrote:
> lark <hamzee@sbcglobal.net> wrote:
>> == Quote from Axel Schwenke (axel.schwenke@gmx.de)'s article

>
> <cut>
>
>> Axel,
>> Do you by any chance have a generic script that does the 4 step synch process?

>
> Nope.
>
> <joking>
> If you buy a platinum support contract I will happily write you one
> </joking>
>
>
> XL
> --
> Axel Schwenke, Support Engineer, MySQL AB
>
> Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
> MySQL User Forums: http://forums.mysql.com/


Axel, Axel, Axel:

where is the goodness of your heart?

actually, i didn't expect you to provide something like that. i just
wanted a pointer! but if you don't know of any, don't worry!

thanks
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having trouble with mysqldump flarosa Database 1 07-01-2007 9:31 PM
Backup & restore MySQL, not using mysqldump Nikolai Chuvakhin PHP 0 07-01-2007 5:05 PM
Backup & Restore 5.0.21 => 4.1.12 McHenry Database 1 06-10-2007 12:23 AM
MySQLDump with fields enclosed help techguru Database 2 05-31-2007 8:48 PM
How to restore a position Graphman Google questions 1 05-28-2007 1:45 AM


Featured Websites




All times are GMT +1. The time now is 12:10 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98