473,395 Members | 1,516 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,395 software developers and data experts.

Backup Strategies

I have about 20 databases in a single MySQL instance running 4.0.21 on
RHEL3. I have a healthy mix of MyISAM and InnoDB tables. Howerver these two
types do not mix within a single database. A read/write master MySQL server
replicates to five read-only database servers for load distribution of the
web traffic. I need to come up with a backup strategy that supports the
following objectives...

(1) Minimum down time during backups, if any.
(2) Ability to restore individual databases or the entire server for
disaster recovery.
(3) Clear identification of which binary logs to apply to the restored
databases to achieve up-to-the-minute recovery.

I have been reading the fine manual and trying out some ideas. Some of the
options in the manual are for versions later than 4.0.21.

I tried the mysqldump for all databases with the --flush-logs option in
order to get a clean break on the binary logs. This resulted in binary log
switching for every database, causing 20 log switches in the backup. I have
no idea which binary logs I would apply after restoring a single database. I
am concerned about the loss of any updates during the backup process.
The --lock-all-tables option is not available in 4.0.21. The --lock-tables
and --single-transaction options are mutually exclusive. I am not sure which
options will give me a consistent backup. Moreover these options seem to
lock tables at a 'per-database' level.

Another option I have been toying with is to issue a 'FLUSH TABLES WITH READ
LOCK;' from an independent session. This seems to lock the databases
properly, but I do not know how to code a script to issue this command from
a separate session for the duration of the backup.

I am sure there are others who would have faced and conquered these issues.
Can someone please point me in the right direction?

I would appreciate if you can share any scripts or point me to the white
papers or other web resources....

Thanks!
- Rajesh
Jul 23 '05 #1
1 2137
Rajesh Kapur wrote:
I have about 20 databases in a single MySQL instance running 4.0.21 on
RHEL3. I have a healthy mix of MyISAM and InnoDB tables. Howerver these two
types do not mix within a single database. A read/write master MySQL server
replicates to five read-only database servers for load distribution of the
web traffic. I need to come up with a backup strategy that supports the
following objectives...

(1) Minimum down time during backups, if any.
(2) Ability to restore individual databases or the entire server for
disaster recovery.
(3) Clear identification of which binary logs to apply to the restored
databases to achieve up-to-the-minute recovery.

I have been reading the fine manual and trying out some ideas. Some of the
options in the manual are for versions later than 4.0.21.

I tried the mysqldump for all databases with the --flush-logs option in
order to get a clean break on the binary logs. This resulted in binary log
switching for every database, causing 20 log switches in the backup. I have
no idea which binary logs I would apply after restoring a single database. I
am concerned about the loss of any updates during the backup process.
The --lock-all-tables option is not available in 4.0.21. The --lock-tables
and --single-transaction options are mutually exclusive. I am not sure which
options will give me a consistent backup. Moreover these options seem to
lock tables at a 'per-database' level.

Another option I have been toying with is to issue a 'FLUSH TABLES WITH READ
LOCK;' from an independent session. This seems to lock the databases
properly, but I do not know how to code a script to issue this command from
a separate session for the duration of the backup.

I am sure there are others who would have faced and conquered these issues.
Can someone please point me in the right direction?

I would appreciate if you can share any scripts or point me to the white
papers or other web resources....

Thanks!
- Rajesh

I use the following backup script to backup my replication client so my
server can stay online all the time without read locks being issued on it.

http://worldcommunity.com/opensource...ql_backup.html

Jonathan

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #2

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

Similar topics

3
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database...
2
by: robin | last post by:
The Oblique Strategies were originally a set of one-hundred cards, each bearing a short phrase. They were devised by Brian Eno and Peter Schmidt as ways of working through creative problems. When a...
6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
4
by: manwiththeaxe.70 | last post by:
I have recently begun to migrate our DB2 UDB v7.2 enterprise databases up to DB2 UDB v8.2. One question I can't seem to understand is why would I want to run an offline backup for a database now...
13
by: CoreyWhite | last post by:
When playing games, perhaps the most simple is tic-tac-toe. The game has two simple strategies, one is defensive and the other offensive. It is not hard at first to learn how to tie games when...
24
by: David | last post by:
Hi list. What strategies do you use to ensure correctness of new code? Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do...
0
by: origami.takarana | last post by:
Intrusion Detection Strategies ----------------------------------- Until now, we’ve primarily discussed monitoring in how it relates to intrusion detection, but there’s more to an overall...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.