Skip navigation links
Previous 20 Newer Entries Showing entries 161 to 180 of 462 Next 20 Older Entries
Articles
Add to Favourites +0 Vote Up -0Vote Down
Welcome back to my series of blogposts, "Back to Basics". Today I wanted to share a few commands that could be useful in various situations, such as delaying replication, stopping the slave (or parts of it).I'm sorry, but I will not be going through how to set up replication, so my assumption is that you already have replication working and that you want to know some of the details surrounding it.Let's begin by taking a look at "STOP SLAVE"STOP SLAVE stops the slave threads
Articles
Add to Favourites +1 Vote Up -0Vote Down
If you are using InnoDB Hot Backup and a recent version of mysqld (at least 5.0.67 or higher, including 5.1.30, though it may be later versions), your backup will run fine and output OK! at the end, as it should.Except for one thing.The binary log file and position do not appear in their rightful place. Here's a snippet of the output from the backup:innobackup: MySQL binlog position: filename 'Warning', position (Code 1287):'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead090210 03:55:04 innobackup: innobackup completed OK!That's pretty misleading -- looks like the backup completed OK, but it did not show us the binary log position. What about the "ibbackup_binlog_info" file?[mysql@db3:~] more ibbackup_binlog_info Warning (Code 1287): 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead[mysql@db3:~]Yikes! What happened to the binary log position and file information?Have no fear, it's actually in another file.
Articles
Add to Favourites +0 Vote Up -0Vote Down
I had the chance to review the new Query Analyzer program from Sun over the last few days. I am very interested in how it performs as I have previously not had a chance to see the program in action (or the Enterprise Monitor program either for that matter). So, before getting into what the Query Analyzer can (and cannot) do let's look at what Sun says it does.From the November 19th, 2008 press release:The MySQL Query Analyzer saves time and effort in finding and fixing problem queries by providing:\tAggregated view into query execution counts, run time, result sets across all MySQL servers with no dependence on MySQL logs or "SHOW PROCESSLIST"\tSortable views by all monitored statistics\tSearchable and sortable queries by query type, content, server, database, date/time, interval range, and "when first seen"\tHistorical and real-time analysis of all queries across all servers\tDrill downs into sampled query  []
Articles
Add to Favourites +1 Vote Up -0Vote Down
You probably know that "mysql -h host_or_ip" can connect you to a remote host.But did you know that you can change the host you are connected to from within "mysql"?The undocumented (as far as I can tell, in the MySQL manual and in the "help" on the mysql command line) "CONNECT" statement can help.
Articles
Add to Favourites +0 Vote Up -0Vote Down
I realized tonight exactly why MySQL's default behavior of silent truncation bothers me.It reminds me of people who use a ticketing system and close every ticket as soon as they are done working on the issue instead of actually asking the other party if they are satisfied, because closing more tickets make it look like they're doing more work.It reminds me of workers at fast food restaurants who hit the button to make the order disappear as if they have already served me my food, because
Articles
Add to Favourites +0 Vote Up -0Vote Down
One very helpful use of the technique Sheeri described in Remote connections without leaving the mysql shell is making sure that replication is working properly.According to the MySQL Reference Manual's section on SHOW SLAVE STATUS Syntax, it shows information corresponding to the slave thread in the slave server. When replication is broken, however, or not working properly due to network issues between master and slave, this information may not be accurate. This has improved over recent releases, but it's still not perfect.The question, then, is: how to be 100% sure (or as close as you can get to 100%) that replication is running fine? The answer, as offered by Sheeri: use "CONNECT".Example\tLog into the slave using the mysql client and issue "SHOW SLAVE STATUS:
Articles
Add to Favourites +0 Vote Up -0Vote Down
We've been running into a problem with one client:SELECT COUNT(*) FROM tbl;takes 0.25 seconds on one db, and 0.06 seconds on another. Consistently. That's a fourfold difference. There aren't any significant configuration differences (like query cache, etc.), the software versions are the same, and the table fits into memory. This has been looked at by at least 3 in-house MySQL experts, and the only thing we can determine is that it's a hardware difference.Th
Articles
Add to Favourites +0 Vote Up -0Vote Down
Or, When MySQL Lies!When I do a "show slave status\\G", sometimes mysqld will lie to me and give me a wrong "Exec_Master_Log_Pos". Let me explain with a situation from last night.This is the output of "show slave status\\G" from mysql version 5.0.41-community-log:mysql> show slave status \\G*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: XXX.XXX.XXX.XXX Master_User: replic_username Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000480 Read_Master_Log_Pos: 690470773 Relay_Log_File: db2-relay-bin.000028 Relay_Log_Pos: 683977007 Relay_Master_Log_File: mysql-bin.000480 Slave_IO_Running: Yes Slave_SQL_Running: No  []
Articles
Add to Favourites +0 Vote Up -0Vote Down
"mysql-proxy" defaults to round-robin load balancing. There are fancy tricks around to get "mysql-proxy" to balance connections based on how many idle connections there are in a proxy-based connection pool. But there is no code that I found that would simply load balance based on "always go to one server, go to another server only when the first server is down."Well, I spent way t
Articles
Add to Favourites +1 Vote Up -0Vote Down
Someone asked me what applications were good/bad for MySQL Cluster. As I've now actually had experience with a Cluster setup and a real-life application of it, and dug through the manual, I present a few characteristics of applications that will work with Cluster, and why they are so (so that if you have an application that meets some of the characteristics but not all of them, you can decide whether it's worth it to use Cluster or not).Firstly, I'll state this -- there's actually a very limited application to MySQL cluster. I haven't assessed the disk-based cluster, only the memory-based one, so I don't know what really changes with disk-based. But after you see this list, you certainly will want to re-think your use of disk-based cluster if a lot of the inner workings don't change.The factors are listed below, but the "ruler" I keep in my mind is the fact that MySQL Cluster was developed for telecom applications.  []
Articles
Add to Favourites +0 Vote Up -0Vote Down
Over-the-Top Tales from the Trenches.Motto: Bringing order to the chaos of every day DBA life.So you have got your nice MySQL Master-Slave replication pair setup. Everything is sweet, then the master dies/restarts or you have a slightly extended network outage.Your monitoring software (in our case Avail) fires off a page and you are rudely interrupted from reading the Pythian blog.These real world interruptions, what can I say... it pays the bills.Anyway being the rounded DBA or enlightened DBA as Babette would say, you are capable of handling any type of database. You log into the machine and check out why the slave threw an error or if your monitoring is slow, why the slave is lagging by 2 hours.You run SHOW SLAVE STATUS\\Gmysql> show slave status \\G*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: x.x.x.x  []
Articles
Add to Favourites +0 Vote Up -0Vote Down
Open Source means that the source code is open. There are many inferences that can be made from this, and many stereotypes that can be applied, but in the end, all it means is that you can read the source code as well as use the binaries.I am not a developer. I fully admit this. What I mean by this is that my strengths do not lie in engineering new code to do things. Give me some Lego™s or some Wedgits™ and I look at the instructions to see what to build.However, I am an engineer.One of my team's current tasks is to restore a backup (using InnoDB Hot Backup, and compressed) from a client's production machine to a development instance.....Weekly -- thus we want to automate it......And did I mention the development machine has 5 different MySQL instances on it, running all on 127.0.0.1 on different ports?The steps are:0) stop the desired mysql instance 1) move the development datadir and logs to a backup  []
Articles
Add to Favourites +0 Vote Up -0Vote Down
This is the first place I am announcing this: The Pythian Group has made me a Team Lead. I am extremely honored and somewhat humbled by this, and I am determined to do a good job. I started officially on Monday, March 3rd, and my first week went pretty well. On Saturday, I spent a short bit of time automating one process. And while I was waiting for a 300G backup to copy from one machine to another, I worked on automatin
Articles
Add to Favourites +0 Vote Up -0Vote Down
One of my colleagues made a typo in a query today that led to me discovering this issue -- I think it's a bug, though it may just be how the language is defined. But certainly a subquery that cannot run should not act as if it returns TRUE.mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> create table foo (fid tinyint unsigned not null primary key); create tabl
Articles
Add to Favourites +0 Vote Up -0Vote Down
Pythian DBA's have daily reports for each monitored database and some of the components are using charts to visualize the data. I'm a big fan of charts myself (when applied appropriately) and want to show how you can generate simple charts directly from the database. You'd be very surprised how easy it can be done from *any* database without installing any additional software or configuring something special.This method is not limited to Oracle by any means -- use it with MySQL, SQL Server or any other database as well as without a database -- yes, visualize your sar data now!In this example, we will plot a pie diagram with Oracle tablespaces. This would be very handy when you are starting to analyze the space allocation for a database. Here is the end result of the report for my Grid Control repository test database:
Articles
Add to Favourites +0 Vote Up -0Vote Down
I don't want to post the link to this (perhaps, it was left public unintentional?) but here is what I stumbled upon recently. This is a log of production maintenance of IT systems in Perth, Western Australia (as far as I could say):Good idea but
Articles
Add to Favourites +0 Vote Up -0Vote Down
Consistent backup:A consistent backup is one that represents a snapshot of all data at a point in time. Consistent backups are used for disaster recovery. An inconsistent backup can be useful for retrieving partial data -- for example, if a long-time customer accidentally deletes information from his profile, you can go back to an inconsistent backup and retrieve that information. It is not important that all the data be consistent with each other when retrieving a partial amount of point-in-time data.Logical backups:
Articles
Add to Favourites +0 Vote Up -0Vote Down
Today's contradiction:MySQL has server variables named "new" and "old".The "new" variable can be set per-session and globally, and is dynamic. The "old" variable is not dynamic, and only global in scope. Both default to FALSE in MySQL 5.1.According to the manual, the "new" variable:was used in MySQL 4.0 to turn on some 4.1
Articles
Add to Favourites +0 Vote Up -0Vote Down
As Baron points out, Percona's Xtrabackup tool can be used just like InnoDB Hot Backup.Many are wondering, "is it good enough?" In fact, I wondered the same thing, and after a few weeks of using and testing Xtrabackup (on machines that have MyISAM and InnoDB tables), I can say:0) We have not run into any problems with
Articles
Add to Favourites +0 Vote Up -0Vote Down
If you have a 12-server MySQL Cluster with:1 Management Node3 SQL Nodes2 Data Node Groups, 4 Data Nodes per groupAnd each machine is configured to allocate 1G of memory for its function, how much data (data + indexes) can you store in total in your cluster?You can guess, but you get bonus points if you explain why and the explanation is correct.
Previous 20 Newer Entries Showing entries 161 to 180 of 462 Next 20 Older Entries