Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Previous 30 Newer Entries Showing entries 61 to 90 of 90

Displaying posts with tag: Backup (reset)

Recover Crashed Tables in MySQL Database
+0 Vote Up -0Vote Down
MySQL is a popular database management system, a most widely used for web databases, offers efficient techniques to ensure absolute integrity of the database. When you start MySQLD (MySQL Server), it automatically examines all the database tables for integrity. MySQL Server also fixes the tables if they are marked as ´not closed properly´ or ´crashed´. It backs up all the corrupted database tables and makes their entries in the error log. Though, it works in a number of cases, but cannot necessarily fix all the corruption issues and fails to recover MySQL database.

The MySQLD technique cannot repair MySQL database if it is severely damaged. As a practical scenario, where MySQL Server cannot handle the table corruption, you may encounter the below error message-

"Got an error from thread_id=1, mi_dynrec.c:368"

The above error





  [Read more...]
Recovering MySQL Corruption in Bugzilla Database
+0 Vote Up -0Vote Down
Bugzilla is a web-based bug tracking and testing application that is used by many software development companies. It extensively various databases including MySQL for its backend support especially because both of these applications are freely available. Although this tool runs pretty fine in most cases, it can get stalled when the some of the MySQL tables get corrupt. In such cases, you are unable to perform various tasks on the database. You can use the 'myisamchk' command with different parameters to repair MySQL database. If it does not work, then you should use a professional MySQL recovery software to recover MySQL database.

Discussing a similar situation in Bugzilla, consider you get the following error message while generating a bugs report:

"undef error - DBD::mysql::db



  [Read more...]
Excluding databases from mysqldump
+7 Vote Up -0Vote Down
A question that came up during the MySQL track at the UKOUG conference in Birmingham was "Can I exclude only a few databases from mysqldump? Let's say that I have 50 databases, and I want to dump all of them, except a few."
As many know, mysqldump has an option to ignore specific tables. SO if you have 1,000 tables in a databases, you can tell mysqldump to dump all the tables except a few ones.
There is no corresponding option to exclude one or more databases.
However, if you know your command line tools, the solution is easy:
First, we get the list of all databases:
mysql -B -N -e 'show databases'
information_schema
employees
five
four
mysql
one
performance_schema
six
test
three
two
-B forces batch mode (no dashes box around the data), while -N gets the result without the
















  [Read more...]
DBJ – MySQL Hotbackups with Xtrabackup
+0 Vote Up -0Vote Down

The open-source xtrabackup tool from Percona brings much needed hot backup functionality to MySQL deployments.  In this database journal article we discuss logical, cold, and hot backups, then explain how to use xtrabackup on your MyISAM, InnoDB, and XtraDB tables to create at-the-ready backups.  We then take you through the step-by-step process to restore them, and even the process of point-in-time recovery too.

Database Journal – Hotbackups with Percona’s Xtrabackup

MySQL 5.5: What's New in Replication
Employee_Team +11 Vote Up -0Vote Down
In my continuing MySQL 5.5 blog series, today I am covering what's new on the replication front.  MySQL replication is my favorite server feature and what drew me to MySQL during my tenure with Embarcadero Technologies.  Others seem to agree as based on community and customer surveys, MySQL replication is the most popular and widely used database feature.  Mostly because it is easy to set up and ease, it enables scalability and provides a pretty robust solution for data redundancy, backup and overall availability.  In MySQL 5.5 replication has been enhanced in response to user requests that MySQL replication:

  • Ensure data consistency between master and slave servers
  • Immediately detect if replication is not working
  • Allow a crashed slave to automatically recover from the master relay


  [Read more...]
An argument for using mysqldump
+3 Vote Up -0Vote Down

I fully agree with Morgan’s An argument for not using mysqldump. This post does not come to contradict it, but rather shed a positive light on mysqldump.

I usually prefer an LVM snapshot based backup, or using XtraBackup. And, with databases as large as dozens of GB and above, I consider mysqldump to be a poor alternative. Poor in runtime, poor in overhead while taking the backup.

However once in a while I get to be reminded that mysqldump just works.

As a recent example, I had a server which was killed after an ALTER TABLE statement hanged forever (table already ALTERed, but old scheme never dropped). The old table data still hanged around the file system, but was not recognized by InnoDB. Trying out DISCARD TABLESPACE

  [Read more...]
An argument for not using mysqldump
+2 Vote Up -0Vote Down

I have a 5G mysqldump which takes 30 minutes to restore from backup.  That means that when the database reaches 50G, it should take 30x10=5 hours to restore.  Right?  Wrong.

Mysqldump recovery time is not linear.  Bigger tables, or tables with more indexes will always take more time to restore.

If I restore from a raw backup (LVM snapshot, xtrabackup, innodb hot backup), it is very easy to model how much longer recovery time will take:

Backup is 80G
Copy is at 70MB/s.
10G is already complete.
= ((80-10) * 1024)/70/60 = ~17 minutes

I can tell progress with mysqldump by monitoring the rate at which show global status like 'Handler_write'; increases and compare it to my knowledge of about how many rows are in each table.  But progress != a magic number like "17





  [Read more...]
MySQL Enterprise Backup and The Meaning of Included
+7 Vote Up -0Vote Down
During the MySQL Users Conference, Edward Screven did a keynote presentation that made many of us feel warm and fuzzy about Oracle's future plans for MySQL. If you advance 16m 25s into the presentation, it even gives something to rejoice the MySQL Enterprise customers: "Backup is now included". He didn't say much more after that. Asking around at the conference the days following this announcement, I couldn't get a straight answer about when and how would it be available for existing customers.

Now, 6 months later (give or take a couple of weeks), the MySQL Enterprise Features (http://mysql.com/products/enterprise/features.html) page has no signs of the now included MySQL Enterprise Backup (the utility previously known as InnoDB Hot Backup) and there has been no other news

  [Read more...]
Restore MyISAM tables by MySQL Recovery Software
+0 Vote Up -0Vote Down
Any corruption in MyISAM table is a terrible situation for Database Administrator. These MyISAM tables are the most important components in the MySQL Database to store personal as well as professional data, and the corruption in these tables may inaccessibility to the database. In this situation, a database backup allows you to restore the database and access the records in the table. Duplicate file (Backup) of the database is mostly stored on a different storage media, the changes of database corruption still exist. In that situation, you will need to perform MySQL database repair by the using of third party software.

Some error messages that enable you to identify that your MyISAM table (student) is corrupt:

“Student.frm is locked against change”
Or
“Got error message student from table handler”

Or







  [Read more...]
Pop quiz: when will a filesystem copy be an incomplete backup?
+4 Vote Up -0Vote Down

Let’s suppose that your backup process looks like this: you stop a replication slave, shut down MySQL, and copy away the data directory. Assume that the slave is perfect and has the same data as the master. Nothing is broken, nothing is wrong, everything is working fine. In most cases, this should work, right?

Under what kinds of circumstances will you not get all your data back if you restore the file copy and start MySQL?

Related posts:

  • Pop quiz: how can one slave break another slave
  • Progress on High Performance MySQL Backup and Recovery chapter
  •   [Read more...]
    mylvmbackup HOWTO: minimal privileges & filesystem copy
    +2 Vote Up -2Vote Down

    This HOWTO discusses two (unrelated) issues with mylvmbackup:

    • The minimal privileges required to take MySQL backups with mylvmbackup.
    • Making (non compressed) file system copy of one’s data files.

    Minimal privileges

    Some just give mylvmbackup the root account, which is far too permissive. We now consider what the minimal requirements of mylvmbackup are.

    The queries mylvmbackup issues are:

    • FLUSH TABLES
    • FLUSH TABLES WITH READ LOCK
    • SHOW MASTER STATUS
    • SHOW SLAVE STATUS
    • UNLOCK TABLES

    Both SHOW MASTER STATUS & SHOW SLAVE STATUS require

      [Read more...]
    Tips for taking MySQL backups using LVM
    +6 Vote Up -0Vote Down

    LVM uses copy-on-write to implement snapshots. Whenever you’re writing data to some page, LVM copies the original page (the way it looked like when the snapshot was taken) to the snapshot volume. The snapshot volume must be large enough to accommodate all pages written to for the duration of the snapshot’s lifetime. In other words, you must be able to copy the data somewhere outside (tape, NFS, rsync, etc.) in less time than it would take for the snapshot to fill up.

    While LVM allows for hot backups of MySQL, it still poses an impact on the disks. An LVM snapshot backup may not go unnoticed by the MySQL users.

    Some general guidelines for making life easier with LVM backups follow.

    Lighter, longer snapshots

    If you’re confident that you have enough space on your snapshot volume, you may take the opportunity to make for a

      [Read more...]
    Backup large databases with mysqldump by splitting up the backup files
    +0 Vote Up -0Vote Down
    The primary responsibility of MySQL professionals is to establish and run proper backup and recovery plans. The most used method to backup a MySQL database is the mysqldump utility. This mysqldump utility creates a backup file for one or more MySQL databases that consists of DDL/DML statements needed to recreate the databases with their data. To [...]
    MySQL Replication for Backups and more
    +1 Vote Up -0Vote Down
    You might be fortunate enough to allow yourself some downtime, it is dependent on your application and business model. During this window it's possible for you to stop your MySQL daemon or lock your tables to give yourself a consistent backup of your data. Quite often this is a luxury that you cannot afford. If you are tied to a strict uptime that doesn't permit any interruption to your data availability then MySQL Replication could be the answer you need to grab that essential backup file. Once you've enabled Replication to a slave then you have the chance to backup by stopping the replication thread and  mitigate the risk of corruption whilst securing your latest dataset. Using the slave will also negate any overhead a backup like mysqldump would have on your active Master server.

    Although in this case we are deploying Replication to take consistent backups

      [Read more...]
    A MyISAM backup is blocking as read-only, including mysqldump backup
    +1 Vote Up -0Vote Down

    Actually this is (almost) all I wanted to say. This is intentionally posted with all related keywords in title, in the hope that a related search on Google will result with this post on first page.

    I’m just still encountering companies who use MyISAM as their storage engine and are unaware that their nightly backup actually blocks their application, basically rendering their product unavailable for long minutes to hours on a nightly basis.

    So this is posted as a warning for those who were not aware of this fact.

    There is no hot (non blocking) backup for MyISAM. Closest would be file system snapshot, but even this requires flushing of tables, which may take a while to complete. If you must have a hot backup, then either use replication – and take the risk of the slave not being in complete sync with the master – or use another storage engine, i.e. InnoDB.

    MySQLDump from A to B with pipes
    +0 Vote Up -0Vote Down
    Moving your data and tables around comes in many different flavours. The use of mysqldump is common practice to dump your data and schema out to a file. It is also possible to pipe your mysqldump into a 2nd server. Try the code below (adapting the users and passwords!) in a test environment;
    $ mysqldump -u UserA -p p455w0rd --single-transaction --all-databases --host=Server1 | mysql -u UserA -p p455w0rd --host=Server2
    As you can see from the command we are taking all the databases in a single transaction into Server2 from Server1. If you're not using transactional tables substitute the --single-transaction for --lock-all-tables to ensure you get a consistent copy.

    Remember; You must be able to see the 'other' server over the network and there must be permissions set for remote access from your feeding Server. For large databases this technique may not be suitable



      [Read more...]
    On hot backups
    +4 Vote Up -0Vote Down

    Few years ago I was looking at crash recovery code, and realized that InnoDB has removed all the comments from the code [this assumption is debunked by Heikki in comments section], related to replay of transaction log. Judging by high quality of comments in the remaining codebase, I realized that it was all done to obscure any efforts to build another InnoDB hot backup solution – competitor to first Innobase standalone offering.

    I was enjoying the moment when Percona launched their own implementation of the tool. Since the inception, it became more and more robust and feature rich.

    We have used xtrabackup in our environment a lot – just… not for backup – the major use case right now is for cloning server instances – either

      [Read more...]
    Simple Backup Restore Trick
    +2 Vote Up -1Vote Down
    I don't usually post these simple tricks, but it came to my attention today and it's very simple and have seen issues when trying to get around it. This one tries to solve the question: How do I restore my production backup to a different schema? It looks obvious, but I haven't seen many people thinking about it.

    Most of the time backups using mysqldump will include the following line:

    USE `schema`;

    This is OK when you're trying to either (re)build a slave or restore a production database. But what about restoring it to a test server in a different schema?

    The actual trick


    Using vi (or similar) editors to edit the line will most likely result in the editor trying to load the whole backup file into memory, which might cause paging or even crash the server if the backup is big







      [Read more...]
    New AutoMySQLBackup Script
    +0 Vote Up -0Vote Down

    MySQL Backup Script has been around for a long time.  I have used it on and off for years but now I’ve needed to make some  improvements.   This script is based on VER. 2.6 – http://sourceforge.net/projects/automysqlbackup/ Copyright (c) 2002-2003 wipe_out@lycos.co.uk.
    I have added my own Copyright (c) 2010 mark@grennan.com – http://www.mysqlfanboy.com/Files/automysqlbackup.sh. But as the code says:  This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

    My improvements include:

    # VER 2.6 Beta 5 – MTG – (2010-04-18)


      [Read more...]
    Kontrollkit – new backup script is partition space aware
    +0 Vote Up -0Vote Down
    I’ve been wanting to write a backup script for a while now that does the following: reads the partition information for the directory that you are backing up into and computes the used/available/percentage-available space. Then it reads the total data size from the MySQL tables and ensures that you have enough space on disk (for [...]
    MySQL: Partition-wise backups with mysqldump
    +4 Vote Up -0Vote Down
    To whom it may concern,

    in response to a query from André Simões (also known as ITXpander), I slapped together a MySQL script that outputs mysqldump commands for backing up individual partitions of the tables in the current schema. The script is maintained as a snippet at MySQL Forge.

    How it works

    The script works by querying the

      [Read more...]
    When backups fail: A mysql binlog race condition
    +0 Vote Up -0Vote Down

    Today I ran into my first MySQL binlog race condition: The initial problem was quite simple: A typical MySQL master->slave setup with heavy load on the master and nearly no load on the slave, which only serves as a hot fallback and job machine, showed differences on the same table on both machines. The differences showed up from time to time: entries that have been deleted from the master were still on the slave.

    After several investigations I started examining the MySQL binlog from the master – a file containing all queries that will be transferred to the slave (and executed there if they don’t match any ignore-db-pattern). I grepped for ids of rows that have not been deleted on the slave as I’s interested if the DELETE statement was

      [Read more...]
    Creating MySQL Backups With AutoMySQLBackup On Ubuntu 9.10
    +1 Vote Up -0Vote Down

    Creating MySQL Backups With AutoMySQLBackup On Ubuntu 9.10

    AutoMySQLBackup is a shell script that lets you take daily, weekly and monthly backups of your MySQL databases using mysqldump. It can back up multiple databases, compress the backups, back up remote databases, and email the logs. This tutorial explains how to install and use it on an Ubuntu 9.10 server.

    Defined your MySQL backup & recovery plan recently?
    +1 Vote Up -0Vote Down

    Following up on Ronald Bradford’s Checked your MySQL recovery process recently? post, I wish to add a prequel.

    To see whether you have a clear definition of your backup requirements, ask yourself these questions:

    • Is there a backup/restore plan?
    • Is there a written backup/restore plan?
    • How fast do you need to recover a backup? What’s the longest downtime you will allow from the point of failure to the point of restored, functional database?
    • How much data are you willing to lose in case of crash? A second’s worth of data? An hour’s worth? A day’s worth? None?
    • Are you willing to allow that the database becomes read-only when taking the
      [Read more...]
    Log Buffer #178, a Carnival of the Vanities for DBAs
    +2 Vote Up -1Vote Down
    Dave Edwards has offered me to write this week's Log Buffer, and I couldn't help but jump at the opportunity. I'll dive straight into it.

    Oracle

    I'll start with Oracle, the dust of the Sun acquisition has settled, so maybe it's time to return our attention to the regular issues.

    Lets start with Hemant Chitale's Common Error series and his Some Common Errors - 2 - NOLOGGING as a Hint explaining what to expect from NOLOGGING. Kamran Agayev offers us an insight into Hemant's personality with his Exclusive Interview with Hemant K Chitale. My favorite quote is:

    Do you





      [Read more...]
    How To Back Up MySQL Databases With mylvmbackup On Debian Lenny
    +1 Vote Up -0Vote Down

    How To Back Up MySQL Databases With mylvmbackup On Debian Lenny

    mylvmbackup is a Perl script for quickly creating MySQL backups. It uses LVM's snapshot feature to do so. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, creates a snapshot of the volume containing the MySQL data directory, and unlocks the tables again. This article shows how to use it on a Debian Lenny server.

    Some MySQL-related links
    +2 Vote Up -0Vote Down

    Check out how Linden Labs, creators of the popular game Second Life, upgraded their MySQL database. The MySQL they use? Straight out of Debian! Of course, now, they’re running with the Percona patchset, against MySQL 5.0.84. Definitely a good read.

    Its good to see Lars post about contributing to the MySQL replication & backup codebase. It sounds like the replication & backup team have decided that mentoring is the way to go – you get a “coach developer” if the idea is accepted. I like this very much, and sincerely hope it

      [Read more...]
    On restoring a single table from mysqldump
    +3 Vote Up -0Vote Down

    Following Restore one table from an ALL database dump and Restore a Single Table From mysqldump, I would like to add my own thoughts and comments on the subject.

    I also wish to note performance issues with the two suggested solutions, and offer improvements.

    Problem relevance

    While the problem is interesting, I just want to note that it is relevant in very specific database dimensions. Too small – and it doesn’t matter how you solve it (e.g. just open vi/emacs and copy+paste). Too big – and it would not be worthwhile to restore from mysqldump anyway. I would suggest that the problem is interesting in the whereabouts of a few dozen GB worth of

      [Read more...]
    ZRM for MySQL Issues
    +2 Vote Up -0Vote Down
    I really like ZRM for MySQL Community Edition for backups. I find
    it very simple to install and configure and it gets the job done. It's default settings suits most installations. The challenges arise once you need to adapt it to more complex organizations. Please note that all the issues described on this article refer to Linux installations.

    What If DBAs Have No sudo?

    This was the 1st challenge that I ever faced. ZRM requires full root access at least during installation and in some cases, it requires some sudo permissions to be able to manage its files as well. Some organizations don't grant these permissions to the DBAs complicating the installation. When I looked into the scripts, I didn't see any reason why they wouldn't run in the user space, other than a few hard coded paths. I posted the

      [Read more...]
    Scheduled Backup MySQL Administrator & Windows Scheduler – Odd
    +1 Vote Up -0Vote Down
    Creating scheduled backup using administrator is an easy task. Follow the GUI and you’re done. But I observed something different! MySQL Version: 5.0.83 Community MySQL Administrator: 1.2.17 Machine: Intel P4,...
    Previous 30 Newer Entries Showing entries 61 to 90 of 90

    Planet MySQL © 1995, 2013, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.