Archive for the ‘oracle’ Category

Best of Guide – Highlights of Our Popular Content

Май 24th, 2012

Read the original article at Best of Guide – Highlights of Our Popular Content

Top 5 Most Popular

We use a broad brush to highlight the biggest no-nos in web application scalability.

We dig into scalability, steering to the richest areas to focus on.

MySQL on Amazon EC2, the what, how and when.

We highlight some of the big differences between the two database engines. We’re also working on revamping this content, so stay tuned for more.

Interviewing a MySQL DBA – a guide for managers. Also helpful if you’re gearing up for an interview.

Hiring Guides

This two part guide for a hiring manager, focuses on the MySQL Database Operations role.

A long time favorite, a hiring guide for Oracle DBAs.

Devops is the latest craze in bringing the worlds of operations and development together.  We talk about how to identify and attract such a candidate.

Today the cloud is *almost* synonymous with Amazon Web Services and their Elastic Compute (EC2) cloud offering.  Want to hire the best, here’s the step-by-step guide.

Howtos

Caching caching everywhere.  Learn to do it right.

Hotbackups make building replicas a snap.  Avoid the downtime & speedup the process.

Get your backups right so you can get some sleep at night!

Learn how to automatically spinup new MySQL slaves in Amazon EC2.

Industry Commentary

A decade ago startups large and small were running on Oracle, but no longer.  As the shift intensifies, it becomes harder and harder to find the right talent.  Here’s why.

High availability ain’t what it used to be.  Here’s why nobody is really achieving so-called five nines.

We argue that technologists with broad experience are needed to achieve scalability for today’s high traffic high transaction websites.

Startup & Small Business Advice

You’ve heard all the hype.  Now for some medicine.

Our three part guide takes you through ten steps to building a successful consulting business.  This is as much a guide for freelancers or wanna be consultants, as it is for startups, and those wishing to hire good temporary resources.

Book Reviews

Learn about scalability from the guys at AKF.

Here’s a great how-to book, short and to the point.  Optimizing those queries!

Building a startup doesn’t have to mean big money. Stay efficient and build those margins.

Jeff Jarvis champions Google, but we flip the question around.

Hidden Gems

Cut through the hype.  Which types of applications really do lend themselves to deploying in the cloud?

Ask some tough questions before you deploy everything in the cloud.

Migrating your application from Oracle to MySQL, you may be in for a bumpy road.  Here are a few things to watch out for.

Soup to nuts guide to deploying applications on Amazon Web Services EC2.

For more articles like these go to iHeavy, Inc +1-212-533-6828


PlanetMySQL Voting: Vote UP / Vote DOWN

Best of Guide – Highlights of Our Popular Content

Май 24th, 2012

Read the original article at Best of Guide – Highlights of Our Popular Content

Top 5 Most Popular

We use a broad brush to highlight the biggest no-nos in web application scalability.

We dig into scalability, steering to the richest areas to focus on.

MySQL on Amazon EC2, the what, how and when.

We highlight some of the big differences between the two database engines. We’re also working on revamping this content, so stay tuned for more.

Interviewing a MySQL DBA – a guide for managers. Also helpful if you’re gearing up for an interview.

Hiring Guides

This two part guide for a hiring manager, focuses on the MySQL Database Operations role.

A long time favorite, a hiring guide for Oracle DBAs.

Devops is the latest craze in bringing the worlds of operations and development together.  We talk about how to identify and attract such a candidate.

Today the cloud is *almost* synonymous with Amazon Web Services and their Elastic Compute (EC2) cloud offering.  Want to hire the best, here’s the step-by-step guide.

Howtos

Caching caching everywhere.  Learn to do it right.

Hotbackups make building replicas a snap.  Avoid the downtime & speedup the process.

Get your backups right so you can get some sleep at night!

Learn how to automatically spinup new MySQL slaves in Amazon EC2.

Industry Commentary

A decade ago startups large and small were running on Oracle, but no longer.  As the shift intensifies, it becomes harder and harder to find the right talent.  Here’s why.

High availability ain’t what it used to be.  Here’s why nobody is really achieving so-called five nines.

We argue that technologists with broad experience are needed to achieve scalability for today’s high traffic high transaction websites.

Startup & Small Business Advice

You’ve heard all the hype.  Now for some medicine.

Our three part guide takes you through ten steps to building a successful consulting business.  This is as much a guide for freelancers or wanna be consultants, as it is for startups, and those wishing to hire good temporary resources.

Book Reviews

Learn about scalability from the guys at AKF.

Here’s a great how-to book, short and to the point.  Optimizing those queries!

Building a startup doesn’t have to mean big money. Stay efficient and build those margins.

Jeff Jarvis champions Google, but we flip the question around.

Hidden Gems

Cut through the hype.  Which types of applications really do lend themselves to deploying in the cloud?

Ask some tough questions before you deploy everything in the cloud.

Migrating your application from Oracle to MySQL, you may be in for a bumpy road.  Here are a few things to watch out for.

Soup to nuts guide to deploying applications on Amazon Web Services EC2.

For more articles like these go to iHeavy, Inc +1-212-533-6828


PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Striped Views

Май 24th, 2012

A question came up today about how to stripe a MySQL view, and this post shows you how. Along with the question, there was a complaint about why you can’t use session variables in a view definition. It’s important to note two things: there’s a workaround and there’s an outstanding request to add lift the feature limitation in Bug 18433.

A striped view lets authorized users see only part of a table, and is how Oracle Database 11g sets up Virtual Private Databases. Oracle provides both schema (or database) level access and fine-grained control access. Fine grained control involves setting a special session variable during a user’s login. This is typically done by checking the rights in an Access Control List (ACL) and using an Oracle built-in package.

You can do more or less the same thing in MySQL by using stored functions. One function would set the session variable and the other would fetch the value for comparison in a view.

Most developers who try this initially meet failure because they try to embed the session variable inside the view, like this trivial example with Hobbits (can’t resist the example with the first installment from Peter Jackson out later this year):

1
2
CREATE VIEW hobbit_v AS
SELECT * FROM hobbit WHERE hobbit_name = @sv_login_name;

The syntax is disallowed, as explained in the MySQL Reference 13.1.20 CREATE VIEW Syntax documentation. The attempt raises the following error message:

ERROR 1351 (HY000): VIEW's SELECT contains a variable or parameter

The fix is quite simple, you write a function that sets the ACL value for the session and another that queries the ACL session value. For the example, I’ve written the SET_LOGIN_NAME and a GET_LOGIN_NAME functions. (If you’re new to stored programs, you can find a 58 page chapter on writing them in my Oracle Database 11g & MySQL 5.6 Developer Handbook (Oracle Press) or you can use Guy Harrison’s MySQL Stored Procedure Programming.)

You would call the SET_LOGIN_NAME when you connect to the MySQL database as the first thing to implement this type of architecture. You would define the function like the following. (Please note that the example includes all setup statements from the command line and should enable you cutting and pasting it. ;-) ):

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
-- Change the delimiter to something other than a semicolon.
DELIMITER $$
 
-- Conditionally drop the function.
DROP FUNCTION IF EXISTS set_login_name$$
 
-- Create the function.
CREATE FUNCTION set_login_name(pv_login_name VARCHAR(20)) RETURNS INT UNSIGNED
BEGIN
 
  /* Declare a local variable to verify completion of the task. */
  DECLARE  lv_success_flag  INT UNSIGNED  DEFAULT FALSE;
 
  /* Check whether the input value is something other than a null value. */
  IF pv_login_name IS NOT NULL THEN
 
    /* Set the session variable and enable the success flag. */
    SET @sv_login_name := pv_login_name;
    SET lv_success_flag := TRUE;
 
  END IF;
 
  /* Return the success flag. */
  RETURN lv_success_flag;
END;
$$
 
-- Change the delimiter back to a semicolon.
DELIMITER ;

You can use a query to set and confirm action like this:

SELECT IF(set_login_name('Frodo')=1,'Login Name Set','Login Name Not Set') AS "Login Name Status";

A more practical example in an API would be this, which returns zero when unset and one when set:

SELECT set_login_name('Frodo') AS "Login Name Status";

The getter function for this example, simply reads the current value of the MySQL session variable. Like the prior example, it’s ready to run too.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Change the delimiter to something other than a semicolon.
DELIMITER $$
 
-- Conditionally drop the function.
DROP FUNCTION IF EXISTS get_login_name$$
 
-- Create the function.
CREATE FUNCTION get_login_name() RETURNS VARCHAR(20)
BEGIN
  /* Return the success flag. */
  RETURN @sv_login_name;
END;
$$
 
-- Change the delimiter back to a semicolon.
DELIMITER ;

Before you test it, lets create a HOBBIT table, seed it with data, and create a HOBBIT_V view. They’re bundled together in the following microscript:

-- Conditionally drop the table.
DROP TABLE IF EXISTS hobbit;
 
-- Create the table.
CREATE TABLE hobbit
( hobbit_id    INT UNSIGNED
, hobbit_name  VARCHAR(20));
 
-- Seed two rows.
INSERT INTO hobbit VALUES ( 1,'Bilbo'),( 1,'Frodo');
 
-- Conditionally drop the view.
DROP VIEW IF EXISTS hobbit_v;
 
-- Create the function-enabled view.
CREATE VIEW hobbit_v AS
SELECT * FROM hobbit WHERE hobbit_name = get_login_name();

A query to the table after setting the session variable will only return one row, the row with Frodo in the HOBBIT_NAME column. It also guarantees an unfiltered UPDATE statement against the view only updates the single row returned, like this:

UPDATE hobbit_v SET hobbit_id = 2;

In a real solution, there are more steps. For example, you’d want your tables in one database, views in another, and functions and procedures in a library database. However, I hope this helps seed some ideas for those interested in creating fine-grained virtual private databases in MySQL with user-authenticated application controls.


PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Connector/Net 6.4.5 has been released

Май 22nd, 2012
MySQL Connector/Net 6.4.5 has been released!  This is an update to our 6.4 driver and brings several bug fixes.  It is appropriate for production use with MySQL server versions 5.0-5.5

It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/#downloads and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

You can read about the changes in this version at http://dev.mysql.com/doc/refman/5.5/en/connector-net-news-6-4-5.html

You can find our team blog at http://blogs.oracle.com/MySQLOnWindows.  You can also post questions on our forums at http://forums.mysql.com/

Enjoy and thanks for the support!      
PlanetMySQL Voting: Vote UP / Vote DOWN

Log Buffer #272, A Carnival of the Vanities for DBAs

Май 18th, 2012
It is evident and beyond doubt now that the new media technologies like Twitter and Facebook are not going to wipe-out the blogs, rather they are complimenting each other very nicely and it seems they were made for each other. This Log Buffer Edition enhances this match, and presents you Log Buffer #272. Oracle: It [...]
PlanetMySQL Voting: Vote UP / Vote DOWN

Log Buffer #272, A Carnival of the Vanities for DBAs

Май 18th, 2012
It is evident and beyond doubt now that the new media technologies like Twitter and Facebook are not going to wipe-out the blogs, rather they are complimenting each other very nicely and it seems they were made for each other. This Log Buffer Edition enhances this match, and presents you Log Buffer #272. Oracle: It [...]
PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Cluster 7.2 — Unlimited Possibilities

Май 16th, 2012
We've recently seen some great announcements of MySQL Cluster delivering amazing results for both selects and updates. The posts (see related articles below) are full of juicy technical details and proofs, but today I'd like to change the perspective a bit. Let's compare those figures with real-world data and imagine what could be done. Please note that I'm not using any scientific method here, just dreaming about the unlimited opportunities offered by MySQL Cluster today.

MySQL Cluster 7.2.7 -- 1B+ Writes per Minute
Cluster can deliver 1B+ selects per minute with 8 nodes and 1B+ updates per minute with 30 nodes.

Our planet is getting quite populated and interconnected. World population is 7B+ and 2B+ of us are using internet. Let's assume that, due to time-zones, only 1/3 of the total internet population is online at a given time (700M+) and that a single action generates one update and one select on the database.

What kind of services can we offer then?

With such scalability and performance, MySQL Cluster offers endless opportunities to develop something new that can support the exponential growth of the web and offer always-on services to everyone, for example:
  • Hellos from the world -- a website where everyone can say hello to the world, whenever they want. MySQL Cluster can handle the entire online population in less than 1 minute;
  • Let's shop together -- a global eCommerce website selling everything with 100% market share. If everyone would buy an item per minute, MySQL Cluster could easily fulfill the needs of the entire internet population with 30 nodes;
  • Like everything you like -- a like button that can be attached to everything in order to collect statistics on users' favorite things. MySQL Cluster could easily sustain the total online world assuming they'd like 1 thing per minute;
Furthermore, MySQL Cluster could handle updates from all of Zynga's 60M active daily users in 3 seconds or all of Facebook's 900M+ active users in less than a minute. All of that giving you ACID compliance and synchronous replication to ensure no data loss.

The Oracle MySQL engineering team did a great job with Cluster: let's build the next big thing with it!

Related articles





PlanetMySQL Voting: Vote UP / Vote DOWN

Log Buffer #271, A Carnival of the Vanities for DBAs

Май 11th, 2012
They say, “April showers bring May flowers.”  They basically say that nature brings different things in different colors aimed at improving the things. That is so true for the blogging world too. This Log Buffer Edition also brings out different blog posts to improve things, so enjoy the Log Buffer #271. Oracle: One of world’s [...]
PlanetMySQL Voting: Vote UP / Vote DOWN

Log Buffer #271, A Carnival of the Vanities for DBAs

Май 11th, 2012
They say, “April showers bring May flowers.”  They basically say that nature brings different things in different colors aimed at improving the things. That is so true for the blogging world too. This Log Buffer Edition also brings out different blog posts to improve things, so enjoy the Log Buffer #271. Oracle: One of world’s [...]
PlanetMySQL Voting: Vote UP / Vote DOWN

Hardware Components Failures — Survey Results

Май 10th, 2012
When preparing for the the IOUG Collaborate 12 deep dive on deploying Oracle Databases for high Availability, I wanted to provide some feedback on what hardware components are failing most frequently and which ones are less frequently. I believe I have reasonably good idea about that but I thought that providing some more objective data [...]
PlanetMySQL Voting: Vote UP / Vote DOWN