Presentation is loading. Please wait.

Presentation is loading. Please wait.

Would You Like Some Transactions With That Table?

Similar presentations


Presentation on theme: "Would You Like Some Transactions With That Table?"— Presentation transcript:

1 Would You Like Some Transactions With That Table?
MySQL Would You Like Some Transactions With That Table? Oct 29, 2009

2 Slides Are Available Oct 29, 2009

3 What Is MySQL? Most popular open source RDBMS Widely used
Open source means 'free' Really? No cost at all? Widely used Sabre – airline reservations Google LinkedIn What does Oracle DBA need to know? Many differences... Oct 29, 2009

4 Why Should I Care? I'm an Oracle DBA Why should I learn about MySQL?
MySQL means nothing to me It isn't a 'real' RDBMS Why should I learn about MySQL? MySQL is being used by real businesses Can't hurt your employability Many jobs expect DBA to know multiple RDBMS Why not learn one that is widely used? And it's free – you can download and install right now! Oct 29, 2009

5 Oracle DBA Perspective
What will we look at? Installing Start/stop How database/tables stored Backups Transactions Storage engines Oct 29, 2009

6 My Message Compare MySQL to Oracle Not to be critical of MySQL
Not to praise Oracle Make Oracle DBAs aware How much we assume about RDBMS Because Oracle does things a certain way MySQL is very different Assuming it is like Oracle can cause serious problems Does your business understand the differences? The cost of being 'free'? Oct 29, 2009

7 MySQL Versions MySQL Enterprise MySQL Community Edition
Have to buy support MySQL Community Edition The 'free' version MySQL Community Edition Preview Release Available for download Ready for prime time? Oracle doesn't offer 12g for trial download... Oct 29, 2009

8 MySQL Versions Oct 29, 2009

9 MySQL – Where Did It Come From?
Used to store web site logs Transactions What's that? If we lose some records So what? Supported by an individual Do your own thing Recovery Not to worry, plenty more web logs every day Oct 29, 2009

10 Some Differences – MySQL/Oracle
Database Schema a group of database objects Database user Maps to a database schema MySQL Server Databases Group of database objects Users don't map to database Oct 29, 2009

11 Some Differences – MySQL/Oracle
Storage engines Transaction support Performance Hot backup Binary logging and recovery Table locking Corruption Misc. Oct 29, 2009

12 Storage Engines MySQL gives you a choice MySQL storage engines
Oracle, all transactional all the time (OATATT) MySQL storage engines MyISAM (IBM, Indexed Sequential Access Method) Very fast read InnoDB Transactional, like Oracle Separate software, owned by Oracle Many others See next chart Oct 29, 2009

13 Storage Engines Oct 29, 2009

14 InnoDB Storage Engine Imagine mixing
MyISAM, InnoDB tables in a statement What does 'transactional' mean? What does “recovery” mean? Oct 29, 2009

15 CSV Storage Engine CSV storage engine Stores data in text files
Using comma-separated format Oct 29, 2009

16 Blackhole Storage Engine
My favorite This is where we store all the data relating to the Raiders and their 'Commitment to Excellence' Oct 29, 2009

17 Yeah, But... No problem Cool, but I'll just make all the tables InnoDB
MySQL catalog (system?) tables are MyISAM Can't change them Table storage engine can be changed at any time Privileged users No one should do this, but...stuff happens Create table syntax Supports overriding default storage engine Oct 29, 2009

18 Transaction Support MyISAM Default table type
Table type of system databases Does not support transactions Example Writing to MyISAM tables and server crashes Who know what was and wasn't written to tables No recovery Oct 29, 2009

19 Performance Many large MySQL servers in use Optimizer
Performance must be good or good enough for 'free' Optimizer Different storage engines How to optimize statement that has MyISAM tables InnoDB tables Does it support all storage engines you are using? Oct 29, 2009

20 Hot Backup MySQL does not have this Backup option #1 Backup option #2
Shutdown server, copy all files, startup server Backup option #2 Lock all tables Dump all data to a dump file Dump file is set of SQL to recreate database Very slow to recover Backup option #3 Buy hot backup software product Not free Oct 29, 2009

21 Binary Logging and Recovery
MySQL Default, no logging You can configure binary logging Three formats Statement-based Row-based Mixed Binary log filenames have format binlog , binlog , etc. You must apply them in correct order Oct 29, 2009

22 MySQL Binary Logs MySQL does not have any way of knowing when replaying the binary logs which statements need to be executed and which are already committed. Oracle DBA doesn't worry about this Oracle checks and tells you which archived redo log is needed next Oracle won't allow archived redo logs to be applied out of order Oct 29, 2009

23 Binary Logging Formats
Oct 29, 2009

24 Binary Log Issues Oct 29, 2009

25 Table Locking MyISAM storage engine InnoDB storage engine
Does not support row level locking Table locks Performance? InnoDB storage engine Supports row level locking Oct 29, 2009

26 Corruption Oracle MySQL I have rarely seen any cases
But all tables support transactions MySQL What does it mean to rollback When different storage engines involved Some support transactions, some don't Some tables will be rolled back Others won't Is this corruption? Oct 29, 2009

27 MySQL Corruption Issues
Good read Discusses corruption issues in MySQL engines I'm not saying this happens often But you need to be aware of these issues Another difference from Oracle Different storage engines, different corruption mechanisms /30/mysql-crash-recovery/ Oct 29, 2009

28 MySQL Issues Misc Referential Integrity Triggers Directload
Some storage engines support Triggers Row-level, not statement-level Directload Not supported Parallel Query Oct 29, 2009

29 MySQL Issues White Paper Compares MySQL to PostgreSQL
PostgreSQL, another open source RDBMS More like Oracle than MySQL Discusses issues with MySQL I'm not endorsing PostgreSQL But the whitepaper is very good Google PostgreSQL vs. MySQL A Comparison of Enterprise Suitability Oct 29, 2009

30 MySQL Table Storage MyISAM InnoDB Each table has three files
<filename>.frm – Data dictonary information <filename>.MYD – table data <filename>.MYI – table indexes InnoDB Data and indexes in a tablespaces Made up of one or more datafiles Sound familiar? Oct 29, 2009

31 Documentation Online Oct 29, 2009

32 Documentation Online Oct 29, 2009

33 Documentation Online Oct 29, 2009

34 Talk Is Cheap A little less conversation
A little more action Download and install MySQL to your laptop now Slides show the steps Windows You will have a fully functional MySQL server Start learning right now Oct 29, 2009

35 Install MySQL – Windows
Windows Vista 6.0 Service Pack 1 Screenshots shown Windows XP Professional Version 5.1 Same steps Very minor differences in what you see Oct 29, 2009

36 Downloads? Oct 29, 2009

37 Downloads? Oct 29, 2009

38 Enterprise Version Oct 29, 2009

39 Community Version Oct 29, 2009

40 Windows Downloads Oct 29, 2009

41 Windows Installation Oct 29, 2009

42 Windows Installation Oct 29, 2009

43 Windows Installation Oct 29, 2009

44 Windows Installation Oct 29, 2009

45 Windows Installation Oct 29, 2009

46 Windows Installation Oct 29, 2009

47 Windows Installation Oct 29, 2009

48 Windows Installation Oct 29, 2009

49 Windows Installation Oct 29, 2009

50 Windows Installation Uncheck Oct 29, 2009

51 Windows Installation Oct 29, 2009

52 Windows Installation Check Oct 29, 2009

53 Windows Installation Oct 29, 2009

54 Windows Installation mysql Oct 29, 2009

55 Windows Installation Oct 29, 2009

56 Accessing MySQL Windows
Click Start Programs MySQL MySQL Server 5.1 MySQL Command Line Client Right-click Send to Desktop (Create Shortcut) Double-click desktop icon Oct 29, 2009

57 Accessing MySQL Windows
Shortcut created at installation mysql Oct 29, 2009

58 mysql client utility Similar to SQL*Plus Oct 29, 2009

59 Now What? Stop, start MySQL server What databases are available
show databases; Set default database use <dbname> What tables are in the database show tables; Oct 29, 2009

60 Windows Vista Stop/Start Services Start Settings Control Panel
System and Maintenance Administrative Tools Scroll down to MySQL, highlight Upper left, options for Stop, Pause, Restart If MySQL is down, option to Start Oct 29, 2009

61 Windows XP Stop/Start Command line Services
net stop mysql, net start mysql Services Start Control Panel Administrative Tools Services window Scroll down to MySQL, highlight Upper left, options for Stop, Pause, Restart If MySQL is down, option to Start Oct 29, 2009

62 Oct 29, 2009

63 Oct 29, 2009

64 System Databases INFORMATION_SCHEMA MYSQL database TEST
Catalog database MYSQL database User and privilege information TEST For you to play in... These databases are created at installation Oct 29, 2009

65 MySQL Server Configuration
Controlled by 'option' file(s) Similar to Oracle pfile or spfile SHOW VARIABLES See current values Standard location(s) Search order One of the most common problems Persons don't know where these files are Make changes that don't take affect Can't find the file or files Oct 29, 2009

66 Option File(s) MySQL searches multiple locations
Uses most recent value of each parameter How to know all files being scanned by MySQL? mysql –help Note: dash dash help Oct 29, 2009

67 Option File Oct 29, 2009

68 Option File Oct 29, 2009

69 Option File Oct 29, 2009

70 Option File Oct 29, 2009

71 Option File Oct 29, 2009

72 MySQL Filesystem Layout
From option file (my.ini) basedir Where software is stored datadir Where table data is stored Oct 29, 2009

73 MySQL basedir Oct 29, 2009

74 MySQL basedir/bin Oct 29, 2009

75 MySQL datadir Oct 29, 2009

76 MySQL Log Files General Query Log Binary Log Slow Query Log Error Log
All client requests Binary Log Statements that modify data Slow Query Log Statements that take longer than 10 seconds Error Log Server messages Oct 29, 2009

77 MySQL Log Files Find log file locations Oct 29, 2009

78 Summary MySQL is 'free' MySQL is widely used
May need other products to make it work for you Hot backup for example MySQL is widely used MySQL is very different from Oracle DBA tasks and issues will be different MySQL is not better or worse than Oracle Just very different Oct 29, 2009

79 The End? You now have a MySQL server installed No excuses Next?
Learn it, live it, love it Update your resume Next? Multiple MySQL servers on same machine Replication etc. Oct 29, 2009


Download ppt "Would You Like Some Transactions With That Table?"

Similar presentations


Ads by Google