Showing entries 1 to 7
Displaying posts with tag: utility (reset)
Streaming MySQL binary logs for backup

With MySQL, it is relatively easy to create “point in time” restores. All you need is recent(ish) backup and a bunch of saved binary logs. You can restore the backup you have, and when it is completed, you can use mysqlbinlog utility to apply your saved binary logs to the desired state of your database.

I have created a simple go application to make your life easier. You can find it on my GitHub page.

The app works as reading its config file for the MySQL server connection credentials, a local directory where the binary logs will be kept, and the will path of the mysqlbinlog utility.

  1. It checks the binlogs on the remote server which able to streamed
  2. Checks the local directory where the binlogs are kept, to check which logs are already there
  3. The incomplete (file size differs local and on remote server) files will be …
[Read more]
Streaming MySQL binary logs for backup

With MySQL it is relatively easy to create point in time restores. All you need is a recent(ish) backup, and a bunch of saved binary logs. You can restore the backup you have, and when it is completed, you can use mysqlbinlog utility to apply your saved binary logs to the desired state of your database. I […]

Dates Tables (More Numbers Table Sugar)

Why A Table of Dates?

I thought it would be nice to build on the numbers table with another very useful tool.

Dates are pretty important–especially if you are playing with data warehousing. Not only dates, but all the different properties and derived goodies contained within them. You really don’t need a dates table, unless you care about efficiency and getting to all the good stuff quickly. Perhaps I’ll showcase some of the “goodies” in later posts.

Sure, most databases have built-in functions to get everything you might want. But do you really want all the inefficiency that comes with calling functions and doing calculations over and over again? I hope not. I used the method in this article when I developed a SQL Server data warehouse for a company I worked for. It was adopted by our other SQL Server guru for all the date-sensitive stuff we did (which was a lot). It increased efficiency by leaps and …

[Read more]
Numbers, Numbers Everywhere

Why You Care About Numbers

I have worked a bit with Oracle. As such, I hang out around Oracle developers. There seems to be a common complaint among our kind when it comes to MySQL–”There aren’t any sequences!”

It never really bothered me. I wasn’t always an Oracle guy, so I didn’t always have sequences. I’m the kind of person who likes to experiment and make things happen. It just so happens there is a nice tool to help with this perceived absence: the “numbers table.”

It is really easy to set up. And, regardless of your database background, I think you will grow to love your utility.

There are multiple ways to achieve the result you want. For me, the easiest way is to work with decimal numbers. Why? Because that’s how we think. That’s pretty much standard for humans. Yeah, I know. Geeks think hexadecimal. Let’s not go there.

Without further ado, here is how you can create …

[Read more]
Speaking at the O'Reilly MySQL Conference & Expo: "A look into a MySQL DBA's toolchest"

I'm happy to announce that my talk "Making MySQL administration a breeze - a look into a MySQL DBA's toolchest" has been accepted for this year's edition of the MySQL Conference & Expo in Santa Clara, which will take place on April 12-15, 2010. The session is currently scheduled for Wednesday 14th, 10:50 in Ballroom E.

My plan is to provide an overview over the most popular utilities and applications that a MySQL DBA should be aware of to make his life easier. The focus will be on Linux/Unix applications available under opensource licenses that ease tasks related to user administration, setting up and administering replication setups, performing backups and security audits.

Of course I will cover the usual …

[Read more]
Backing up MySQL using ZFS Snapshots: SnapBack

While browsing the many blog entries on about the MySQL Acquisition (thanks a lot for the very warm welcome!), I stumbled over this (Python-based) utility: SnapBack, a tool that uses ZFS snapshots to perform physical backups of MySQL databases on Solaris. Very cool! This is actually something I was wanting to add to the mylvmbackup script, too - I have to take a closer look at how this is done (I tried to install OpenSolaris on a VirtualBox instance, but it caused it to crash the emulator).


A hidden gem in the MySQL distribution: replace

Since the very early days, the MySQL distribution packages contain a very useful commandline-tool named replace. As the name implies, it can be used to replace strings in text files. From the documentation:

The replace utility program changes strings in place in files or on the standard input. Invoke replace in one of the following ways:

shell> replace from to [from to] ... -- file [file] ...
shell> replace from to [from to] ... < file

from represents a string to look for and to represents its replacement. There can be one or more pairs of strings. Use the -- option to indicate where the string-replacement list ends and the filenames begin. In this case, any file named on the command line is modified in place, so you may want to make a copy of the original before converting it. …

[Read more]
Showing entries 1 to 7