SlideShare a Scribd company logo
4a­1Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
4a. MySQL Object Management
for the Oracle DBA
Ronald Bradford
Senior Consultant
MySQL Inc
January 2008
4a­2Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Agenda
GOAL: Creating and Managing MySQL Objects
 

SQL Object Types

Creating Objects

Managing Objects

MySQL Data Dictionary
4a­3Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
 
SQL Object Types
4a­4Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Object Types

User

Database     (Schema)

Tablespace / Data File

Table / Column

Index

View

Trigger

Stored Procedure

Stored Function

User Defined Function (UDF)
No Sequences
No Snapshots
No Synonyms
4a­5Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Users

There is no concept of user ownership within MySQL 

All objects are part of a database (or 'schema') 

Users only have object privileges assigned to them 
4a­6Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Table / Column

Table Name is case sensitive (by default)

Reserved Words are permitted (appropriately quoted)
http://dev.mysql.com/doc/refman/5.1/en/reserved­words.html
4a­7Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Indexes

Default Index type is BTREE

Memory has HASH & BTREE Indexes

MyISAM has a FULLTEXT Index
4a­8Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Views

Updatable and non­updatable views supported

view and table names must be unique

DEFINER clause allows view to run as the calling user, 
or another defined user

View restrictions

cannot contain a subquery in the FROM clause.

cannot refer to system or user variables.

cannot refer to prepared statement parameters.

Within a stored routine, the definition cannot refer to routine 
parameters or local variables.
4a­9Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Views

View restrictions (cont)

Any table or view referred to in the definition must exist. 
However after creation, underlying objects can be dropped or 
modified. View is not invalidated, but will throw error on usage.

The definition cannot refer to a TEMPORARY table

You cannot create a TEMPORARY view.

The tables named in the view definition must already exist.

You cannot associate a trigger with a view.

View algorithms

MERGE

TEMPTABLE

UNDEFINED

Supports WITH CHECK OPTION

Do not support Materialized Views
4a­10Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Triggers

DML triggers only ­ no system triggers

[BEFORE | AFTER] [INSERT | UPDATE | DELETE]

Only one of each trigger type supported

FOR EACH ROW, no FOR EACH STATEMENT

No INSTEAD OF

No WHEN Condition

NEW.col and OLD.col syntax

CALL statement for SP not permitted

No statements that implicitly or explicitly COMMIT | 
ROLLBACK 
4a­11Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
Stored Procedures

PL/PSM (Persistent Stored Modules) 

Non scrollable, read only cursors

Support for most loop types (FOR loops not yet)

DEFINER clause allows stored procedure to run as the 
calling user, or another defined user

No packages support

No anonymous blocks

No concept of dependency within MySQL

Stored procedures are not required for high 
performance within MySQL
4a­12Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
User Defined Functions (UDF)

Added as Object Files

Compiled and available on permanent basis
mysql> create function logger returns integer soname 'syslogudf.so';
mysql> select logger('logging from ' + version());
http://dev.mysql.com/doc/refman/5.0/en/adding­functions.html
4a­13Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
MySQL Create Object Limitations

No online ALTER Table

No online Add Tablespace Data File

Online Add Index (5.1)

Online Add Enum Value (5.1)

Online Add Column (5.1 ­ MyISAM)
4a­14Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
MySQL Auto Increment
Replacement for SEQUENCE

Limitations

Only one per table

No System wide concept

No Get Next capability

Get Value after Insert with LAST_INSERT_ID()

No required in INSERT, or NULL can be used

No persistence of true max value used across restart

exists in Falcon 6.0
http://dev.mysql.com/doc/refman/5.0/en/example­auto­increment.html
4a­15Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
 
MySQL Data Dictionary
4a­16Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
MySQL Data Dictionary
Two Present Sources

Privilege/System Tables ­  'mysql' database 

Information Schema
4a­17Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
'mysql' database

Privileges (host, db ,user, tables_priv, columns_priv,procs_priv)

Help (help_category, help_keyword, help_relation, help_topic)

Time zones (time_zone, time_zone_name, 
time_zone_leap_second, time_zone_transition, 
time_zone_transition_type)

Procedure & Function (proc, func)
4a­18Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
INFORMATION_SCHEMA
5.0

SCHEMATA, TABLES, COLUMNS, TABLE_CONSTRAINTS, 
VIEWS, STATISTICS

USER_PRIVILEGES, 
SCHEMA_PRIVILEGES,TABLE_PRIVILIGES, 
COLUMN_PRIVILEGES

CHARACTER_SETS, COLLATIONS, 
COLLATION_CHARACTER_SET_APPLICIBILITY

ROUTINES, PROFILING
5.1

KEY_COLUMN_USAGE,PLUGINS,ENGINES,PARTITIONS,EVENT
S,FILES, REFERENTIAL_CONSTRAINTS,

PROCESSLIST, GLOBAL_STATUS, 
SESSION_STATUS,GLOBAL_VARIABLES,SESSION_VARIABLES 
6.0

FALCON_
4a­19Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
 
 
4a­20Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
INFORMATION_SCHEMA Examples
Table Disk Size for given schema 
select table_name, table_rows, avg_row_length,
       data_length/1024/1024 as data_mb, 
       index_length/1024/1024 as index_mb 
from information_schema.tables 
where table_schema='dbname'
order by 4 desc;
4a­21Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
INFORMATION_SCHEMA Examples
 
SELECT TABLE_SCHEMA, SUM((DATA_LENGTH + INDEX_LENGTH) / 
(1024 * 1024)) AS SIZE_MB  FROM 
INFORMATION_SCHEMA.TABLES
GROUP BY TABLE_SCHEMA ORDER BY SIZE_MB DESC
SELECT ROUTINE_TYPE, ROUTINE_NAME FROM 
INFORMATION_SCHEMA.ROUTINES WHERE 
ROUTINE_SCHEMA='dbname';
SELECT 
TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_TABLE, 
ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE 
TRIGGER_SCHEMA='dbname';
SELECT CONCAT('DROP TABLE ',table_name,';')
INTO OUTFILE '/sql/drop_tables.sql'
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 
'dbname';
4a­22Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
INFORMATION_SCHEMA Examples
 
SELECT s.schema_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+    
       SUM(t.index_length))/1024/1024,2),0.00),'Mb') 
total_size,  CONCAT(IFNULL(ROUND(((SUM(t.data_length)
+SUM(t.index_length))­SUM(t.data_free))/1024/1024,2),
0.00),'Mb') data_used,
CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),'Mb') 
data_free,
IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))­   
SUM(t.data_free))/((SUM(t.data_length)
+SUM(t.index_length)))*100),2),0) pct_used,       
COUNT(table_name) total_tables
FROM information_schema.schemata s
LEFT JOIN information_schema.tables t ON s.schema_name = 
t.table_schema
WHERE s.schema_name != 'information_schema'
GROUP BY s.schema_name  ORDER BY pct_used DESCG
4a­23Copyright 2008 MySQL Inc MySQL ­ The Best Online Database for modern applications
4a. MySQL Object Management
Version 1.2
 
Questions?

More Related Content

Viewers also liked (19)

PPT
Mba2216 business research project course intro 080613
Stephen Ong
 
PPTX
Change
Ask To Solve
 
PPT
Bba 2204 fin mgt introduction 180913
Stephen Ong
 
PPTX
Decision analysis part ii
Ask To Solve
 
PPT
Mba2216 week 01 intro
Stephen Ong
 
PPT
Dbs1034 biz trx week 9 balancing off accounts
Stephen Ong
 
PPT
Tbs910 sampling hypothesis regression
Stephen Ong
 
PPT
Abdm4223 lecture week 3 210513
Stephen Ong
 
PPT
Abdm4064 week 09 10 sampling
Stephen Ong
 
PPT
Decision Analysis I 2010
Martyput
 
PPT
Bba 3274 qm week 5 game theory
Stephen Ong
 
PPT
Bba 2204 fin mgt week 8 risk and return
Stephen Ong
 
PPT
Abdm4064 week 05 data collection methods part 1
Stephen Ong
 
PDF
Best Practices in Migrating to MySQL - Part 1
Ronald Bradford
 
PPT
Bba 2204 fin mgt week 12 working capital
Stephen Ong
 
PPT
Bba 3274 qm week 6 part 1 regression models
Stephen Ong
 
PPTX
An Introduction to Bayesisan Decision Analysis
Medgate Inc.
 
PPTX
Embedded Decision Analysis
SmartOrg
 
PPT
Dbs1034 biz trx week 8 purchases day book and ledger
Stephen Ong
 
Mba2216 business research project course intro 080613
Stephen Ong
 
Change
Ask To Solve
 
Bba 2204 fin mgt introduction 180913
Stephen Ong
 
Decision analysis part ii
Ask To Solve
 
Mba2216 week 01 intro
Stephen Ong
 
Dbs1034 biz trx week 9 balancing off accounts
Stephen Ong
 
Tbs910 sampling hypothesis regression
Stephen Ong
 
Abdm4223 lecture week 3 210513
Stephen Ong
 
Abdm4064 week 09 10 sampling
Stephen Ong
 
Decision Analysis I 2010
Martyput
 
Bba 3274 qm week 5 game theory
Stephen Ong
 
Bba 2204 fin mgt week 8 risk and return
Stephen Ong
 
Abdm4064 week 05 data collection methods part 1
Stephen Ong
 
Best Practices in Migrating to MySQL - Part 1
Ronald Bradford
 
Bba 2204 fin mgt week 12 working capital
Stephen Ong
 
Bba 3274 qm week 6 part 1 regression models
Stephen Ong
 
An Introduction to Bayesisan Decision Analysis
Medgate Inc.
 
Embedded Decision Analysis
SmartOrg
 
Dbs1034 biz trx week 8 purchases day book and ledger
Stephen Ong
 

Similar to MySQL for the Oracle DBA - Object Management (20)

PPTX
MySQL Quick Dive
Sudipta Kumar Sahoo
 
PDF
the State of the Dolphin - October 2020
Frederic Descamps
 
PDF
My sql indo_comm
Ricky Setyawan
 
PPTX
cPanel now supports MySQL 8.0 - My Top Seven Features
Dave Stokes
 
PDF
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
PPTX
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Dave Stokes
 
PDF
My sql crashcourse_intro_kdl
sqlhjalp
 
PDF
MySQL-Interview_Questions.pdf
Samir P.
 
PDF
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
Olivier DASINI
 
PDF
Mysql database basic user guide
PoguttuezhiniVP
 
PDF
MySQL for Oracle DBAs
Mario Beck
 
PDF
MySQL : State of the Dolphin May 2019
Frederic Descamps
 
PPTX
MySQL
janova santhi
 
PPTX
MySQL 8 for Developers
Georgi Sotirov
 
PDF
MySQL 5.7 -- SCaLE Feb 2014
Dave Stokes
 
PDF
MySQL Goes to 8! FOSDEM 2020 Database Track, January 2nd, 2020
Geir Høydalsvik
 
PDF
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp
 
PDF
Mysql User Camp : 20th June - Mysql New Features
Tarique Saleem
 
PPTX
MySQL 8.0 in a nutshell
OracleMySQL
 
PPTX
State ofdolphin short
Mandy Ang
 
MySQL Quick Dive
Sudipta Kumar Sahoo
 
the State of the Dolphin - October 2020
Frederic Descamps
 
My sql indo_comm
Ricky Setyawan
 
cPanel now supports MySQL 8.0 - My Top Seven Features
Dave Stokes
 
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Dave Stokes
 
My sql crashcourse_intro_kdl
sqlhjalp
 
MySQL-Interview_Questions.pdf
Samir P.
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
Olivier DASINI
 
Mysql database basic user guide
PoguttuezhiniVP
 
MySQL for Oracle DBAs
Mario Beck
 
MySQL : State of the Dolphin May 2019
Frederic Descamps
 
MySQL 8 for Developers
Georgi Sotirov
 
MySQL 5.7 -- SCaLE Feb 2014
Dave Stokes
 
MySQL Goes to 8! FOSDEM 2020 Database Track, January 2nd, 2020
Geir Høydalsvik
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp
 
Mysql User Camp : 20th June - Mysql New Features
Tarique Saleem
 
MySQL 8.0 in a nutshell
OracleMySQL
 
State ofdolphin short
Mandy Ang
 
Ad

More from Ronald Bradford (20)

PDF
Successful Scalability Principles - Part 1
Ronald Bradford
 
PDF
MySQL Backup and Recovery Essentials
Ronald Bradford
 
PDF
The History and Future of the MySQL ecosystem
Ronald Bradford
 
PDF
Lessons Learned Managing Large AWS Environments
Ronald Bradford
 
PDF
Monitoring your technology stack with New Relic
Ronald Bradford
 
PDF
MySQL Best Practices - OTN
Ronald Bradford
 
PDF
MySQL Scalability Mistakes - OTN
Ronald Bradford
 
PDF
My SQL Idiosyncrasies That Bite OTN
Ronald Bradford
 
PDF
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 
PDF
MySQL Idiosyncrasies That Bite SF
Ronald Bradford
 
PDF
Successful MySQL Scalability
Ronald Bradford
 
PDF
MySQL Idiosyncrasies That Bite 2010.07
Ronald Bradford
 
PDF
Capturing, Analyzing and Optimizing MySQL
Ronald Bradford
 
PDF
MySQL Idiosyncrasies That Bite
Ronald Bradford
 
KEY
10x Performance Improvements
Ronald Bradford
 
PDF
LIFTOFF - MySQLCamp for the Oracle DBA
Ronald Bradford
 
PDF
IGNITION - MySQLCamp for the Oracle DBA
Ronald Bradford
 
PDF
10x Performance Improvements - A Case Study
Ronald Bradford
 
PDF
Dolphins Now And Beyond - FOSDEM 2010
Ronald Bradford
 
PDF
Drizzle - Status, Principles and Ecosystem
Ronald Bradford
 
Successful Scalability Principles - Part 1
Ronald Bradford
 
MySQL Backup and Recovery Essentials
Ronald Bradford
 
The History and Future of the MySQL ecosystem
Ronald Bradford
 
Lessons Learned Managing Large AWS Environments
Ronald Bradford
 
Monitoring your technology stack with New Relic
Ronald Bradford
 
MySQL Best Practices - OTN
Ronald Bradford
 
MySQL Scalability Mistakes - OTN
Ronald Bradford
 
My SQL Idiosyncrasies That Bite OTN
Ronald Bradford
 
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 
MySQL Idiosyncrasies That Bite SF
Ronald Bradford
 
Successful MySQL Scalability
Ronald Bradford
 
MySQL Idiosyncrasies That Bite 2010.07
Ronald Bradford
 
Capturing, Analyzing and Optimizing MySQL
Ronald Bradford
 
MySQL Idiosyncrasies That Bite
Ronald Bradford
 
10x Performance Improvements
Ronald Bradford
 
LIFTOFF - MySQLCamp for the Oracle DBA
Ronald Bradford
 
IGNITION - MySQLCamp for the Oracle DBA
Ronald Bradford
 
10x Performance Improvements - A Case Study
Ronald Bradford
 
Dolphins Now And Beyond - FOSDEM 2010
Ronald Bradford
 
Drizzle - Status, Principles and Ecosystem
Ronald Bradford
 
Ad

Recently uploaded (20)

PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 

MySQL for the Oracle DBA - Object Management