You are on page 1of 60

Construction project management at the next level

Many have been lost


trying to reach the Cloud.
If only theyd
let us lead the way.

If conquering the cloud was easy, anyone could do it.


Our Sherpas are standing by.
Finding the route to your perfect Cloud can be treacherous. Okay, more like impossible.
Lucky for you weve done the impossible beforeover 987,000 times before.
We know the best routes to get your project management software up, running
securely and in the Cloud fast. And no matter how big or specialized your project, weve
been there, done that, and have the parka to show for it.
Once youre in your perfect Cloud, our proven SpringBoard portal helps you
consolidate applications, data, reports and more, making them accessible to your whole
team worldwide. Youll get total control over project status, software licensing
even user training.
Get all that, plus legendary support that wont leave you up a mountain without a piton.
Call and lets talk.

Copyright 2015. LoadSpring is a trademark of LoadSpring Solutions, Inc. All Rights Reserved. loadspring.com Follow us on:

JULY/AUGUST 2015

Cloud Foundation Standards OS and


virtualization power the data center, the cloud,
and Oracles Virtual Compute Appliance / 13
Add Services with a Smile Consume enterprise
web services from mobile apps via data controls
in Oracle Mobile Application Framework / 31
On Learning from Mistakes Our technologist
demonstrates how the Oracle Database optimizer
learns and how to help it / 49 History, HyperGrowth, and the Hunt The president of
ODTUG looks back, looks at acceleration, and
looks at Kscope / 56

THE PLATFORM FOR ALL


Integrate and extend your cloud with more than two dozen new PaaS services

Push a Button
Move Your Database
to the Oracle Cloud
Same Database
Same Standards
Same Architecture

or Back to Your Data Center

cloud.oracle.com/database
or call 1.800.ORACLE.1
Copyright 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates.

VOLUME XXIX - ISSUE 4

CONTENTS

THE PLATFORM FOR ALL

Integrate and extend your cloud with more than two dozen new PaaS services.
THE CLOUD MADE WHOLE
Oracle completes its cloud
platform. /20
SAME CODE, SAME
STANDARDS, SAME
ARCHITECTURE
Technical deep dives demonstrate
proven cloud technology. /24

ORACLE CLOUD IN PRACTICE


Customer panel shares vision
and experience with Oracle Cloud
Platform. /26
A BETTER SENSE OF
DIRECTION
Customers count on Oracle Cloud
Platform to simplify IT. /27

Cover: I-Hua Chen

Up Front / 5

Community / 14

Technology / 31

FROM THE EDITOR / 5

PARTNER NEWS / 14
BOOK BEAT / 14
COMMUNITY
BULLETIN / 16

ORACLE MOBILE
APPLICATION
FRAMEWORK / 31

Big

All launch events and cloud


services are not created
equal. Tom Haunert

MASHUP / 6
News, views, trends,
and tools

At Oracle / 8
EVENTS / 8
Find out about upcoming
technology and industry
events.

RESOURCES / 9
Your guide to the latest
Oracle videos, webcasts,
white papers, and more

BRIEFS / 10
The latest product news

INTERVIEW / 13
Cloud Foundation
Standards

Operating system and


virtualization power the data
center, the cloud, and Oracles
Virtual Compute Appliance.
Tom Haunert

Happenings in Oracle
Technology Network
Roland Smart

ARCHITECT / 17
Taming Change

Meeting the challenge of


an ever-changing software
development landscape
Bob Rhubart

PEER-TO-PEER / 19
Improv 101

Add Services with a Smile


Consume enterprise web
services from mobile apps via
data controls in Oracle Mobile
Application Framework.
Chris Muir

ASK TOM / 49

On Learning from
Mistakes
Our technologist
demonstrates how the Oracle
Database optimizer learns
and how to help it.
Tom Kyte

PL/SQL / 37

On Cursors, Context,
Switches, and Mistakes
There are good ways, and
other ways, to get data from
tables. Steven Feuerstein

Three peers on brainstorming


without judging, failing, and
swapping techno for tech
Blair Campbell

DBA / 43

Comment / 56
IN THE FIELD / 56

History, Hyper-Growth,
and the Hunt
The president of ODTUG
looks back, looks at growth,
and looks at Kscope.
Tom Haunert

Beginning Performance
Tuning: Trace Your Steps
Trace sessions to document
activity details and identify
bottlenecks. Arup Nanda

ORACLE MAGAZINE JULY/AUGUST 2015

EDITORIAL
Editor in ChiefTom Haunerttom.haunert@oracle.com
Managing EditorJan Rogersjan.rogers@oracle.com
Associate Editor Patty Waddington
Contributing Editor and Writer Blair Campbell
Technology Advisor Tom Kyte
Contributor Leslie Steere
Editorial Director Robert Preston
DESIGN
Senior Creative Director Francisco G Delgadillo
Design Director Richard Merchn
Senior Designer Arianna Pucherelli
Designer Jaime Ferrand
Senior Production Manager Sheila Brennan
Production Designer Kathy Cygnarowicz
PUBLISHING
PublisherJennifer Hamiltonjennifer.hamilton@oracle.com+1.650.506.3794
Associate Publisher and Audience Development DirectorKarin Kinnearkarin.kinnear@oracle.com+1.650.506.1985
Audience Development ManagerJennifer Kurtzjennifer.s.kurtz@oracle.com
Advertising Production Director Joy Jacob
ADVERTISING SALES
President, Sprocket MediaKyle Walkenhorstkyle@sprocketmedia.com+1.323.340.8585
Western and Central US, LAD, and Canada, Sprocket MediaTom Cometatom.cometa@oracle.com+1.510.339.2403
Eastern US and EMEA/APAC, Sprocket MediaMark Makinneymark.makinney@sprocketmedia.com+1.805.709.4745
Recruitment Advertising, Sprocket MediaJosie Damianjosie.damian@sprocketmedia.com+1.626.396.9400, x200
Advertising Sales Assistant, Sprocket MediaCindy Elhajcindy@sprocketmedia.com+1.626.396.9400, x201
Mailing-List Rentals Contact your sales representative.
EDITORIAL BOARD
Ian Abramson, Karen Cannell, Andrew Clarke, Chris Claterbos, Karthika Devi, Kimberly Floss, Kent Graziano, Taqi Hasan,
Tony Jambu, Tony Jedlinski, Ari Kaplan, Val Kavi, John King, Steve Lemme, Carol McGury, Sumit Sengupta,
Jonathan Vincenzo, Dan Vlamis

SUBSCRIPTION INFORMATION
Subscriptions are complimentary for qualified individuals who complete the form found at
oracle.com/oraclemagazine. For change of address, mail in label with the new address to:
Oracle Magazine, P.O. Box 1263, Skokie, IL 60076-8263.
MAGAZINE CUSTOMER SERVICE
oracle@halldata.com Fax +1.847.763.9638 Phone +1.847.763.9635

RESOURCES
Oracle Products
+1.800.367.8674 (US/Canada)
Oracle Services
+1.888.283.0591
Oracle Press Books
oraclepressbooks.com

PRIVACY
Oracle Publishing allows sharing of its mailing list with selected third parties. If you prefer that your
mailing address or e-mail address not be included in this program, contact Customer Service at
oracle@halldata.com.
Copyright 2015, Oracle and/or its affiliates. All Rights Reserved. No part of this publication may be reprinted or otherwise reproduced without permission from the editors. ORACLE MAGAZINE IS PROVIDED ON
AN AS IS BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM YOUR
USE OF OR RELIANCE ON ANY INFORMATION PROVIDED HEREIN. The information is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into
any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality
described for Oracles products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Oracle Magazine (ISSN 1065-3171) is published bimonthly with a free subscription price by: Oracle, 500 Oracle Parkway, MS OPL-3A, Redwood City, CA 94065-1600. Periodicals Postage Paid at Redwood City,
CA, and additional mailing offices. POSTMASTER: Send address changes to: Oracle Magazine, P.O. Box 1263, Skokie, IL 60076-8263.

Printed by Quad Graphics

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

FROM THE EDITOR

Big

All launch events and cloud services are


not created equal.

NEXT STEPS
READ more about Oracle Cloud Platform
bit.ly/oraclecloudplatform
WATCH the Oracle Cloud Platform
launch event
oracle.com/us/corporate/events/cloud-platform
REGISTER for Oracle OpenWorld 2015,
San Francisco
oracle.com/openworld

SEND MAIL TO THE EDITORS


Send your opinions about what you read in Oracle
Magazine, and suggestions for possible technical
articles, to opubedit_us@oracle.com. You can
also follow our @oraclemagazine Twitter feed or
join us on Facebook at bit.ly/orclmagfb.
Letters may be edited for length and clarity and
may be published in any medium. We consider
any communications we receive publishable.

CONNECT:

bit.ly/orclmagcom

bit.ly/orclmagfb

rom Oracle OpenWorld keynotes to


launch events at company headquarters, Oracle has called out and described
its biggest new products and services from
some high-profile stages.
Usually, the announcements focus on
one new product or product family. The
Oracle Database 12c, Oracle Database
In-Memory Option, and Oracle X5 engineered system launches come to mind.
The recent Oracle X5 engineered system
announcement was particularly big because
it featured Oracles flagship engineered
systems and updates to a handful of different
engineered systemstheir hardware, software, and integrationsall at the same time.
But the cover story package in this
issue of Oracle Magazine represents the
new big in launch announcements and
launch coverage, featuring more than 24
infrastructure-as-a-service (IaaS) and
platform-as-a-service (PaaS) offerings
announced at Oracle HQ on June 22, 2015.
DIVIDING UP BIG
The Platform for All (page 20) cover
package in this issue divides our coverage
of the June 22 cloud event into multiple
sections. It also touches on the key themes
of the launchthe key cloud computing
themes of today and for the next decade.
Among them:
More delivers more. Oracles more than 24
new IaaS and PaaS offerings round out the
most extensive portfolio of cloud services in
the industry.
Complete. Oracle customers can move all
of their on-premises applicationsnot just
their Oracle Applicationsto Oracle Cloud
and back again.
twitter.com/oraclemagazine

Industry standards. Oracle is committed


to industry standards on premises and in
the cloud.
Coming decade of coexistence. All data
center computing is not moving to the cloud
tomorrow. Cloud and on-premises data processing will coexist.
Single pane of glass. Administrators can
use the same Oracle management technology for their on-premises and Oracle
Cloud solutions.
Only Oracle. Oracle is the only company with
extensive, enterprise-grade offerings in all
three levels of the cloud: IaaS, PaaS, and
software as a service (SaaS).
The Platform for All coverage also
includes a multicustomer storynot connected to the June launchfeaturing businesses using Oracle Database Cloud Service
and Oracle Java Cloud Service to meet big
business and technology challenges.
SPEAKING OF BIG
There are significant changes coming to the
next issue of Oracle Magazine. Some will
be very big and some small, but the goal
of all the changes is the same: to improve
the experience.
Oracle Magazine has been redesigned
at least twice in the last 15 years. But the
transformation thats coming in the next
issue is much more and much bigger than
any previous redesign.
The countdown has started. The
new Oracle Magazine launches with the
September/October 2015 issue. Share your
post launch feedbackbig or small.
Tom Haunert, Editor in Chief
tom.haunert@oracle.com

linkd.in/orclmag
ORACLE MAGAZINE JULY/AUGUST 2015

APPS: MOBILE LEARNING

MashUp

News. Views. Trends. Tools.

Dont wait for back-to-school to keep learningfrom pocket converters to news


aggregators, there are educational apps for every conceivable subject.

Math Ref

Featuring an
expanding inventory
of tools for common
tasks, Math Ref
provides formulas
and equations to go.
Browse more than
1,400 figures and
examples to help you
with math, physics,
and chemistry.
US$0.99 Android,
US$1.99 iOS.
happymaau.com/
projects/math-ref

Memrise

Offering courses
created by its community in everything
from history to
memory training,
Memrises clever
technology adapts
to your personal
learning style. Create
your own courses
with rich multimedia
flash cards. Free
(Android, iOS).
memrise.com

Spotzi-Atlas

Based on data
from agencies
such as NASA and
the World Bank,
Spotzi shows you
maps of the world
in unique detail,
enriched with video
and online articles.
Browse for themes
such as animals,
temperatures, and
tectonic plates.
Free (Android, iOS,
Windows).
spotzi.com

DO YOU SPEAK TECH?

Web2go

Listen to news
websites, online
magazines, RSS
feeds, and blogsall
read aloud. Web2go
lets you select
articles and updates
from more than
1,000 websites
to create custom
article playlists you
can listen to on the
go. Free (Android,
Windows).
volacent.com

QUIZ YOURSELF!
1. STEAM stands for _________ .

a. Science, technology, engineering,


and mathematics
b. Science, technology, engineering,
arts, and mathematics
c. Science, technology, the environment, architecture, and mathematics
d. Skills, tools, education, ability, and
measurability

2. The short form for an open-access


online course is _________ .
a. MOODLE
b. MOOC
c. LMS
d. PBL

3. A teaching method that adjusts to

BATTERY
EXTROVERT
Tired of backup batteries that are too big to
carry everywhere? Stay charged and connected with the bKey cable-free emergency
external smartphone battery. bKey has a
built-in USB tip and a micro-USB or iPhone
tip to charge your iOS or Android phone on
the go. bKey is no bigger than a car key but
delivers a 350 milliampere-hour lithium-ion
battery good for up to 45 minutes of battery
life. Attach it to your key ring for use whenever you need it. US$29.99. shopbkey.com/
products/bkey

each students pace is called _________ .


a. Adaptive learning
b. Assistive technology
c. Blended learning
d. Augmentative and alternative
communication

1. (b) STEAM is a reaction to STEM


(science, technology, engineering, and
mathematics) that includes arts as a
priority as well.
2. (b) MOOC, or massive online
open course. Supporters see todays
online learning options as a disruptive innovation.
3. (a) Adaptive learning describes software that changes content based on
previous actions by a learner.

Answers

Tech in the
Classroom

Teachers from 26 countries shed


light on the global impact of
classroom technology, and more
than 90 percent agree that technology now plays a significant
role in the classroom. Many use
it for teaching and for communicating with parents. Insufficient
access to computers and tablets
is seen worldwide as being the
biggest barrier to using tech
for education. Responses came
from 1,000 teachers in the US
and more than 3,000 globally.

Teachers in the US

Teachers in the rest of the world

Tech plays a significant role in class:


96%
94%
Internet connectivity can be a barrier to tech in class:
35%
50%
Insufficient access to computers and tablets is the biggest
barrier to tech in class:
61%
59%
Teachers use tech to collect and analyze data:
15%
12%
Teachers likely to use tech for blended learning:
13%
16%

Source: TES Global, tesglobal.com

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Smart Padlock
Eliminate the hassle of keys
and combinations with Noke
from FU-Z Designs. Use Noke
with your iOS or Android
smartphone for easy access
to your possessions, and share
them safely and securely.
Choose permanent, one-time,
or custom settings. Use Noke
wherever you would normally
use an ordinary padlock. Also
available in a U-lock configuration. US$69.99. fuzdesigns
.com/products/Noke

The foundation of business network uptime

APC by Schneider Electric Smart-UPS


units protect 24/7/365 network availability.
Safeguarding critical networking switches and routers
Your business depends on your business network. Protecting that network,
therefore, is more critical than ever. Known for their reliability for over 25 years,
APC by Schneider Electric Smart-UPS uninterruptible power supplies eliminate
costly downtime by providing reliable, network-grade power over a wide range of
utility conditions. They keep employees connected to business-critical applications
whether they are in house, at a co-location facility, or in the cloud.

A Smart-UPS model for every need


Whatever your IT needs and configuration, we have the right Smart-UPS model.
The family offers multiple form factors (tower, rack optimized, and rack/tower
convertible) to deliver flexibility for any environment. And you can scale runtime to
business requirements. In addition, you can proactively manage the network closet
remotely and optimize energy use through a patented green mode on many
models. Deployment is easy with optional Schneider Electric installation services.
Smart-UPS backup units: the intelligent choice for your business network!

Business-wise, Future-driven.

Eliminate Costly Downtime!

Intelligent battery backup


> Avoid costly power problems by keeping your IT
equipment and data safe and available with networkgrade power conditioning.
> Reduce operating and maintenance costs with a
patented green operating mode for high efficiency and
intelligent battery management that prolongs life and
alerts well in advance of replacement.
> Save time with easy and convenient remote
accessibility, safe operating system shutdown, and
innovative energy management.
> Achieve smarter productivity by tailoring a variety
of settings, including switched outlet control, to
your application needs via the intuitive LCD interface
or software.

Find out how to safeguard your equipment in


our expert white paper.
Visit: www.apc.com/promo Key Code: m255u
2015 Schneider Electric. All Rights Reserved. Schneider Electric, APC, Smart-UPS, and Business-wise, Future-driven are trademarks
owned by Schneider Electric Industries SAS or its affiliated companies. All other trademarks are the property of their respective owners.
www.schneider-electric.com 998-1209036_GMA-US

EVENTS

Technology Events

Conferences and sessions to help you stay


on the cutting edge

Rise

July 31August 1, Hong Kong, China


A brand-new sister event to the popular Web Summit
event, this conference brings together thought
leaders, technology experts, investors, journalists,
and more for a showcase featuring world-renowned
speakers and presentations covering all things tech
from digital marketing to the Internet of Things, and
much more. Register at riseconf.com.

ORACLE USER GROUPS


Rocky Mountain Oracle Users Group
Summer Quarterly Educational Workshop
August 7, Denver, Colorado

bit.ly/1Hazsnf

Brazil Oracle Users Group Tech Day


August 8, So Paulo, Brazil

bit.ly/1D9k3gk

2015 Oracle Transportation


Management Users Conference

August 912, Philadelphia, Pennsylvania

bit.ly/1Gcg7Pl

Oregon and Southern Washington


Oracle Users Group Meeting
August 11, Portland, Oregon

bit.ly/1aM3W0r

Quest JD Edwards INFOCUS Conference

Black Hat USA 2015

InterDrone

August 16, Las Vegas, Nevada


fblackhat.com/us-15
Returning to Las Vegas for its 18th year, this
six-day data security event begins with four
days of training for security practitioners of all
levels, followed by the two-day main event that
includes more than 100 independently selected
briefings, exhibitions, and awards.

September 911, Las Vegas, Nevada


finterdrone.com
For the builders, buyers, and flyers of commercial drones, InterDrone offers more than
80 exhibits, industry reception and networking
opportunities, and the popular Yes Fly Zone
for drone demonstrations.

GROW

September 2022, Los Angeles, California


fbit.ly/1Jo49mb
This conference focuses on the decisions IT
leaders at midsize companies need to make in
2015 in order to lead their businesses into the
digital future.

EVENTS LOCATOR
Oracle Events
oracle.com/events
Locate User Groups
oracle.com/technetwork/community

REGISTER for these upcoming Oracle events


Oracle OpenWorld 2015
October 2529
oracle.com/openworld
JavaOne
October 2529
oracle.com/javaone

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

bit.ly/1DvqNoc

Northern California Oracle Users Group


Summer Conference
August 20, San Ramon, California

nocoug.org

UKOUG Business Analytics and


Financials SIGs

September 10, Birmingham, England

bit.ly/1O97lcb

Northwest Oracle Users Group


Annual Conference
September 14, Portland, Oregon

nwoug.org

Northeast Ohio Oracle Users


Group Meeting

September 18, Independence, Ohio

neooug.org/events

Food Sales Technology


Conference and Showcase
(FSTEC) 2015
September 2729, Washington DC
ffstec.com
The only event of its kind focused exclusively on
food service, FSTEC brings food service technology leaders and decision-makers together
under one roof.

2015 East Coast Oracle Users Conference


September 2223, Raleigh, North Carolina

bit.ly/1G1DuZr

New York Oracle User Group Fall


General Meeting
September 24, New York, New York

nyoug.org/events

North Central Oracle Apps User Group


Summer 2015 Training Day
September 24, Oakbrook Terrace, Illinois

BrainStorm San Francisco

ncoaug.com

September 28October 1,
San Francisco, California
fbit.ly/1cSAS9k
BrainStorm offers intensive full-day training and
workshops covering the real-world skills needed
to successfully implement continuous process
improvement in any organization.

Southern California User Group Meeting


September 24, Carlsbad, California

jdescug.org

UKOUG Higher Education SIG


September 29, Solihull, England

bit.ly/1D9l9ZE

GETTY IMAGES

August 1921, Whistler, British


Columbia, Canada
fgrowconf.com
GROW unites technology entrepreneurs,
investors, and executives to explore the future
of innovation, growth, and entrepreneurship. This year, more than 800 attendees are
expected for three days of examining how a
connected world will affect business evolution
and society.

Midsize Enterprise Summit West 2015

August 1719, Denver, Colorado


September 1718, Sydney, Australia

RESOURCES

Whats New at Oracle

The latest webcasts, e-books, videos, and more

WEBCASTS

VIDEOS

RESOURCE CENTERS

Oracle Cloud Developer Webcast Series


fbit.ly/1aQ2Alb
Learn how to get started developing, collaborating, and deploying in the cloud using Oracle
Developer Cloud Services turnkey, secure development platform.

Larry Ellison: Oracle CloudWorld Tokyo


2015 Highlights
fbit.ly/1IgBbEG
Watch highlights from Oracle Executive
Chairman and Chief Technology Officer Larry
Ellisons Oracle Cloud strategy keynote.

Oracle Database Innovation Online Forum


fbit.ly/1DbjPnS
Oracle Architect Tom Kyte and other product
experts show you how to leverage Oracle
Database innovations for cloud computing.

Mark Hurd: Oracle HCM World 2015 Highlights


fbit.ly/1Hs0LI4
Watch highlights from Oracle CEO Mark Hurds
keynote at Oracle HCM World 2015.

Whats New in MySQL Cluster 7.4


fbit.ly/1yN6Jlj
This webcast provides an overview of MySQL
Cluster with a focus on new performance
enhancements, geographic redundancy features,
faster online maintenance and recovery operations, and enhanced distributed monitoring of
memory usage and database operations.
Safe Passage to the Cloud: ERP Cloud
Migration Best Practices
fbit.ly/1Gb98Uz
Discover why todays CFOs are increasingly
turning to cloud-based financial management
systems to replace legacy enterprise resource
planning systems.

E-BOOKS
Establishing a Mobile Security Architecture
fbit.ly/1v31J9r
Written for mobility planners, security architects,
chief information security officers, security directors, IT directors, and operations managers, this
e-book will help you understand the best application of technologies for each area of mobility
within your organization.
Modern HR for Dummies
fbit.ly/1ODmX2A
Learn to create a talent-centric business
strategy, build a collaborative workplace culture,
and deliver engaging HR applications.
CONNECT:

oracle.com/blogs

facebook.com/oracle

Engineered Systems: The Oracle Difference


fbit.ly/1AvnWOX
Learn how to boost innovation, cut costs, and
limit server sprawl with an integrated approach
to IT.

WHITE PAPERS AND REPORTS


Harvard Business Review: Cloud
Computing Comes of Age
foracle.com/goto/hbr-cloud-age
A new report from Harvard Business Review
Analytic Services surveyed 376 business and
technology leaders and shows how cloud leaders
outperformed in key growth initiatives over the
past three years.
Harvard Business Review: Rethinking
the IT/Business Partnership to Drive
Digital Innovation
fbit.ly/1FXXtwG
A recent survey conducted by Harvard Business
Review Analytic Services about the gaps
between business user requirements and IT
responsiveness finds that IT is struggling to meet
expectations. Learn more about business users
view of IT and the outlook for the future.
Forbes Insights: Modern Customer Service:
Are You Outpacing Your Executive Peers?
fbit.ly/1ArFE4s
Read the results of an Oracle-commissioned
Forbes Insights study that examined the adoption
of moderncustomer service best practices.
twitter.com/oracle

linkedin.com/company/oracle

Unlock New Big Data Insights with MySQL


fbit.ly/1HS8mQV
Access this resource kit to learn how to unlock
insights using MySQL with the Apache Hadoop
platform, and discover best practices for big data
operations with MySQL.

INFOGRAPHICS
Oracle Engineered Systems: A Smart Choice
fbit.ly/1Eumw99
Learn why integrated IT systems are the smart
choice for forward-thinking IT professionals.
Unlock Your Full Sales Potential
fbit.ly/1PdkyOi
Learn how using business intelligence and predictive analytics software can help organizations
make gains in productivity, satisfaction, and
sales volume.

ORACLE TRAINING AND


CERTIFICATION
New Training On Demand Courses
fbit.ly/1JrJ8Hl
New training on demand features top instructors
in a high-quality streaming video of a complete
course, including lectures and training labs.

WEB LOCATOR
Oracle Consulting
oracle.com/consulting
Oracle Events and Webcasts
oracle.com/events
Oracle Newsletters
oracle.com/newsletters
Oracle Podcast Center
oracle.com/podcasts
Oracle Support
oracle.com/support
Oracle Training and Certification
bit.ly/ouoramag
My Oracle Support
myoraclesupport.com
My Oracle Support Communities
communities.oracle.com

bit.ly/plusOracle
ORACLE MAGAZINE JULY/AUGUST 2015

Press Headlines
Oracle Helps Marketers Leverage
Data Trapped in Different
Marketing Systems
fbit.ly/1Cl9zsK

The CMO Club and Oracle Study:


CMOs Struggling to Deliver
Consistent Customer
Experiences Need to Leverage
Marketing Technology
fbit.ly/1PH3deY

Oracle Utilities Express


Implementation Services Help
Utilities Speed Time to Value,
Standardize Business Processes,
and Improve Customer Service
fbit.ly/1Fl3tk5

Panduit Optimizes Global


Transportation Network

Oracle Creates New Standard in Enterprise Learning with


Oracle Learning Cloud
Oracle recently introduced Oracle Learning
Cloud, part of Oracle Human Capital
Management Cloud, to help companies
enable employees to learn contextually
and socially.
Oracle Learning Cloud makes it possible for employees to collaborate around
best practices using rich media, and it
empowers subject matter experts to
publish content. In addition to delivering
learning suggestions based on more than
100 person, job, and enterprise attributes
through its recommendation engine,
Oracle Learning Cloud facilitates curated
and referral-based learning.
To adapt and succeed in todays digital
workforce, HR and business leaders must

simplify the employee experience and


enable connections anywhere and via any
device, personalize information and communicate it in a way that is relevant for their job,
and create a culture where employees want
to share their knowledge and encourage
them to engage with each other in new and
creative ways, says Chris Leone, senior vice
president, Oracle HCM Development. The
new Oracle Learning Cloud helps companies
provide employees
with a consumer-like
experience to help
retain and develop
the talent they need
to be successful.
bit.ly/1pD0Waw

fbit.ly/1E6bnqr

IHI Streamlines Aircraft Engine


Maintenance with Oracle
Maintenance, Repair, and
Overhaul Solution

Oracle Utilities Network Management System Effectively Manages


and Utilizes Data to Help Reduce Cost and Improve Grid Reliability

fbit.ly/1K6FXbV

Oracle recently made significant updates


to Oracle Utilities Network Management
System to help enterprises more easily and
effectively integrate distributed energy
resources such as rooftop solar, wind turbines, and batteries.
Oracle Utilities Network Management
System 1.12.0.2 is an advanced distribution management system [ADMS] that
empowers utilities to flexibly manage
distribution grid data to improve reliability
and reduce cost, says Rodger Smith, senior
vice president and general manager, Oracle

Nordstrom Supports International


Expansion with Upgrade to Oracle
Retail Merchandising Systems

Updates Help Marketers Deliver More-Relevant Customer Experiences


Across Channels

fbit.ly/1EhfsM2

Lids Sports Group Opens Up


Inventory Across Channels with
Oracle Retail Solutions
fbit.ly/1He9YTo

Ministry of Health Brazil


Deploys Oracle Healthcare Master
Person Index to Improve Health
Data Interoperability

fbit.ly/1PH3DBV

Oracle Recognizes Marketing AllStars at the 2015 Markie Awards


fbit.ly/1JR87Xa

Avista Utilities Successfully


Replaces Legacy Customer System
with Oracle Utility Solution
fbit.ly/1cgK1rk

Orange County Utilities Reduces


Abandoned Calls by 75 Percent
fbit.ly/1cUzT8T

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Oracle has extended Oracle Marketing


Cloud with three new innovations: Oracle
ID Graph, the rapid retargeter feature, and
a new set of application programming
interfaces. The updates give marketers a
more holistic view of their customers and
help them adapt to relevant, real-time
interactions across
channels.
Todays marketers
are struggling to
orchestrate effective, real-time customer experiences

Utilities. It supports vital distribution


automation to the substation and distributed generation management thanks
to a scalable, real-time data model and
optimization engine. These capabilities
are built on one of the worlds best outage
management systems, as demonstrated
during Superstorm Sandy, making Oracle
Utilities Network Management System the
best solution for utilities that need a stormproven, scalable ADMS platform that also
manages distributed energy resources.
bit.ly/1CBNFDJ

due to difficulties connecting behaviors to


individual customers, limited visibility of
real-time customer interactions, and IT integration issues, says John Stetic, group vice
president of product development for Oracle
Marketing Cloud. Oracle Marketing Cloud
addresses these challenges and transforms
the way marketers connect with customers
by delivering a comprehensive set of capabilities that bring together an advanced view of
the customer, including real-time customer
interactions, for more-relevant and moreeffective marketing campaigns.
bit.ly/1E67RfO

I-HUA CHEN

10

BRIEFS

Oracle Enhances Oracle Communications Rapid Offer Design


and Order Delivery

Oracle Retail Launches Six New


Cloud Services

Oracle recently updated its Oracle


Communications Rapid Offer Design and
Delivery solution to give communications
service providers (CSPs) an integrated
approach for design and order delivery
that quickly responds to changing business demands while keeping overhead low.
Oracle Communications Rapid Offer Design
and Order Delivery solution is composed
of several products, many of which were
recently updated.
Enhancements include functionality such
as simplified order capture and contract
lifecycle management, expanded product
catalog and pricing design capabilities, new
billing insight dashboards, and synchronization of complex account hierarchies. Process
integration packs leverage design patterns,
methodologies, and common objects and
services (as defined in Oracles application

Oracle has expanded its Oracle Retail cloud


services with six new offerings that provide
retailers with rapid access to enterprisegrade applications for managing critical
e-commerce, customer engagement, order
management, order fulfillment, loss prevention, and brand compliance operations. The
new cloud services stem from the MICROS
retail solutions acquired by Oracle in 2014.
Oracle Retail Brand Compliance
Management Cloud Service streamlines and
automates many of the operations required
to grow and improve private-label merchandising operations.
Oracle Retail Customer Engagement
Cloud Service provides a segmented view
of customers, gift registry capabilities, and
loyalty program and campaign management
tools necessary to acquire and retain customers and to increase conversion rates.
Oracle Retail Open Commerce Platform
Cloud Service delivers an all-in-one e-commerce solution that includes features such
as search engine optimization, site search,
and personalization capabilities required to
build e-commerce traffic.
Oracle Retail Order Broker Cloud Service
supplies businesses with real-time visibility
of available inventory across retail channels
and distribution centers.
Oracle Retail Order Management System
Cloud Service provides online shoppers and
call center agents with real-time visibility
into ordering and fulfillment, enabling them
to verify inventory availability before an order
is completed.
Oracle XBRi Loss Prevention Cloud Service
equips retailers to detect, investigate, and
reduce losses from fraud and noncompliance.
Retailers looking for agility, performance,
and cost predictability are increasingly considering the cloud, says Jill Puleri, senior
vice president and general manager, Oracle
Retail. The new Oracle Retail cloud services
solutions help eliminate the time and cost
constraints that too often hamper retailers
ability to respond to new opportunities for
growth. Just as important, Oracle Retail cloud
services solutions allow retailers to focus on
their business and work on strategic projects
that add value to the business.
bit.ly/1oVnOmp

integration architecture) to deliver prebuilt


integration accelerators that combine one or
more integration styles such as data-centric
integration, web services, reference data
query, and/or process-centric integrations
to provide open, standards-based ways
for organizations to integrate end-to-end
business processes across a broad range of
custom, Oracle, or third-party applications.
This new version of Oracle
Communications Rapid Offer Design and
Order Delivery enables CSPs to get to the
next level of productivity. It is the result of
six software product releases over the past
eight months, and we believe the expanded
process integration packs will bring exponential value and drive out even more cost and
complexity, says Liam Maxwell, vice president of products for Oracle Communications.
bit.ly/1AAM5oX

Oracle Adds New Data Integration Technologies to Enterprise Big


Data Portfolio
Oracle recently unveiled Oracle Data
Integrator Enterprise Edition Advanced
Big Data Option, part of a group of Oracle
technologies that work together to help
companies securely reach across Apache
Hadoop, NoSQL, and relational databases
to cost-effectively sift through massive and
diverse data sets.
Oracle Data Integrator Enterprise Edition
Advanced Big Data Option provides access
to an increased number of data types from
on-premises and cloud sources and helps
deliver increased performance.
This is a significant milestone for big
data tools, says Jeff Pollock, vice president

of product management at Oracle. With this


new product, Oracle has made it possible for
our customers to be big data ETL [extract,
transform, and load] developers without
having to learn Scala, Pig, or Oozie code.
Oracle is the only vendor that can automatically generate Spark, Hive, and Pig transformations from a single mapping, which allows
our customers to
focus on business
value and the overall
architecture rather
than multiple programming languages.
bit.ly/1A0tYJl

I-HUA CHEN

Oracle Extends Marketing, Web, and Commerce Solutions Integrations


Oracle recently announced the integration
of Oracle Marketing Clouds cross-channel
marketing solution with Oracle Commerce
and Oracle WebCenter Sites. The integrations enable marketers to create consistent
customer profiles and deliver cohesive, personalized experiences.
Disparate marketing systems and organizational silos make it very difficult for marketers to orchestrate engaging and personal-

ized customer experiences across channels,


says John Stetic, group vice president of
product development for Oracle Marketing
Cloud. Oracle is uniquely positioned to
address this challenge by combining leading
marketing, web experience management,
and commerce solutions. These integrations
not only help marketers increase efficiencies, but also drive revenue.
bit.ly/1E67RfO

ORACLE MAGAZINE JULY/AUGUST 2015

11

YOUR DESTINATION FOR ORACLE AND JAVA EXPERTISE FOR 20 YEARS!


Written by leading technology professionals, Oracle Press books offer the most definitive,
complete, and up-to-date coverage of Oracle products and technologies available.

Introducing JavaFX 8 Programming


Herbert Schildt
Learn how to develop dynamic
JavaFXGUI applications.
Hadoop and Oracle:
The Why, When & How Guide
Tom Plunkett, Bruce Nelson,
BrianMacdonald
Leverage Oracle Big Data Connectors
and Oracle Big Data Appliance
usingHadoop.

OCA Java SE 8
Programmer I Study Guide
(Exam 1Z0-808)
Edward Finegan, Rob Liguori
Get complete coverage of all objectives
for Exam 1Z0-808. Electronic practice
exam questions are included.
Oracle SOA Suite 12c Handbook
Lucas Jellema
Implement an agile, service-oriented
enterprise computing infrastructure.
Available September

Available in print and eBook formats.


@OraclePress Facebook OraclePress www.OraclePressBooks.com

INTERVIEW BY TOM HAUNERT

Cloud Foundation Standards

Operating system and virtualization power the data


center, the cloud, and Oracles Virtual Compute Appliance.

BOB ADLER/GETTY IMAGES

solid infrastructure is the foundation of


successful business projects and highperformance, low-cost IT. Oracle Magazine
sat down with Wim Coekaerts, senior
vice president of Linux and virtualization
engineering at Oracle, to discuss the state of
Linux, virtualization, application containers,
and general-purpose converged systems.
Oracle Magazine: How has Linux evolved in
the enterprise, and how does Linux fit in
with cloud deployments?
Wim: Years ago, early Linux adopters tested
Linux in the enterprise on systems that were
not running mission-critical and production
applications. There were questions about
reliability and scalability.
This is no longer a question or an issue.
Linux is now the de facto server operating
system on x86 hardware. Linux is also part of
OpenStack cloud platform distributions, and
it is the de facto operating system in private
and public clouds, including Oracle Cloud.
Oracle has made a significant investment in Oracle Linux, and Oracle Linux
is the distribution on which most Oracle
customers run their Oracle Database and
Oracle Applications.
Oracle Linux continues to enjoy doubledigit growth year over year. And the growth
is not just in support of Oracle Database and
Oracle Applications. Oracle Linux supports
general-purpose computing for any type of
application, in the data center and in private
and public clouds.
Oracle Magazine: Security breaches continue to make headlines. What are the security challenges facing Linux today?
Wim: A big challenge to company security
policies is the downtime required to do
server patching. With the Ksplice feature in
Oracle Linux, you can patch the Oracle Linux
kernel instantly, with no system or application downtime. Were also working to extend

Wim Coekaerts, Senior Vice President, Linux and


Virtualization Engineering, Oracle

the hot patching we do for the Oracle Linux


kernel to other critical system areas.
And when Oracle releases a patch for
Oracle Linux, you have the security of
knowing that the patch has been tested and
is running on Oracle production systems
and Oracle Cloud.
Oracle Magazine: Application containers
have become part of the virtualization conversation. How do application containers
work with virtualization?
Wim: Containers are not new. Container
technologies such as the Oracle Solaris
Zones feature in Oracle Solaris have been
around for many years.
And containers are not going to replace
virtualization. Virtualization technology and
container technology typically solve different
problems, and they can nicely complement
each other. Oracle VM, for example, doesnt
compete with Linux containers or Docker.
Docker ships with Oracle Linux. We
provide full support for Docker as part of

Oracle Linux subscriptions, and Oracle is


working to certify Docker to run with Oracle
Database and Oracle WebLogic Server.
Oracle Magazine: Oracles Virtual Compute
Appliance combines OS and virtualization
in an engineered system. What challenges
does Virtual Compute Appliance address?
Wim: Organizations are tired of spending
three months talking to 10 vendors and
then trying to install and integrate server,
networking, storage, OS, virtualization, and
applications from different vendors in one
system. And theyre even more tired when
something goes wrong and they have to call
many different vendors, who are sometimes
competitors, to fix the problem.
Virtual Compute Appliance is a converged
infrastructure hub, and it solves these problems. Oracle installs and tests the hardware
and software, so when you buy Virtual
Compute Appliance, you plug it in, and two
hours later, you can start running virtual
machines on the appliance.
Standardization is another benefit.
Running your system on a unique combination of server, networking, storage, OS, and
virtualization componentsa combination
that your vendors have not testedis a challenge. Unique combinations and configurations are not good in IT. Theyre not easy to
support. When you run your applications on
Virtual Compute Appliance, youre running on
validated configurations, and youre running
on the same software versions of Oracle Linux
and Oracle VM that power Oracle Cloud.

NEXT STEPS
LEARN more about
Oracle Linux
oracle.com/us/technologies/linux
Oracles Virtual Compute Appliance
oracle.com/servers/virtual-compute-appliance

ORACLE MAGAZINE JULY/AUGUST 2015

13

14

Book Beat
Understanding Oracle APEX 5
Application Development
By Edward Sciore
Apress
apress.com
Understanding Oracle
APEX 5 Application
Development introduces
new users of the product
to its properties and functionality, and
suggests development techniques for
creating polished web applications. Topics
covered include conditional formatting,
user-customized reports, data entry forms,
concurrency and lost updates, and updatable reports.

Big Data and the Internet of Things:


Enterprise Information Architecture
for a New Age
By Robert Stackowiak, Art
Licht, Venu Mantha, and
Louis Nagode
Apress
apress.com
Big Data and the Internet
of Things provides guidance on how to design an information
architecture to accommodate increasing
amounts of data. Learn how analytical solutions and enterprise architecture methodologies and concepts have recently evolved,
including the roles played by data warehouses, business intelligence tools, predictive analytics, data discovery, big data, and
data from the Internet of Things.

Oracle Exadata Experts Handbook


By Tariq Farooq, Charles
Kim, Nitin Vengurlekar,
Sridhar Avantsa, Guy
Harrison, and Syed Hussain
Pearson
pearson.com
Oracle Exadata Experts
Handbook brings together technical information, author experience, best practices,
and tips in a concise reference covering
Oracle Exadata 11g and Oracle Exadata 12c.
Learn how to efficiently deploy Oracle Real
Application Clusters within the Oracle
Exadata ecosystem, fully leverage Oracle
Exadatas extraordinary performance,
and use Oracle Enterprise Manager 12c to
manage Oracle Exadata. Discover how to
extend Oracle Exadatas capabilities with
strategies for tuning, backup, and recovery,
and how to use Oracle Exadata with other
Oracle products.

Look for other Oracle Books at


bit.ly/oraclebookstore.

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Two Oracle Partners Achieve Oracle Exastack Ready Status


Two Oracle partners have achieved Oracle
Exastack Ready status for their solutions,
indicating that they support their applications with Oracle Exadata Database
Machine, Oracle Exalogic Elastic Cloud,
Oracle Exalytics In-Memory Machine, Oracle
SuperCluster, Oracle Database Appliance,
Oracle Big Data Appliance,
or Oracles Virtual
Compute Appliance, and
the latest major releases of
their component products.
Axxana, an Oracle
Gold Partner, announced
that its Phoenix System
offering achieved Oracle
Exadata Ready, Oracle Big
Data Appliance Ready,
Oracle Database Ready,

and Oracle Linux Ready status. Axxanas


Phoenix System enables full disaster
recovery with no data loss over any distance,
without the need for costly replication communication lines, while achieving full consistency of applications at the remote site
and enabling the shortest recovery time.
ConSol Austria Software, an Oracle
Gold Partner, achieved Oracle Exadata
Ready, Oracle Linux Ready, Oracle Exalogic
Ready, Oracle Database Ready, and Oracle
WebLogic Ready status for its ConSol CM
solution. ConSol Austria is an IT consultant
and software development company that
provides expertise in IT service management, web technology, and customer relationship management.
axxana.com
consol-software.at

Four Partners Achieve Oracle Gold Partner Status


Four Oracle partners achieved Oracle Gold
Partner status in the Oracle PartnerNetwork.
They are eligible to qualify for specializations and to develop and sell across Oracles
entire product portfolio.
Ceres, an agricultural biotechnology
company that develops and markets seeds
to produce crops for bioenergy and other
markets that utilize plant biomass, is recognized by Oracle for its commitment to
establish Oracle-related knowledge in delivering Ceres Persephone genome visualization software and for uniquely addressing
the challenges of joint customers.
Cambridge Technology Enterprises,
an IT services provider focused on the
convergence of big data and cloud computing, is recognized for its commitment
to establishing Oracle-related knowledge
in delivering Oracle services and products
while uniquely addressing the challenges of
joint customers.

Continuity Software, a provider of IT


operations analytics solutions designed to
pinpoint and eliminate potential failures
before they impact business, is recognized
for its commitment to establish Oraclerelated knowledge in delivering solutions
that mitigate downtime and data-loss
risksincluding disaster recovery, high
availability, and cloud environments, and
for uniquely addressing the challenges of
joint customers.
Tintri, a leading producer of smart
storage for virtualization and cloud environments, is recognized for its commitment
to establish Oracle-related knowledge in
delivering application-aware storage and
for uniquely addressing the challenges of
joint customers.
ceresbiotechnology.com
ctepl.com
continuitysoftware.com
tintri.com

Datatronics Achieves Oracle PartnerNetwork Specialized Status


for Communications
Datatronics, an Oracle Gold Partner,
achieved Oracle PartnerNetwork Specialized
status for the communications industry.
Specialized status highlights the strengths
and special skills of experienced and com-

mitted Oracle partners. Datatronics is a


systems integrator and value-added reseller
to telecommunications operators and
service providers.
datatronics.es

PARTNER NEWS

Tealium Achieves Validated


Integration for Oracle Commerce

ORACLE CLOUD MARKETPLACE


Oracle Cloud Marketplace features partner
solutions that leverage Oracle Cloud
platform-as-a-service (PaaS) and Oracle
software-as-a-service (SaaS) applications.
Six Oracle partners have recently
released the following solutions
to Oracle Cloud Marketplace:
Oracle Gold Partner
Appcast.io: Appcast.io delivers
advanced programmatic online
ad buying to the human capital
management market with an ad
platform that allows employers
to promote jobs across job and
consumer sites on a cost-per-applicant
basis, offering added value to Oracle Taleo
Business Edition Cloud Service customers.
Oracle Gold Partner eSkill: eSkills
pre-employment testing application
delivers online skills testing for applicant
screening and staff training, offering added
value to Oracle Taleo Enterprise Cloud
Service customers.
Oracle Gold Partner PreCheck: PreCheck,
an employment background screening
service, focuses on healthcare industry background screening and employment qualification, serving hospitals, long-term care
facilities, clinics, educational institutions,
and other ancillary healthcare organizations
across the US and offering added value to
users of Oracle Talent Acquisition Cloud.
Oracle Gold Partner Relevate: Relevates
RelevateNOW solution enables Oracle

Service Cloud customers to utilize


Relevates real-time data services application programming interface for compliance,
verification, identification, and dataenhancement capabilities within
Oracle Service Cloud applications.
Oracle Gold Partner
TrustSphere: TrustSpheres
relationship analytics solution
provides real-time analytics and
insights that customers can use to
improve the effectiveness of key
business functions such as sales
force effectiveness and enterprise
collaboration, offering added value to
Oracle Cloud applications customers.
Oracle Gold Partner WebMerge:
WebMerges online document automation
platform enables users to automatically
merge data from the cloud into a PDF,
Word document, Excel spreadsheet, or
PowerPoint presentation in minutes,
offering added value to Oracle Sales
Cloud customers.
appcast.io
eskill.com
precheck.com
relevategroup.com
trustsphere.com
webmerge.me

Cedar Consulting Achieves Oracle PartnerNetwork Specialized Status


for Oracle Taleo Enterprise Cloud Service
Cedar Consulting, an Oracle Gold Partner
and established systems implementer, has
achieved Oracle PartnerNetwork Specialized
status for Oracle Taleo Enterprise Cloud

Service. Specialized status spotlights the


strengths and special skills of experienced
and committed Oracle partners.
cedarconsulting.co.uk

I-HUA CHEN

Partners Achieve Oracle Exastack Optimized Status


Two Oracle partners have achieved Oracle
Exastack Optimized status. The Oracle
Exastack Optimized program enables
Oracle partners to develop, test, and
tune their applications on Oracle Exadata
Database Machine, Oracle Exalogic
Elastic Cloud, Oracle Exalytics In-Memory
Machine, Oracle SuperCluster, Oracle
Database Appliance, and Oracle Big Data
Appliance engineered systems.
Business Control Solutions, an Oracle
Gold Partner, achieved the status for BCS
integrity version 3.8. Business Control

Solutions is a provider of governance, risk


management, and compliance software to
the financial services sector.
NCS Pearson, an Oracle Gold Partner,
achieved the status for PowerSchool, a webbased student information system. Pearson
creates student information systems
designed to enable schools and districts
to use technology to open up lines of communication and simplify internal processes,
such as scheduling and grading.
bcsplc.com
pearsonncs.com

Oracle Gold Partner Tealium achieved


Oracle Validated Integration of the Tealium
iQ tag management system with Oracle
Commerce. Oracle Validated Integration
demonstrates that Telium iQ is designed
in a reliable, standardized way, has been
tested as functionally sound, and operates
and performs as documented.
tealium.com

Delivery Centric Achieves


Platinum Partner Status
Delivery Centric, a provider of consulting services and software solutions, announced that
it has achieved Oracle Platinum Partner status
in the Oracle PartnerNetwork. Delivery Centric
has established knowledge across multiple
Oracle solution areas, including Oracle
Fusion Middleware, Oracle Applications, and
Oracle Database. With this achievement,
Oracle recognizes Delivery Centric for its
expertise and excellence in delivering Oracle
Identity Management and Oracle Customer
Experience solutions, and for its way of
addressing the challenges of joint customers.
Oracle partners can attain Oracle Platinum
Partner status when they have achieved a
minimum of five Oracle product specializations, Oracle Exastack Ready applications, or
Oracle Validated Integrations.
deliverycentric.com

Project Partners Announces New


Oracle Accelerate for Midsize
Companies Solutions
Project Partners, an Oracle Gold Partner
specializing in optimizing business process
management and IT investments for
project-driven organizations, announced
the availability of its Oracle Accelerate
Solution for IT Portfolio Management
with Oracles Instantis EnterpriseTrack.
Oracle Accelerate for Midsize Companies
solutions deliver
simple-todeploy, packaged,
enterprise-class
software to midsize
companies.
projectp.com

ORACLE MAGAZINE JULY/AUGUST 2015

15

16

Community Bulletin

BY ROLAND
SMART
News, People,
Happenings
in and
Oracle
Happenings
Technology
in the
Network
Oracle Technology
Network

Technologists: Start
Your Nominations

Connect
with Oracle
Engineers:
Visit My Oracle
Support Blogs

JOIN THE DATA


SCIENCE BOOTCAMP
Interested in strengthening your knowledge of data science
fundamentals? Oracle Academy and Oracle Senior Principal
Product Manager Dan McClary, PhD, and Oracle Product
Manager Althea Wallop have released an 18-part Data
Science Bootcamp (bit.ly/data-science-bootcamp), complete with video trainings, sample code, and original exercises for the beginner and seasoned data pro alike.
Topics include big data manipulation, processing complex
delimited data, and best practices for employing JavaScript
Object Notation (JSON) schemas. The course uses publicly
available data sets in order to teach core skills involving data
ingestion, quality, analysis, and visualization.
Watch the video lessons and download the supporting
materials at bit.ly/data-science-bootcamp.

Powered by community
.oracle.com, My Oracle
Support Blogs allow you
to hear directly from
Oracle Support engineers. Discover their
latest insights on a wide
range of Oracle products,
platforms, and technologies, including Oracle
Enterprise Manager 12c,
Oracle WebCenter, and
Oracle Taleo Enterprise
Cloud Service. And keep
track of the most-recent
product releases, documentation, and service
announcements with the
Support Blogs portal.
Subscribe to regular
e-mail notifications
or receive a weekly or
twice-weekly digest of
the blog contributions
relevant to your area of
technical expertise.
Find the My Oracle
Support Blogs at bit.ly/
mosc-support-blogs.

The Oracle Database Developer


Choice Awards recognize technical expertise and contributions in
the worldwide Oracle Database
community. Nominations for the
2015 Oracle Database Developer
Choice Awards are open to
you, the community, through
August 15, 2015.
And who chooses the
winners? You do. The worldwide Oracle technologist community votes on the finalists
from September 15 through
October 15, 2015. Winners will
be announced at the YesSQL!
event at Oracle OpenWorld 2015
in San Francisco, California.
Read the Oracle Database
Developer Choice Awards rules,
check out the FAQ, and nominateearly and oftenat bit.ly/
database-dev-choice.

FEATURED DOWNLOAD:

Oracle SQL
Developer 4.1

Oracle SQL Developer 4.1


provides a host of new tools
for designing, developing,
and deploying applications on
premises or in Oracle Database
Cloud Service. Database administrators will find a new, robust
reporting interface, enabling
them to track the latest metrics
on I/O, networking, wait times,
storage, and more.
Oracle SQL Developer 4.1 is
a free download. Get the latest
release and find how-to videos
and tutorials at bit.ly/sqldeveloper-4p1.

Learn the Latest in Oracle Database 12


12c Security
from where, when, and how. The guide also presents
a checklist of security items, centered on what the
writers call the evolving four As: authentication,
authorization, access, and auditing.
Read the first chapter for free and buy the book
(paperback and e-book versions are available) at
bit.ly/oracle-database-security-book.

I-HUA CHEN

Oracle Database 12c Security (Oracle Press, 2015),


written by experts from Oracles National Security
Group, is a comprehensive primer on building and
managing secure Oracle Database systems in a multitenant architecture.
The authors explain practical strategies for enterprise security, based on who gets access to what,

Roland Smart is vice president of social and community marketing at Oracle.


JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

JA15_Community_R1.indd 16

7/27/15 3:32 PM

ARCHITECT BY BOB RHUBART

Taming Change

Meeting the challenge of an ever-changing software


development landscape

or more than two generations, IT has


driven significant changes across the
spectrum of things human beings do to earn
a living. Adjusting to those changes is a fact
of life for anyone who draws a paycheck, or
plans to do so in the future.
Architects and developers enjoy no
immunity from that process. Indeed, they
face a unique challenge in staying ahead of
each wave of inevitable change that crashes
onto the software development landscape.
In order to get a sense of how Oracle
Technology Network architect community
members meet that challenge, I started
a discussion forum and asked people to
describe how their work has changed over
the past 12 months, how they have adjusted
to that change, and how their work might
change in the near future. This article draws
on responses to those questions.
There are always new technologies
popping up in IT, says Oracle ACE Director
Frank Munz, a middleware and cloud computing specialist. Some vanish quietly.
Others survive. Thats IT, Munz explains.
My trick is to explore technologies early and
then decide for myself if theyre just more
marketing, or worth evangelizing.
For Munz, one noteworthy innovation
is Docker, an open platform for building,
shipping, and running distributed applications. While Docker drew modest attention
in 2014, today everybody is crazy about it,
says Munz. One of his Oracle OpenWorld
2014 presentations discussed the possibility
of running Oracle WebLogic on Docker. In
March 2015, Oracle officially certified Oracle
WebLogic to run on Docker. That is really
cool, says Munz. Docker will figure in his
near future, as will microservices, DevOps,
platform as a service (PaaS), and big data.
Big data has been the catalyst for change
for Oracle ACE Michael Rainey, a business
intelligence specialist and principal consulCONNECT:

blogs.oracle.com/archbeat

Every new
technology requires
a considerable
amount of time.
Antonis Antoniou, Oracle ACE Associate

tant with Rittman Mead Consulting. Rainey


regularly works with and writes about Oracle
Data Integrator and Oracle GoldenGate. The
push on the data integration side of things
is around big data, as a source, target, and
everything in between.
Adjusting to that change has been challenging for Rainey. There are so many big
data technologies. It can be difficult to
determine a clear place to start. With many
companies still struggling with what would
be considered standard data integration and
reporting, much of my focus has still been
on building out a traditional data warehouse
using relational databases, flat files, and
batch processing. But some traditions have
limited shelf lives.
I expect the integration of big data
sources with standard relational data to
continue to grow, Rainey says. The key will
be to understand the scope of the work and
determine the best technologies to use, and
how to architect the solution.
For Oracle ACE Associate Antonis
Antoniou, technical director at eProseed
and a member of that companys global
CTO office, change over the past 12 months
was driven by his opportunity to work with
new Oracle Fusion Middleware products.
The most appealing were the new release
of Oracle Business Process Management
[Oracle BPM] with its Adaptive Case
Management offering, the latest Oracle
SOA Suite, and the new Oracle Mobile
Application Framework. Antoniou was

facebook.com/brhubart

twitter.com/brhubart

also involved in beta-testing Oracles new


Oracle Process Cloud Service and Oracle
Integration Cloud Service.
But change is change, and the transition
from old to new requires effort. Every new
technology requires a considerable amount
of time to read about and actually try the
new product and features in specific use
cases, says Antoniou. Only then will you
have a solid view of it.
Over the next several months Antoniou
will continue to sharpen his focus on the
new Oracle BPM, Oracle SOA Suite, and
Oracle Mobile Application Framework
releases, as well as on Oracles new
PaaS offerings.
The insights presented here represent
a sampling of the experience of the architects and developers who participated in
the ongoing discussion. How has your work
changed? How is it continuing to change?
How are you dealing with that change? Share
your thoughts at bit.ly/1IjBwIX.

Bob Rhubart
(bob.rhubart@oracle.com)
is manager of the
architect community
on Oracle Technology
Network, the host of the
Oracle Technology Network ArchBeat podcast
series, and the author of the ArchBeat blog.

NEXT STEPS
LISTEN to these ArchBeat podcast series
Microservices Roundtable
bit.ly/1DydXFj
Docker and Virtualization
bit.ly/1HOBXu1
The Case for Adaptive Case Management
bit.ly/1EEnfUH
Oracle Data Integrator and the Evolution of
Data Integration
bit.ly/1uAuzvd

linkedin.com/in/bobrhubart
ORACLE MAGAZINE JULY/AUGUST 2015

17

Convert to Digital!

Act now to convert to digital and continue to receive your


Oracle Magazine subscription and
Get the latest issue early
Share your favorite content
Bookmark your favorite articles
Get exclusive video and content

We hope you enjoy the digital magazine and will elect to


continue your free subscription!
Sign up for digital today!
Go to bit.ly/omagdigital
Copyright 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.

PEER-TO-PEER BY BLAIR CAMPBELL

Improv 101

Three peers on brainstorming without judging, failing, and swapping techno for tech

EDELWEISS KAMMERMANN

Company: Rittman Mead, a technology firm


focused on Oracle business intelligence solutions
Job title/description: Training materials
specialist, developing new material and delivering
training
Location: Montevideo, Uruguay
Length of time using Oracle products:
19 years
How did you get started in IT? My dad
bought me a TRS-80 computer when I
was 14 years old. I started programming
simple things in BASIC and liked it so much
that I decided on computer engineering as
a profession.
Whats your favorite technique on the job?
After the initial research phase of a project,
I take note of all the ideas that come into
my mind without judging themsort of
like brainstorming with myself. I think my
background studying musical improvisation
has a lot to do with this approach. When I had
to create arrangements, Id play a song on
CD and do improvisations on my transverse
flute over the songwithout searching for
a specific sound. Id record this process and
then listen to the recordings to discover what
worked best. With tech projects, something
similar happens. After brainstorming, I
analyze my ideas to determine which ones
have real value for the project.
Which new features in Oracle Fusion
Middleware are you currently finding most
valuable? The thing that I like most is the
seamless integration between the tools
that belong to the stack and the centralized
management and security configuration.

KEVIN MCGINLEY

Company: Red Pill Analytics, an analytics


products and services company
Job title/description: Owner and cofounder,
running the organization and delivering value to
customers through analytics
Location: Minneapolis, Minnesota
Length of time using Oracle products:
10 years
Which new Oracle technologies are you
currently finding most valuable? Oracle
Business Intelligence Cloud Service has the
opportunity to really transform how people
think of business intelligence and analytics,
both from a time-to-delivery and a data
architecture perspective.
What advice do you have about how to get
into web and application development? Build
something and failyoull learn so much
in the process. Early in my Oracle Business
Intelligence career, I tried implementing
the new-at-the-time write-back capability
in Siebel Analytics. The requirements were
ambitious, and I continually hit brick wall
after brick wallnot because the feature
didnt work, but because there wasnt much
information available on how to make it
work. That trial by fire taught me how to push
the feature to its limits and the value of truly
applying myself to a challenge.
How are you using mobile computing in
your work these days? As a complement to
regular computing. I liken mobile computing
to transactional reportingits most useful
for whatever I need to know right now. My
traditional computer is still that big monster
that processes everything.

KLAAS-JAN JONGSMA

Company: VX Company, an IT service provider


focused on developing enterprise infrastructures
and applications
Job title/description: IT architect/engineer,
helping customers get the best out of their
Oracle solutions
Location: Almelo, the Netherlands
Oracle credentials: Oracle Certified
Professional (Oracle Database 10g), Oracle
Certified Expert (Oracle Real Application
Clusters), and Oracle Exadata Certified
Implementation Specialist, with 20 years of
experience using Oracle products
Name one unique way Oracle technologies
are currently in use at your company. Im
working on our Oracle Exadata Database
Machine to set up a proof of concept with
our internally developed Oracle Application
Express application for academic DNA
research. Our software leverages all the Oracle
Exadata features, such as Hybrid Columnar
Compression, to speed up DNA analysis.
Whats your go-to Oracle reference book?
Optimizing Oracle Performance [OReilly
Media, 2003], by Cary Millsap and Jeff Holt,
is the book that has made Oracle Database
performance a snap for me.
Whats your favorite thing to do that doesnt
involve work? I have a passion for electronic
music. Back in the day, I used to record a lot of
Detroit techno records, and I played at parties
all over the world. I still love that type of
music, but my sound has evolvednowadays
its way less dance-music oriented and more
of an abstract nature. Ive also swapped
performing on stage at clubs or parties for
presenting at Oracle conferences.

Learn more about the Oracle ACE program at oracle.com/technetwork/community/oracle-ace.


ORACLE MAGAZINE JULY/AUGUST 2015

19

21

BY JOHN SOAT

Infrastructure as a Service | Platform as a Service

THE CLOUD
MADE WHOLE
Oracle completes its cloud platform.

I-HUA CHEN

uilding on its momentum in applications, platform, and


infrastructure cloud services, Oracle is completing the worlds
most comprehensive enterprise cloud portfolio with the
announcement of 24 new standards-based platform and
infrastructure services. The services demonstrate the companys cloud
expertise in application development, data management, business analytics,
integration, mobile, and infrastructure. Were now prepared to call our
platform and our infrastructure services complete, Oracle Executive
Chairman and CTO Larry Ellison told an enthusiastic audience of customers,
partners, analysts, and reporters at the companys headquarters on
June 22, 2015.
Ellison emphasized several times during his presentation that Oracles
cloud technology is the same exact technology it sells for on-premises use.
Thats important as companies navigate the intersection of internal data
center computing and external cloud resources, a hybrid architecture that
Ellison called the coming decade of coexistence between on-premises data
processing and cloud data processing.

ORACLE MAGAZINE JULY/AUGUST 2015

22

The latest services let organizations


move all of their applicationsnot just
Oracle applicationsfrom the data
center to the cloud and back again.
One of our strategies is to offer the
same technology on premises and
in the cloud so you can easily move
itmove your applications and your
data back and forth with a push of a
button, he explained.

Oracles own developers usethe


services automatically incorporate the
features most users look for today in
their applications. They have a simple,
modern user interface, Ellison said,
adding, The applications are mobile,
the applications are socialbecause
they inherit those characteristics from
the underlying platform.

ELASTIC AND DEDICATED


NEW, INTEGRATED, AND SOCIAL
Demonstrating its commitment to
Most of the new cloud services are
infrastructure as a service (IaaS),
platform-as-a-service (PaaS) offerings
Oracle introduced new IaaS cloud
under Oracle Cloud Platform. Ellison
services that provide both low-cost
called PaaS an incredibly important
and high-performance compute
business for us. In terms of applicaresources, networking, and storage.
tion development, for example, Oracle
Customers can subscribe to
now offers, in addition to Java EE,
compute resources in Oracle Cloud
cloud services for Java SE, JRuby, and
in server racks and virtual machines
Larry Ellison, Executive Chairman and CTO, Oracle
Node.js. Oracle Mobile Cloud Service
that are both elastic and dedicated,
is a new back-end engine that enables
meaning they can be expanded easily
multifeature, multiplatform application development and mobile
and are exclusive to the subscriber. Our Dedicated Compute Service
user management. The company is also making its browsergives you predictable performance in the cloud, Ellison said. Also,
oriented, user-friendly application builder development tool availthose dedicated compute resources will run any workload, Oracleable as a cloud service. Oracle Application Builder Cloud Service
based or not. Ill emphasizeany application, he said.
supports the easy extension of Oracle software-as-a-service (SaaS)
Oracle also introduced two new storage services. Oracle File
offerings through a simple drag-and-drop UI.
Storage Cloud Service lets customers store data in Oracle Cloud and
In recent years Oracle has supported its customers big data
access it from on-premises systems using the familiar NFSv4 network
projects with on-premises big data technology, and it is now
protocol. Oracle Archive Storage Cloud Service stores data on a longmaking those offerings available in its cloud. Oracle Big Data Cloud
term basisat a lower cost than competing servicesand is proService employs the Cloudera distribution of Apache Hadoop 2,
tected by encryption, mirroring, and geographical distributions.
Apache Spark, and Oracle NoSQL for processing semistructured and
A significant addition to the Oracle Cloud, one that straddles
unstructured sets of data.
the line between infrastructure and platform services, is the final
New business analytics services help make big data repositoelement in the companys line of database-as-a-service offerries more productive. Oracle Big Data Preparation Cloud Service
ings: Oracle Database Cloud Exadata Service. The Oracle Exadata
enables preprocessing of structured, semistructured, and unstrucDatabase Machine is Oracles highest-performing database
tured data. Oracle Big Data Discovery Cloud Service supports the
engineered system, a highly tuned, tightly integrated bundle of
building and sharing of Hadoop data sets. Oracle Data Visualization
customized hardware and fully featured database software. Oracle
Cloud Service lets business users quickly analyze data in flat files
Database Cloud Exadata Service makes that high-performance
or spreadsheets, employing only a web browser. Oracle Internet of
database capability available in an elastic, cost-effective manner.
Things Cloud Service supports data harvesting from any device
from sensors to gateways.
COMMITTED TO STANDARDS
An important set of new cloud services addresses the importance Oracle Cloud is stable, reliable, and secure, Ellison asserted, curof collaboration and integration in cloud and hybrid IT structures.
rently processing 33 billion transactions a day. And all of Oracles
Oracle Process Cloud Service lets business analysts automate
cloud offerings demonstrate that the companys commitment to
workflows and manage business processes in the cloud. Oracle
industry standards is deep and wide, a point Ellison reiterated in
Integration Cloud Service provides a simple interface for defining
his presentation. Everything we do in all three layers of the cloud is
integrations between on-premises and cloud applications and
based on standards, he said.
moving data between them in real time.
Ellison pointed to different competitors in IaaS, PaaS, and SaaS,
Also, its worth noting that when a developer uses Oracles cloud
and he made it clear that Oracle, unlike its competitors, is a fullapplication development platform servicesthe same set of services service cloud provider, with offerings in all three cloud layers. The

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

CHARLOTTE FIORITO/COMPASSPHOTOGRAPHERS.COM

We now have a complete


suite of services for
building applications
in cloud.

23

company already has outpaced its competitors in SaaS, he pointed


out. We have more applications than any other cloud services provider by a wide margin, he said. The introduction of more than 24
new cloud platform and infrastructure services validates Oracles
full-service, multilayer cloud strategy. With todays announcement, he said, we now have a complete suite of services for
building applications in cloud.
Ellison was particularly bullish on the companys PaaS lineup. It
will probably be our most important business, he said. In fact, it
will be our most important business going forward.

NEXT STEPS
LEARN more about
Oracle Cloud Platform
oracle.com/cloud/paas.html
bit.ly/paascomp
Oracle Database Cloud Exadata Service
oracle.com/us/corporate/features/exadata-service
WATCH the Oracle Cloud Platform 2015 launch event
videos on demand
oracle.com/us/corporate/events/cloud-platform

Same Code,
Same Standards,
Same Architecture
F
CHARLOTTE FIORITO/COMPASSPHOTOGRAPHERS.COM

Technical deep dives demonstrate proven cloud technology.


ollowing the opening presentation by Oracle Executive
Chairman and CTO Larry Ellison, Thomas Kurian, president
of product development at Oracle, drilled down into the
details of many of the more than 24 cloud services the
company introduced. With the help of Oracle colleagues, Kurian
demonstrated the features of several significant services.
Kurian first talked about infrastructure as a service (IaaS)
specifically storage, compute, and networking. He then demonstrated how to deploy the open source Linux, Apache, MySQL, Perl/
Python/PHP (LAMP) stack on Oracle Cloud dedicated compute
resources, how to hook the LAMP stack to NFS, and how to archive
log files in the Oracle Archive Storage Cloud Service.
Kurian also talked about the new Oracle Database Cloud Exadata
Service. The Oracle Exadata Database Machine is Oracles highestperforming database engineered system, and Oracle Database
Cloud Exadata Service is the best infrastructure platform to run the
Oracle database, he said.
Kurian demonstrated how to use Oracle Database Cloud Exadata
Service and the familiar interface of Oracle Enterprise Manager for
Oracle Cloud Platform to quickly create an HR database running on
a 28-core, two-node Oracle Real Application Clusters (Oracle RAC)
cluster. If youre a DBA who knows how to administer Oracle on

Inderjeet Singh, Oracle executive vice president of Oracle Fusion Middleware,


and Thomas Kurian, president of product development at Oracle, are all smiles
while demonstrating Oracle Mobile Cloud Service, which lets developers build
applications that run on any platform.

ORACLE MAGAZINE JULY/AUGUST 2015

24

If youre a DBA who


knows how to administer
Oracle on premises, you
get the same interface in
the cloud.

premises, you get the same interface


Inderjeet Singh, Oracle execuin the cloud, Kurian said.
tive vice president of Oracle Fusion
He went on to describe new Oracle
Middleware, walked Kurian through
platform-as-a-service (PaaS) offerthe steps for using Oracle Mobile
ings that include different kinds of
Cloud Service to build a crossdata management infrastructure,
platform, social-enabled, event-aware
including big data open source techmobile application.
nologies such as Apache Hadoop and
Finally, Kurian said, Larry talked
Apache Spark.
about the fact that customers will conThomas Kurian, President of Product Development, Oracle
Why are we offering a variety
tinue to have a mixture of cloud-based
of different types of infrastructure
systems and on-premises systems.
and data management? Kurian
We give you a variety of tools to hook
asked. Its because our customers have a variety of different kinds
these up. Those tools include Oracle Integration Cloud Service,
of applications.
Oracle Process Cloud Service, Oracle SOA Cloud Service, and Oracle
Kurian described Oracle PaaS offerings that support a variety
Identity Manager Management Cloud Service.
of different application development styles in the cloud, including
The fact that Oracles cloud services and on-premises systems
Ruby, Node, and plain old Java objects (POJOs). A very important
are based on the same code, same standards, same architecture is
new application development offering is Oracle Mobile Cloud
key to helping customers leverage that mixture, Kurian said. The
Service, which allows developers to build applications that run on
same person on premises, he said, can now use their skill set in
any platform, he said.
Oracle Cloud.

Polar Bears International


is a trusted voice focused
on funding scientific research
for the survival of this
magnificent animal.
Polar Bears International
also funds educational
programs that are inspiring
people to reduce their
carbon emissions.
Conservation through Research and Education

www.polarbearsinternational.org

Help Us Help the Polar Bear


Photo R&C BuChanan

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

25

Oracle Cloud in Practice

Customer panel shares vision and experience with


Oracle Cloud Platform.

Left to right: Steve Daheb, Senior Vice President of Oracles PaaS, Business Intelligence, and Enterprise Performance Management Business Groups; Fari Ebrahimi,
Senior Vice President and Global Chief Information Officer, Avaya; Rajeev Sethi, Senior Director of IT Applications, JDS Uniphase; Michael Kuban, Director of
Enterprise Solutions Delivery, Pharmavite; Mark Willford, Senior Managing Director, Accenture

CHARLOTTE FIORITO/COMPASSPHOTOGRAPHERS.COM

everal customers and partners shared their experiences


with Oracles new cloud services before the main stage
launch event and during a panel session that concluded
the event.
Fari Ebrahimi, senior vice president and global CIO at Avaya,
discussed the communications companys ambitious strategy to
use Oracle Java Cloud Service and Oracle Integration Cloud Service
to help connect all the pieces of the business, from quotes and
sales to orders, provisioning, and engagement. Avaya will get there,
Ebrahimi said, by integrating its customer relationship, marketing,
sales, and social relationship applications, some on premises,
some on cloud.
Michael Kuban, director of enterprise solutions delivery at
Pharmavite, talked about the supplement companys use of Oracle
Process Cloud Service, part of its strategy to reduce operations
costs, speed innovation, and more closely align IT and business
processes. Five years ago IT was the order taker, Kuban said. We
really want to move that to the business enabler. Oracle Process
Cloud [Service] is really going to help us do that.

Rajeev Sethi, senior director of IT applications at JDS Uniphase,


discussed the role of Oracle Enterprise Manager for Oracle Cloud
Platform in the companys imminent split into two separate organizationsin terms of copying and standing up important applications quickly, as well as automating mundane IT tasks. It definitely
helps us to reduce or redeploy those labors or the skills into other
areas, which is critical for our business to grow, Sethi said.
Mark Willford, senior managing director at Accenture, discussed
the companys partnership with Oracle, called the Accenture Oracle
Business Group, to aid customers rapid migration to the cloud.
Oracle Cloud Platform provides the agility and the flexibility to get
companies onto the cloud quickly but also then build and connect
the applications in their enterprises, Willford said.
The panel discussion was moderated by Steve Daheb, senior vice
president of Oracles PaaS, business intelligence, and enterprise
performance management business groups.

John Soat is a freelance writer and multimedia producer specializing in


the intersection of business and technology.

ORACLE MAGAZINE JULY/AUGUST 2015

26

A Better Sense of Direction


Customers count on Oracle Cloud Platform to simplify IT.
BY DAVID BAUM

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

ERIC FRANCIS/GETTY IMAGES

urdell and Partners, a


marketing and advertising
agency that offers data
analysis services to its
clients, was originally part of a
much larger ad agency. An onsite
team at the firm, founded in
2005, previously used Java to
build applications for clients and
Oracle Database 10g to store
client data. We kept everything
on premises, in our data
center, says Adam Kanzmeier,
Surdell and Partners director
of customer intelligence and
strategic consulting.
The company that Surdell and
Partners split from in 2005 had
about 500 employees, and the
new company started with about
30. We suddenly had a lot more
control over the things we wanted
to do, Kanzmeier recalls, but we
had to figure out how to do those
things with a lot fewer resources.
And that meant streamlining
processes and costs. Instead of
Beyond the operational benefits of moving the IT infrastructure off premises, Surdell and Partners is seeing indirect
benefits. We get instant credibility when we tell clients that our solutions are based on Oracle Cloud, says Adam
developing everything in Java,
Kanzmeier, director of customer intelligence and strategic consulting at Surdell and Partners.
the team at Surdell and Partners
started using Oracle Application
Express, a web-based software development environment that runs software-as-a-service (SaaS) apps and databases it used for data
in Oracle Database. And after several years of hosting in house the
analysis, the firm decided to move them into Oracle Cloud.
We took a good look at the available solutions, Kanzmeier says.
Oracle was still the right choice, but we wanted to find a better way
to develop and deploy apps quickly. IT infrastructure and hosting are
SNAPSHOT
not our core competencies. We would prefer to let somebody else
Surdell and Partners
handle that for us.
surdellpartners.com
For independent software vendors and SaaS providers such as
Headquarters: Omaha, Nebraska
Industry: Advertising
Surdell and Partners that choose to develop and host their solutions
Employees: 30
in Oracle Cloud, the savings realized are multiplied by the number
Oracle products and services: Oracle Database Cloud Service,
of clients that use their solutions. Surdell and Partners handles
Oracle SQL Developer, Oracle Application Express
advertising and marketing programs for large retailers and other

27

TASNEEM ALSULTAN/GETTY IMAGES

The cloud is really about


doing what we have always
been doing, but doing it better,
more professionally, and faster
than we ever could before.

types of business-to-consumer
retail promotions every night,
companies in the United States
and then makes the results availand internationally. It does all the
able through a shared marketing
things a full-service ad agency
calendar that tracks retail offers
does: create ads, run marketing
and promotions.
campaigns, and track results.
The cloud is really about
But what differentiates the
doing what we have always been
firm is its comprehensive use of
doing, but doing it better, more
market intelligence.
professionally, and faster than
Adam Kanzmeier, Director of Customer Intelligence and
Strategic Consulting, Surdell and Partners
We gather lots of data from
we ever could before, Kanzmeier
our clients to figure out which
says. Retailers want to know
offers actually work, Kanzmeier
immediately how their camsays. This entails SaaS solutions for managing spending, campaigns are working. We look at their projections for each ad and then
paigns, and promotions. We analyze marketing data to figure out
we match the projections with actual sales to see how well each ad
how we can do what we do a lot better.
is doing. Each client now has a portal, which is basically a window
into our Oracle Database, which we built as an Oracle Application
MIGRATE TO THE CLOUD
Express interface.
Cloud computing is now broadly accepted as an economical way for
companies to share a pool of computing resources. Some 87 percent USING FAMILIAR TOOLS
of the businesses that participated in a recent Computerworld study
Surdell and Partners found the migration to Oracle Database Cloud
said they look to cloud initiatives to lower capital expenses, and
Service to be relatively straightforward. The firm used Oracle SQL
84 percent of them do so to reduce operational expenses. Many of
Developer and Oracle Application Express to move its data and busithese companies are moving key workloads to public clouds to take
ness processes to Oracle Cloud. At press time, the firm had already
advantage of rapid implementation options, dynamic scalability,
migrated one key application and was in the process of migrating all
and subscription-based pricing models.
its production applications to Oracle Cloud, Kanzmeier says.
Cloud computing is about getting there quickly, says Dom
In addition to the simplicity that comes with moving IT infraLindars, a cloud architect at Oracle. Its about allowing IT teams
structure off premises, his team has seen indirect benefits. We
to focus on strategic activities rather than
having to deal with database administration
or application maintenance. Most teams
save a lot of money by automating or eliminating these administrative tasks.
The Oracle Cloud platform makes
Oracles proven database and middleware
technologies available in an on-demand,
subscription-based, fully managed environment. Customers are assured full portability of applications and data between on
premises and cloud environments, with the
flexibility to change their hosting arrangements at any time.
For example, Surdell and Partners is
adopting Oracle Database 12c and its Oracle
Multitenant option, which enables their
Oracle database to function as a multitenant container database, with separate
pluggable databases for each client. A
single multitenant container database can
host and manage hundreds of pluggable
databasesa major step forward in cost
and convenience. That setup works well for
the firms SaaS solution, which processes
Zamil Industrial has seen the benefits of more than 15 systems and environments in the cloud. No company
can ignore the cloud anymore. Its not an option. Its a direction, says CIO Zaki Sabbagh.
and aggregates reams of client data about

ORACLE MAGAZINE JULY/AUGUST 2015

28

get instant credibility when we tell clients


that impact more than two business units
SNAPSHOT
that our solutions are based on Oracle
are handled at the corporate level.
Cloud, Kanzmeier says. That takes a lot of
After implementing one on-premises
Zamil Industrial Investment Company
the anxiety out of their purchase decision.
Oracle enterprise resource planning (ERP)
zamilindustrial.com
Headquarters: Dammam, Saudi Arabia
From a security perspective, from a cominstance across 13 global business units,
Industry: Engineering and construction
pliance perspective, and from a networkSabbagh turned his attention to moving
Employees: More than 10,000
testing perspective, knowing that it is all
business applications and data to the cloud.
Revenue: US$1.46 billion in 2014
based on Oracle technology allows us to
He used Oracle Java Cloud Service to create
Oracle products and services: Oracle
sidestep technical issues that tend to drag
an application for sharing engineering docuDatabase Cloud Service, Oracle Java Cloud
Service, cloud support services
down SaaS negotiations. It speeds up the
ments and an information system for manprocess of getting new solutions in place.
aging engineering projects.
The cloud makes these decisions easier
We started in 2013 with a five-year plan
for corporate finance teams as well. Instead of approving large
to move everything to the cloud except our ERP system, he says.
capital expenditures for computer hardware and other infrastrucAs of now, we have more than 15 systems and environments
ture, they simply remit a monthly fee based on Oracles subscripOracle and non-Oraclein the cloud. It was a very quick win for us.
tion model. Retailers can scale the service up or down on demand,
The savings have been excellent in terms of administration, backup,
so they no longer have to worry about paying for extra capacity
and systems management. We no longer need to license so much
that might get used only during busy periods, such as the holiday
hardware and software, let alone bother with installing, patching,
shopping season.
and configuring.
These financial benefits are compelling, but Kanzmeier says he
mainly likes the cloud because it lets his team be more nimble. We
MORE DATA AND BETTER APPSFAST
can provide reliable, sustainable solutions in a very short amount of
Oracle Java Cloud Service is a central component of Zamil
time, giving clients the capacity they need for value-added activiIndustrials cloud infrastructure. The service makes it easy for
ties, he says. Thats a big deal for themand for us, too, since it is
workers at 13 different sites globally to exchange insights and
what we stand for as a brand.
share files.
For example, Zamil Steel, a subsidiary of Zamil Industrial,
ALL IN THE (CLOUD) FAMILY
has engineering teams in Saudi Arabia, Egypt, the United Arab
Oracle Database Cloud Service integrates with other Oracle platEmirates, India, and Vietnam. Previously, they used FTP to upload
form-as-a-service solutions, such as Oracle Java Cloud Service, to
and download documents, with nominal communications and
deploy applications in the cloud; Oracle Documents Cloud Service,
haphazard version control. Now they use a simple Java applicato create content-rich processes; and Oracle Business Intelligence
tion to exchange their engineering documents. Files can be edited
Cloud Service, to create analytic applications.
on premises and automatically backed up to the cloud. Zamil
Oracle Java Cloud Service capabilities include a full-featured
Industrial also purchased 20 TB of Oracle Cloud storage as a
Oracle WebLogic Server 12c or Oracle WebLogic Server 11g instance backup system.
that integrates with Oracle Database and Oracle Real Application
For each site, we migrated Oracle Database to Oracle Database
Clusters. Optional capabilities include clustering of application
Cloud Service with the help of Oracle SQL Developer, Sabbagh
server instances, clustering of databases, in-memory database
says. We did not need to modify anything in our databases in order
functionality, high availability, elastic load balancing, and fully
to migrate to the cloud. We then migrated our web services from
managed services for backup, restore, patching, scaling, and
Oracle WebLogic Server to Oracle Java Cloud Service and had the
server management.
same advantageno need to apply changes to the existing code.
This integrated family of cloud services makes perfect sense for
Zamil Industrial plans to use Oracle Documents Cloud Service to
a large, dispersed organization such as Zamil Industrial Investment
make it even easier for employees to store and exchange their docuCompany, a global building and construction conglomerate with
ments in the cloud. Sabbagh says this cloud service will give them
facilities in 55 countries. Zamil Industrial develops products ranging one global repository, with high security and automated backups.
from transmission towers to climate control systems. The company
The company also plans to use Oracle Mobile Cloud Service and
has major IT divisions in Saudi Arabia and India.
Oracle Business Intelligence Cloud Service to generate analytical
We want to establish one IT model for our entire business
reports for display on handheld devices.
and consolidate IT investments as much as possible, says Zamil
No company can ignore the cloud anymore, Sabbagh says. Its
Industrial CIO Zaki Sabbagh. To fulfill this goal, the company signed
not an option. Its a direction.
up for Oracle Database Cloud Service. Now its document management data resides in the cloud. We have consolidated all document management data into one instance, he says. In addition,
David Baum is a freelance writer who specializes in the intersection of
science, technology, and culture.
all network projects, e-mail, supplier managementany initiatives

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

TOGETHER ORACLE AND


NATIONAL GEOGRAPHIC EDUCATION ARE

Leading the Way


in Ocean Education
and Marine Research

National Geographic Education supports the


mission of the National Geographic Society to
inspire people to care about the planet by
creating compelling educational materials for
young people and the adults who teach them.
NG Education provides unique learning
experiences to educators and advocates for
improved education in geography, the
environmental sciences, and other disciplines
that are critical to understanding our world.
With support from Oracle, National Geographic
Education is engaged in a major project to
develop teacher leaders in marine ecology and
create materials about ocean science and
geography for students, families, the ocean
recreation community, and the general public.

Support our work today.


Visit nationalgeographic.org/education.

National Geographic is a 501(c)(3) organization. PHOTOGRAPH BY ENRIC SALA

ISV Apps

Run Better
on Exadata
30x Lower CPU Utilization
19x More Registrations
4x Less Storage Used
90% Linear Scalability
15x Faster MDM Throughput
70:1 Compression
30x More Scalable

Over 2500+ ISV Applications Are Certified on Exadata

oracle.com/exadata

Copyright 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.

Mobile Developer

ORACLE MOBILE APPLICATION FRAMEWORK BY CHRIS MUIR

ORACLE MOBILE APPLICATION FRAMEWORK, ORACLE JDEVELOPER

Add Services with a Smile

Consume enterprise web services from mobile apps via


data controls in Oracle Mobile Application Framework.

et Mobile and Connected (Oracle


Magazine, May/June 2015) showed
how Oracle Mobile Application Framework
makes it easy to create mobile application
pages that access an existing web service.
Oracle Mobile Application Framework
takes on the burden of working with web
servicesbe they enterprise-scale SOAP
services or more-contemporary REST
servicesfreeing you to focus on building
the other parts of your app.
The previous columns exercise hid
some of the implementation details of the
sample application, a corporate phonebook
app. Now youll explore those details by
extending the phonebook app. Specifically,
youll learn how to integrate remote web
services into your apps without writing
code, by using an Oracle Mobile Application
Framework abstraction called a data control.

instructions in the Oracle Mobile Application


Framework documentation (docs.oracle
.com/middleware/maf212/mobile/install)
to configure a Mac with Xcode or a Windows
PC with the Android SDK.
Download the sample application at
bit.ly/omagmaf2, and save the o45maf2528109.zip file to a local folder on your
computer that does not use spaces in the
folder name or path. Unzip the file, and then
unzip each of the two extracted files. The
local folder contains two subfolders, each
containing an Oracle JDeveloper workspace:
The HrServicesSubset folder contains a
demonstration REST web service that
youll run on your PC. This web service provides the employee data for your mobile
phonebook app to retrieve.

The PhonebookStarterApp folder contains a prebuilt Oracle Mobile Application


Framework application workspace that
starts where the previous column left off.
Follow these steps to get started:
1. In Oracle JDeveloper, select File -> Open
and navigate to the directory containing
the unpacked zip file content.
2. Open the PhonebookStarterApp folder,
and select the Phonebook.jws file. Click
Open to load the workspace.
3. Open the HrServicesSubset folder, and
load the HrServices.jws workspace. Youll
work with this workspace first, so leave it
open in the Application Navigator.
4. In the Application Navigator, expand
RestServices -> Application Sources
-> oracle.hr.rest, right-click the

SAMPLE APPLICATION OVERVIEW


The phonebook app you created in the previous exercise generates a list of employees
in a single page, ViewEmployees.amx, via
a call to a remote web service. Now youll
extend the app so that its composed of two
pages. When an employee is selected in the
ViewEmployees.amx pages list view, the
appvia a task flownavigates to a new
second page, EmployeeDetails.amx. The
new page shows details about the employee
that are fetched by a separate call to another
web service. To make the new page more
useful, youll include a map that shows the
employees address. Figure 1 shows the
apps two pages.
GETTING READY
Ensure that youre using the studio edition of
Oracle JDeveloper 12c (12.1.3) with the Oracle
Mobile Application Framework v2.1.2+
extension, available as a free download on
Oracle Technology Network. Follow the setup

Figure 1: The extended phonebook app

ORACLE MAGAZINE JULY/AUGUST 2015

31

32

ORACLE MOBILE APPLICATION FRAMEWORK

RestService.java file, and select Run.


5. If you are running Oracle JDeveloper for
the first time, youll be presented with
the Create Default Domain dialog box.
Create a password for the default Oracle
WebLogic Server domain associated
with Oracle JDeveloper, leave the other
fields as they are, and click OK. Oracle
JDeveloper then creates the default
domain and configures it for use.
6. When the service is up and running, you
should see a message like the following
in your Oracle JDeveloper log window:

Figure 2: The Create MAF Task Flow dialog box

Target URLhttp://127.0.0.1:7101/
HrRestServices/

Copy the target URL into your browser,


and add the /employees/174 suffix:
http://127.0.0.1:7101/HrRestServices/
employees/174

The browser should show a payload


of employee data for employee 174 Ellen
Abel, proving that your web service works
as expected and is ready to use for this columns exercise.
EXTENDING YOUR APP WITH A TASK FLOW
In Oracle Mobile Application Framework,
a task flow enables you to diagrammatically
model the navigation flow between pages
without hiding the navigation calls in code.
To start using a task flow to model the
flow in the extended phonebook app, do
the following:
7. In the Application Navigator in Oracle
JDeveloper, select the Phonebook
workspace.
8. Expand ViewController -> Application
Sources -> META-INF, and open the maffeature.xml file.
In the maf-feature.xml file, you define
all of your applications logical features
units of functionalitywhich, in turn,
group the various pages of your application.
For example, a weather app might have
a feature for searching for cities, another
feature to show the current observations
for a number of cities, and a third feature
to show radar images. The phonebook currently has a single employees feature, which

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Figure 3: Modifying EmployeeDetails.amx

youll continue to work with.


9. In the Features section, select the
feature named employees and then
select the Content tab. In the Content
section, click the Type list and change
the type from MAF AMX Page to MAF
Task Flow. Ignore the error indicator surrounding the File field.
10. In the Includes section, select the green
plus (+) button. In the Insert Include
dialog box, enter resources/css/
phonebook.css for File and change Type
to StyleSheet. Click OK.
11. Click the File fields green plus (+)
button. In the Create MAF Task Flow
dialog box, enter employees-taskflow.xml in the File Name field, as
shown in Figure 2, and click OK to open
the newly created employees-task-flow
.xml file in a separate window.
12. From the Application Navigator, under
ViewController -> Application Sources ->
Web Content -> oracle.phonebook
.employees, drag the previously created
ViewEmployees.amx page into the
employees-task-flow.xml diagram
window. The ViewEmployees icon is the
starting point for your task flow.

13. From the Components section of the


Components panel (open the panel with
Windows -> Components if its not currently visible), drag the View icon into the
employees-task-flow.xml diagram to the
right of the ViewEmployees icon. Change
the name of the resulting icon from
view1 to EmployeeDetails.
14. Return to the Components panel,
and double-click the Control Flow
Case icon to select it. In the diagram,
click the ViewEmployees icon and
extend the resulting arrow to the
EmployeeDetails icon. Click again once
so that the arrow stretches between the
two icons. Change the name of the flow
from * to goEmployeeDetails, and
finalize the work by clicking elsewhere in
the diagram.
A control flow case represents a single
named navigation rule between two activities in a task flow. For example, if you want
the app to follow a particular navigation
rule when a button is tapped, you need to
refer to the control flow case by name in the
Action property of the commandButton and
the Oracle Mobile Application Framework
runtime will navigate to the correct page.

33

15. Select the goEmployeeDetails control


flow case in the diagram. In the
Properties panel (open it with Window ->
Properties if its not currently visible), in
the Behavior section, change Transition
from <default> to slideLeft.
16. Return to the diagram, an=d double-click
the EmployeeDetails view. In the Create
MAF AMX Page dialog box, change the
directory to include the suffix /oracle
.phonebook.employees. Deselect
Secondary Action, leaving Header and
Primary Action selected, as shown in
Figure 3. Click OK.
The EmployeeDetails.amx page opens in
the editor. Youll modify this page so that it
displays details for the selected employee.
17. In the editor, change the value of
amx:outputText from the default Header
to Employee.
18. Click the toolbars Save All icon.
EXTENDING THE DATA CONTROL
In Oracle Mobile Application Framework,
data controls are an abstraction wrapped
around the datasources you want your application to interact with, such as remote web
services. Because most datasources typically have their own APIs and represent hierarchies of elements and attributes, working
with all the different interfaces can be
challenging. With Oracle Mobile Application
Framework, you can instead declaratively
configure a data control to interact with all
datasources in a standardized mannera
significant design-time productivity boost,
because you can build your app around
these services based on standard APIs. For
example, you can quickly create pages based
on the data controls attributes rather than
write a complex Java routine.
In the previous column, your phonebook app used a prebuilt data control for
accessing the external web service to extract
a list of employees. That data control was
built for you with an easy-to-use wizard.
Now youll use the same wizard to extend
the existing data control so that it also
extracts details about a selected employee:
19. Open the Data Controls panel in the
Application Navigator, click the blue
twin-arrow refresh button, and notice
the preexisting HrServiceDataControl

Figure 4: Step 1 of creating or modifying a REST web service data control

with a getEmployees() child operation.


This function represents the existing
web service call for retrieving the list
of employees for the ViewEmployees
.amx page.
20. Right-click the ViewController project
in the Application Navigator, and select
New -> From Gallery.
21. In the New Gallery dialog box, select
Business Tier -> Data Controls from the
Categories list. Click the Web Service
Data Control (SOAP/REST) option in the
Items section, and click OK.
22. In the Create Web Service
Data Control dialog box, enter
HrServiceDataControl in the Name
field and select the REST radio button.
This selection defaults the REST data
control to use the same HrServiceConn
REST service connection already defined
in the project. Click Next, and then click
Yes in the dialog box called Data Control
already exists, as shown in Figure 4.
23. In the Resources wizard page, select
/employees Resource Path.
This path represents the REST resource
previously configured for accessing all the
employees from the remote HR system.
On the right side, you can see that this
REST resource uses a GET operation thats
exposed with the name getEmployees to
the Oracle Mobile Application Framework
application (as you saw in the Data Controls
panel in step 19). Now youll extend the

data control so that you can retrieve a


single employee from the HR systems
REST services.
24. In the Resource Paths list, click the
green plus (+) button. Double-click the
resulting new line, and replace /path1
with /employees/##empId##. This path
represents an entirely different REST
resource for selecting an individual
employee ID by the variable ##empId##.
25. Select the GET checkbox, and change
Method Display Name for GET to
getEmployee, as shown in Figure 5.
Click Next.
26. On the Method Details wizard page,
under Resource Methods, select
getEmployee.
To work with an external REST resource,
Oracle JDeveloper needs a description of the
payload schema file. Alternatively, at design
time, you can use the Create Web Service
Data Control wizard youre working in now
to issue one query with a valid empId, and
the wizard will conveniently work out the
structure for you.
27. In the URL Parameters tables Default
value field for empId, enter 174, as
shown in Figure 6, and click Next.
28. On the final wizard page, click the Test
REST Connection button and look for
two REST Connection Successful messages. Click Finish.
29. In the Application Navigator, open the
Data Controls panel and click the refresh

ORACLE MAGAZINE JULY/AUGUST 2015

34

ORACLE MOBILE APPLICATION FRAMEWORK

the task flow between the ViewEmployees


and EmployeeDetails pages (in steps 14
and 15). Now, when the user selects a
specific employee in the ViewEmployees
list view, the employee ID to use on the
getEmployee(String) method on the
EmployeeDetails page is recorded via the
setPropertyListener and the application
navigates to that page to show the employee
details associated with that ID.

Figure 5: Step 2 of the Create Web Service Data Control wizard

Figure 6: Step 3 of the Create Web Service Data Control wizard

button. Expand HrServiceDataControl,


and notice the two functions: the preexisting getEmployees() function (for
retrieving all employees used by the
ViewEmployees.amx page) and the new
getEmployee(String) function, which
fetches a specific employees details
from the remote web service when given
an employee ID. Youll use this new function on the EmployeeDetails.amx page
in a moment.
EXTENDING THE VIEWEMPLOYEES PAGE
The next step is to determine which employee
ID to pass to the getEmployee(String)
method. That value is determined by the
employee row the user selects on the
ViewEmployees page. You need to add
code that, when the user selects an
individual row, captures that employee ID
and then navigates to the EmployeeDetails
.amx page.
30. Return to the employees-task-flow.xml
file, and double-click the ViewEmployees

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

page in the diagram editor.


31. From the Components panels
Operations section, drag a Set Property
Listener into the ViewEmployees
.amx page code, after the closing
</amx:tableLayout> tag and before the
closing </amx:listItem> tag.
32. With the <amx:setPropertyListener>
tag selected, in the Properties panels
Common section, change the From value
to #{row.EmployeeId}, the To value to
#{pageFlowScope.empId}, and the Type
field to action.
The <setPropertyListener> tag retrieves
the current EmployeeId for the selected row
and writes it to a dynamic variable empId
in a reserved memory scope, called
pageFlowScope, for the task flow.
33. Select the opening <amx:listItem>
tag, and in the Properties panels
Common section, set Action to
goEmployeeDetails.
The goEmployeeDetails action represents the control flow case you specified in

BUILDING THE EMPLOYEEDETAILS PAGE


34. Return to the EmployeeDetails
page, by double-clicking its icon in
the employees-task-flow.xml
diagram editor.
35. Locate the <amx:facet name=primary>
tag, and select its child
<amx:commandButton> button. In the
Properties panel, change the commandButtons Text property to Back and
select the __back value from the Action
properties list.
36. In the Application Navigator, expand the
Data Controls -> getEmployee(String) ->
Return node and drag the child Employee
node onto your EmployeeDetails.amx
page immediately after the last closing
</amx:facet> tag and before the closing
</amx:panelPage> tag.
37. In the Create dialog box, select the
Form -> MAF Read-only Form option.
In the Edit Form Fields dialog box,
delete everything but the EmployeeId,
FirstName, LastName, Address, and
Department.DepartmentName fields,
as shown in Figure 7, and click OK.
(The fields used here are arbitrary; you
can pick any fields that are relevant to
your needs.)
The Edit Action Binding dialog box
requests a value for the getEmployee() java
.lang.String parameter empId, which, as you
recall, is captured via the <setProperty
Listener> tag on the ViewEmployees page.
38. In the Value column, enter the expression language (EL) expression
#{pageFlowScope.empId} and
click OK.
39. Select the Bindings tab at the bottom of
the EmployeeDetails.amx page. On the
Bindings page, select the getEmployee
Iterator option from the Executables

35

Figure 7: The Edit Form Fields dialog box

list. In the Properties panels Advanced


section, change the Refresh property
from deferred to always. This selection
ensures that the page will make a fresh
call to getEmployees(String) each time
this page is visited with a new employee
IDrather than caching the previous
results for speed, which would incorrectly show old data.
ADDING A MAP
Now finish your app by adding a map to the
EmployeeDetails.amx page that shows the
selected employees address:
40. With the EmployeeDetails.amx page
still open, select the Source tab at
the bottom. From the Components
window, select MAF AMX Data
Visualizations from the MAF AMX
list. From the Common sections Map
category, drag the Geographic Map
component to between the closing
</amx:panelFormLayout> tag and the
closing </amx:panelPage> tag.
41. Replace the newly added geographicMap
code block with the following code,
which displays the employees address:
<dvtm:geographicMap id="geomp1"
mapType="ROADMAP">
<dvtm:pointDataLayer id="pdl1">
<dvtm:pointLocation id="pl1"
type="address"
address="#{bindings.Address

.inputValue}"/>
</dvtm:pointDataLayer>
</dvtm:geographicMap>

42. Now that youre showing the address


on the map, you can remove the
address from the text. Locate the
<amx:outputText> tag whose value
is #{bindings.Address.inputValue}.
Delete that outputText component and the surrounding parent
<amx:panelLabelAndMessage> opening
and closing tags.
RUN THE APP
Deploy the finished app to iOS Simulator
36if youre on a Mac or to the Android emulator if youre on Windows.
1. Mac users only:
a. Select Run -> Choose Active
Run Configurations -> Manage
Run Configurations -> Edit Shared
Settings -> iOS Simulator -> Edit ->
Mobile Run Configuration, and
change the Simulator option
to iPhone 5S if its not the
default option.
b. Close all the dialog boxes by
clicking OK.
c. In the Application Navigator, rightclick the ViewController project and
select Run.
2. Android users only:
a. In the Application Navigator in

Oracle JDeveloper, select Application


Resources -> Connections -> REST,
right-click the HrServiceConn connection, and select Properties.
b. In the Edit REST Connection dialog
box, replace 127.0.0.1 in the URL
Endpoint field with 10.0.2.2. (This
value enables the Android emulator
to access the web service running on
your PCa change thats not required
for iOS Simulator.)
c. Select Run -> Choose Active Run
Configuration -> Android Emulator.
d. In the Application Navigator, rightclick the ViewController project and
select Debug.
3. After the application starts, select
an employee in the list to see that persons details.
If you encounter any issues, refer to the
Oracle Mobile Application Framework installation documentation. You can also search
or post to the Oracle Mobile Application
Framework forum, at community.oracle
.com/community/oracle-mobile/oraclemaf.
CONCLUSION
This column introduced you to some of the
productivity boosters available through
Oracle Mobile Application Framework,
including easy creation of data controls
wrapped around remote web services. Data
controls abstract away the low-level implementation details and leave you to focus on
your mobile apps content.

Chris Muir is a senior principal product


manager of mobility and development tools
at Oracle.

NEXT STEPS
DOWNLOAD the sample applications for
this article
bit.ly/omagmaf2
READ more about Oracle Mobile Application
Framework
oracle.com/maf
WATCH Oracle Mobile Application
Framework YouTube training
youtube.com/user/OracleMobilePlatform
JOIN the Oracle Mobile Application
Framework Google+ community
bit.ly/1A4h5sd

ORACLE MAGAZINE JULY/AUGUST 2015

Go to where the
conversation lives.
Connect with Oracle Magazine on your favorite social
channel and be a part of our growing community.
Join Us.

OracleMagazine

Oracle Magazine

@OracleMagazine

Print. Digital. Mobile

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Database Application Developer

PL/SQL BY STEVEN FEUERSTEIN

ORACLE DATABASE

On Cursors, Context
Switches, and Mistakes

There are good ways, and other ways, to get data


from tables.

I-HUA CHEN

hings have recently settled down at


extremememe.info. Rather than work
with the development team side by side, I
have shifted to serving as a sounding board
for developers. I stop by once a week, hang
out my shingle (The Man Who Knows Only
PL/SQL, aka TMWKOP) at an available
cubicle, and see what the day brings me.
Usually it brings me PL/SQL code, which
is a good thing, because I am not to be
trusted with anything else. Sometimes that
code is bright and shiny: the developer is
there to essentially show off some nice code.
Sometimes, however, that code is a
twisted pretzel of good intentions warped by
tough deadlines that send developers scurrying for shortcuts that will, they think, save
them a little time. And every second counts.
Its really tough when I am presented
with a twisted pretzel of code that the developer believes is actually bright and shiny.
Welcome to the world of Coding Diplomacy.
Check this out, Steven, said Marsha.
I figured out a way to reuse existing code
and avoid declaring variables when I can get
PL/SQL to do it for me.
I did not like the sound of that at all. I am
all for code reuse and all for getting Oracle
Database technology to do as much heavy
lifting as possible. I just dont think that being
able to avoid declaring a variable should be
something to get excited about. Its likely an
indication of deeper dysfunction.
But I smiled. A big smile. Marsha is a new
developer, both at extremememe.info and
to PL/SQL. The fact that shes excited about
her code means that she cares about her
code. Thats always a good thing and always
to be encouraged.
Lay it on me, Marsha. Show me what
youve got, I said. And she showed me the
em_meme_reporter procedure (in Listing 1).

I instantly saw what she meant about


avoiding a declarationand I didnt like it
one bit. But I have learned that before going
into critique mode, it is best to gather all
the facts.
I can see that you are reusing a couple of
functions, I told Marsha in a neutral voice.
Could you show those to me as well?
Sure, she said, adding, I didnt write
these. I wasnt sure if I was supposed to
take that as a warning or as an expression
of humility.
She showed me the em_meme_summary
function and the em_meme_history function (in Listings 2 and 3, respectively).
I especially like the em_meme_history
function, said Marsha. That LISTAGG
feature is way cool.
I kept a pleasant smile on my face and
nodded as I mentally formulated my list of
concerns. I encourage my readers to do the
samedo not read further until you review
the three programs in Listings 1, 2, and 3 and
sort out what you think could be improved.
Then compare your list with mine.

CRITICIZE CONSTRUCTIVELY
Theres no shortage of ways to improve
Marshas programjust as there is no
shortage of ways to improve many of
the packages and subprograms that I
(TMWKOP) have written over the years.
For Marshas program, I put together
two lists in my head: first, the list of things
Marsha has done well and for which she
should be complimented and, second, the
list of areas of concern, of what could be
improved. I then carefully filtered and organized the latter to maximize the impact.
Marsha, I started, I love your programmer instincts. They are on target
and will serve you well. You recognize that
keeping code volume to a minimum is generally a solid goal to aim for. Acting on that
principle, you found a way to avoid a declaration by using the cursor FOR loop. Before
writing all the logic in your program, you
also checked around to see if someone else
had beaten you to it: was the algorithm
or the information you needed already
implemented? I wish that more PL/SQL

Code Listing 1: Marshas em_meme_reporter procedure


CREATE OR REPLACE PROCEDURE em_meme_reporter (
meme_id_in
IN em_memes.meme_id%TYPE)
IS
BEGIN
FOR one_meme
IN (SELECT title,
em_meme_summary (meme_id) summary,
em_meme_history (meme_id) history
FROM em_memes
WHERE meme_id = meme_id_in)
LOOP
DBMS_OUTPUT.put_line (one_meme.title);
DBMS_OUTPUT.put_line (one_meme.summary);
DBMS_OUTPUT.put_line (one_meme.history);
END LOOP;
END;
/

ORACLE MAGAZINE JULY/AUGUST 2015

37

38

PL/SQL

developers carried that attitude into their


coding sessions.
Marsha beamed at me. She was happy
and receptive. Now it was time to focus on
areas of improvement. I organized the list
in my head, and sorted out the best way to
take Marsha through them:
PL/SQL is often not the best reporting
mechanism.
Cursor FOR loops for single-row fetching is
bad lazy.
Dont hide possible bugs.
Avoid unnecessary context switches.
Separate data access from data formatting.
PL/SQL AS A REPORTING MECHANISM?
Of course, I am biased, but I believe that
PL/SQL is the best database programming
language in the world, in no small part
because the original designers of PL/SQL
were smart enough to use the Ada programming language as the template for PL/SQL.
But notice that I did not say PL/SQL is
the best programming language. It certainly is not. It is a special-purpose language
designed primarily to make it as easy as possible to write efficient, secure, maintainable
applications on top of Oracle Database (that
is, on top of SQL).
I asked Marsha, Who will be using this
report, and how do they call it?
Right now, its just for the dev team, so
we can quickly and easily see the status of a
meme. But my manager did say that maybe
later we will offer the report to users.
Well, we all know what maybe later
means, right, Marsha? I smiled at her, and
she smiled back and shrugged.
Heres the thing, I said. Developers use
the DBMS_OUTPUT package to send output
to the screen, so they are inclined to use it
for reports. That might be OK for relatively
simple reports for internal developer use.
For reports that involve any amount of
complex formatting and will be user-facing,
though, I suggest that you look at alternatives, such as Oracle Business Intelligence
Publisher [bit.ly/oraclebipub].
So lets continue looking at your
program, but I do suggest that you check in
with your manager about her vision of where
this program will end up. If it really is going
to end up as a significant user report, Id

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

consider switching the delivery mechanism


sooner rather than later.
CURSOR FOR LOOPS FOR SINGLE-ROW
FETCHES: BAD LAZY
Marsha, you were happy to avoid declaring a
variable, I continued, Please explain.
You bet! Marsha started. I just love
the cursor FOR loop. The compiler implicitly
declares the iterator record of the right type.
I dont have to open, fetch, figure out when
to exit, and close. So I used the cursor FOR
loop to find the row of information I needed
for the meme and then displayed that info.
No local variables declared!
Gotcha, I said. I appreciate the cursor
FOR loop as well. To me, it speaks to how
well-designed and implemented PL/SQL

is as a database programming language.


Its a high-level declarative construct, like
SELECT itself. We ask PL/SQL to fetch each
row and apply the code in the body of the
loop to that row. We dont tell PL/SQL how
to do the fetching. And that means, among
other things, that the PL/SQL optimizer is
free to change the way it does its fetching
to improve performance.
So thats all greatbut I think you are
making a big mistake by using the cursor
FOR loop here.
Huh? said Marsha, the smile fading from
her face as she absorbed my last sentence.
To soften the blow, I said, while typing,
I would say the same thing if you showed
me this numeric FOR loop. Tell me what you
think of it.

Code Listing 2: The em_meme_summary function (called by em_meme_reporter)


CREATE OR REPLACE FUNCTION em_meme_summary (
meme_id_in
IN em_memes.meme_id%TYPE)
RETURN VARCHAR2
IS
CURSOR summary_cur
IS
SELECT stats_summary
FROM em_meme_stats_mv
WHERE meme_id = meme_id_in;
l_return
VARCHAR2 (32767);
BEGIN
OPEN summary_cur;
FETCH summary_cur INTO l_return;
CLOSE summary_cur;
RETURN l_return;
END;
/

Code Listing 3: The em_meme_history function (called by em_meme_reporter)


CREATE OR REPLACE FUNCTION em_meme_history (
meme_id_in
IN em_memes.meme_id%TYPE)
RETURN VARCHAR2
IS
l_return
VARCHAR2 (32767);
BEGIN
SELECT LISTAGG (a.activity_date || ' - ' || a.description,
CHR (10))
WITHIN GROUP (ORDER BY a.activity_date)
INTO l_return
FROM em_meme_activities a
WHERE meme_id = meme_id_in;
RETURN l_return;
END;
/

39

BEGIN
FOR indx IN 1 .. 1
LOOP
DBMS_OUTPUT.put_line (indx);
END LOOP;
END;

Well. . . said Marsha slowly, thats just


silly code. Why wouldnt you just call DBMS_
OUTPUT.put_line to display 1?
Exactly! I replied. That is exactly the
problem with that loopand with yours as
well. Can you see why?
Marsha looked at her program, frowning.

Then her expression cleared. I get it! I am


producing a report for a single meme, so
only one row is being fetched from the em_
memes table. The body of the loop always
executes only once.
Ideally, yes, once and only once, I said.
A cursor FOR loop that fetches just one row
is like a numeric FOR loop that goes from N
to N. And neither of them should be loops.
Lets face it, Marsha: you were just being
lazy. And, I continued before she could take
offense, I think that being lazy is not a character flaw for a programmer. But you have to
be lazy in the rightthat is, smartway.

Good lazy: hide a SELECT behind a function to avoid having to type it more than
once. Bad lazy: abusing a language construct
so that Oracle Database will declare a variable
for you. Marsha looked a little embarrassed.
Oh, and by the way, I told Marsha,
theres another problem with using a cursor
FOR loop this way: you might hide a bug.
DONT HIDE POSSIBLE BUGS
Every program a developer writes makes
an assumption. When that assumption
fails, the program usually fails with an error.
Thats bad enough. Even worse, however,

Take the Challenge


Each PL/SQL article offers a quiz to test your knowledge of the information provided in that article. The quiz appears below and also at PL/SQL
Challenge (plsqlchallenge.com), a website that offers online quizzes on PL/
SQL as well as on SQL, Oracle Application Express, database design, and
deductive logic.
Here is your quiz for this article:
I execute the following statements:
CREATE TABLE plch_memes
(
meme_id
INTEGER,
title
VARCHAR2 (100),
description
VARCHAR2 (4000)
)
/
BEGIN
INSERT INTO plch_memes
VALUES (
1,
'Cats doing somersaults',
'When that cat flips, the world flips with it.');
INSERT INTO plch_memes
VALUES (
1,
'Cats being the boss',
'Who really owns whom?');
COMMIT;
END;
/

Which of the following choices create a function named PLCH_MEME_


TITLE so that Cats and some other text is displayed on your screen after
execution of this block?
BEGIN
DBMS_OUTPUT.put_Line (plch_meme_title (1));
END;
/

a.
CREATE OR REPLACE FUNCTION plch_meme_title (
meme_id_in
IN plch_memes.meme_id%TYPE)
RETURN VARCHAR2
IS

l_return
plch_memes.title%TYPE;
BEGIN
SELECT title
INTO l_return
FROM plch_memes
WHERE meme_id = meme_id_in;
RETURN l_return;
END;
/

b.
CREATE OR REPLACE FUNCTION plch_meme_title (
meme_id_in
IN plch_memes.meme_id%TYPE)
RETURN VARCHAR2
IS
CURSOR title_cur
IS
SELECT title
FROM plch_memes
WHERE meme_id = meme_id_in;
l_return
plch_memes.title%TYPE;
BEGIN
OPEN title_cur;
FETCH title_cur INTO l_return;
CLOSE title_cur;
RETURN l_return;
END;
/

c.
CREATE OR REPLACE FUNCTION plch_meme_title (
meme_id_in
IN plch_memes.meme_id%TYPE)
RETURN VARCHAR2
IS
BEGIN
FOR rec IN (SELECT title
FROM plch_memes
WHERE meme_id = meme_id_in)
LOOP
RETURN rec.title;
END LOOP;
END;
/

ORACLE MAGAZINE JULY/AUGUST 2015

40

PL/SQL

is when the assumption fails but no error


reflecting that failure is communicated to
the user or to the error log.
I told Marsha, In em_meme_reporter,
you assume that there is just one row in
em_memes for a given meme ID.
Well, sure I do, she said. Theres a
primary key on the table. There couldnt
possibly be more than one row in the table
with the same meme ID.
You mean that you assume that the
primary key is enabled on the table, right?
Marsha looked at me like I was crazy.
I guess so, she said slowly. But why
wouldnt it be enabled?
Because someone disabled it by accident? I gestured to indicate the entire
extremememe.info workplace. What? You
think your coworkers dont ever make mistakes? Accidents happen all the time. Things
change, and no one noticesuntil the consequence of a change smacks us in the face.
Marsha looked distinctly unconvinced.
Sure, its a long shot to think that the
primary key would be disabled on the em_
memes tablein production, I said. But
in development and testing, controls are
usually looser. Someone might, for example,
decide to turn off the primary key constraint
to make it easier to refresh test data.
Marsha looked over her code. Then she
said, OK, I can see that in terms of the cursor
FOR loop. But I call em_meme_summary
inside the query. If there were multiple rows
with the same meme ID, the function would
fail with TOO_MANY ROWS errors, right?
I smiled. Marsha was a fast thinker.
Youd like to think so, right? But in fact, no.
Notice that em_meme_summary [Listing 2]
relies on an explicit cursor rather than a
SELECT-INTO to fetch that one row. Using
SELECT-INTOs is, generally, going to be
the fastest way to fetch a single row, so the
explicit cursor is not only a bad idea for performance but is also a mistake, because it
will hide TOO_MANY_ROWS errors.
Thats one of the other reasons
besides performancewhy you should
always use a SELECT-INTOand certainly
not a cursor FOR loopwhen fetching
what you believe should always be a single
row: the PL/SQL runtime engine will raise
TOO_MANY ROWS.

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Code Listing 4: The revised em_meme_reporter procedure


CREATE OR REPLACE PROCEDURE em_meme_reporter (
meme_id_in
IN em_memes.meme_id%TYPE)
IS
l_title
em_memes.title%TYPE;
l_stats_summary
em_meme_stats_mv.stats_summary%TYPE;
BEGIN
SELECT m.title, s.stats_summary
INTO l_title, l_stats_summary
FROM em_memes m, em_meme_stats_mv s
WHERE
m.meme_id = em_meme_reporter.meme_id_in
AND m.meme_id = s.meme_id;
DBMS_OUTPUT.put_line (l_title);
DBMS_OUTPUT.put_line (l_stats_summary);
FOR activity_rec
IN ( SELECT a.activity_date || ' - ' || a.description
one_activity
FROM em_meme_activities a
WHERE a.meme_id = em_meme_reporter.meme_id_in
ORDER BY a.activity_date)
LOOP
DBMS_OUTPUT.put_line (activity_rec.one_activity);
END LOOP;
END;
/

Because Marsha had mentioned the em_


meme_summary function she was calling
inside her loops query, it was time to move
on to my next concern.
Oh, and by the way, you should not
be reusing those functionsem_meme_
summary and em_meme_historyinside
your query. I suppose, I finished with a sigh,
thats anotherand worseexample of
bad lazy, and it could affect both the performance and correctness of your program.
AVOID UNNECESSARY CONTEXT SWITCHES
In my trainings at extremememe.info and
other locations, I urge developers to hide
SELECT statements behind functions
and also to reuse code whenever possible. Given that, it is not surprising that
Marsha took the approach she did. But any
piece of advice must always be applied
with common sense and a broader understanding of your objectives.
Its great that you wanted to reuse
existing code, Marsha, I explained. Youve
just got to keep in mind that reusealong
with a reduced volume of code to maintainis only one objective, among many, for
a successful application. I hate to say it, but
sometimes pursuing one objective might
interfere with another. In this case, you pri-

oritized reuse, but at the expense of performance and increased complexity of code.
So, I continued, lets talk about
context switches.
The PL/SQL language is tightly integrated
syntactically with SQL: you can write native
SQL statements inside PL/SQL, and almost
all built-in SQL functions are also available
as native PL/SQL functions.
But when it comes to executing PL/SQL
code and executing SQL statements, you
are looking at two different engines. The
PL/SQL runtime engine executes PL/SQL
blocks and the statements within them. The
SQL engine executes SQL statements.
Thats straightforward enough, right?
I asked Marsha. She nodded. But then it
gets tricky. What happens when the PL/SQL
engine encounters a SQL statement smackdab in the middle of the PL/SQL block?
Marsha thought about it for a moment. I
guess it must hand over the SQL statement
to the SQL engine for processing.
Exactly right! Its called a context switch.
The PL/SQL engine passes the SQL statement, along with bind variable values, over
to the SQL engine. The SQL engine does
its thing and then passes the results back
to the PL/SQL engine, which continues
right along.

41

Answer to Last Issues Challenge


The PL/SQL Challenge quiz in last issues
Dynamically Dangerous Code article
created and populated two tables, presented
a code block, offered four different procedures, and asked which procedures would
display both Oak and Sam.
All four answersA, B, C, and Dare
correct, but only D addresses basic SQL
injection concerns and avoids unnecessary
dynamic PL/SQL execution.

Next question: what happens when


the SQL engine is executing a query and it
comes across a user-defined function, such
as em_meme_history?
Marsha was clearly no dummy. She
answered in an instant: The same in
reverse. The SQL engine passes the function call, along with the values from the SQL
statementpassed as argumentsto the
PL/SQL engine.
I beamed at Marsha. I like smart students, and I like smart PL/SQL developers
even better.
Final question: what happens when a
PL/SQL block executes a query that calls a
user-defined function that, in turn, executes
a SQL statement? I asked.
Lots and lots of context switches?
Yes, indeed, a whole mess of context
switches, and each switch is a delay. So the
more you switch, the slower your code goes.
Remember FORALL from that training I did
a few months ago? Reduction of context
switches was the primary design goal of
that feature.
Marsha looked over her code. She
nodded. Yep, so thats exactly whats going
on here. I call those functions in my SELECT
becausewell, heck, why write that logic
again? But they, in turn, each execute their
own SELECTs. OK, I can see the problem.
What do you think I should do about it?
Before I get to that, I said, I have one
more piece of advice: it is critical to hide
SELECTs behind functions, especially in those
queries that are commonly used throughout
your PL/SQL code. Its really the only way to
avoid copy/pastes of queries and the only
way to ensure that your code is maintainable.
But even more important is that you do as
much work as you can in native SQL.
And that advice can be hard to follow

or you can be tempted not to follow it


when you have at hand a whole bunch of
functions that fetch data for a variety of
common scenarios. Thats the situation you
ran into, Marsha. OK, so what should you
do? I suggest restructuring your em_meme_
reporter procedure [Listing 4].
I then went over the changes I made to
the em_meme_reporter procedure.
First, I execute a SELECT-INTO to
retrieve the title from em_ememes and the
statistics summary from the em_emem_
stats_mv materialized view. No need to call
a separate function. Instead, I join the two
tables together on the meme_id and, with
one context switch, get all that data.
Notice that I do not also include a join
to em_meme_activities. Instead, in the
em_meme_reporter procedure, I rely on
the cursor FOR loop construct we both
know and love to simply retrieve each row
of activity for that meme and then display
it. Very straightforward, easy to understand
and maintain, avoiding unnecessary context
switches. Again, this is assuming that you
want to stick with a PL/SQL procedure as
your reporting mechanism.
SEPARATE DATA ACCESS FROM
DATA FORMATTING
Marsha seemed OK with the em_meme_
reporter procedure rewrite, so I moved on
to my final piece of advice: Even if you are
going to use PL/SQL as a reporting engine,
I told her, you should clearly separate the
code used to retrieve data and the code used
to format that data in the report.
Using LISTAGG is a nice way to aggregate
data from multiple rows into a single list.
In the em_meme_history function, the
author specifies CHR(10) as the list separator.
CHR(10) is the line-feed character, so what
this function really does is return multiple
rows of data on multiple lines in the report.
Developers should take care to keep
user interface rules and code separate from
business rules and data. And the same rule
applies to formatting for a report: put all
such logic in the report generator, and keep
it out of the code used to retrieve the data
for the report.
Marsha grinned widely. Im going to
be sure to tell that to Sam, who wrote the

em_meme_history function. He thinks


hes such a hotshot.
I figured it would be smarter for Marsha
to first find out how the function is currently
being used: never rush to judgment! But the
best way to learn how to write codeand
how to relate to other humansis to make
mistakes and be corrected. So I left her to it.
KEY LESSONS LEARNED
As is so often the case, the smallest and, at
first glance, reasonable program can offer
many lessons for code optimization. Marsha
and I walked through em_meme_reporter
and came away with the following checklist,
from which I think all PL/SQL developers
can benefit:
Never use a cursor FOR loop to fetch a
single row.
Never use an explicit cursor to fetch a
single row.
Avoid writing code that hides bugs.
User-defined functions executed inside a
SQL statement should never contain their
own SQL statements.
Keep user interface and report formatting logic separate from data retrieval and
business rule logic.

Steven Feuerstein
(steven.feuerstein@
oracle.com) is an
architect for Oracle,
specializing in PL/SQL.
He also leads a team
of Oracle developer advocates. Feuersteins
books, such as Oracle PL/SQL Programming,
and more than a thousand PL/SQL quizzes at
PL/SQL Challenge (plsqlchallenge.com) provide
in-depth resources for PL/SQL developers.

NEXT STEPS
DOWNLOAD
Oracle Database 12c
bit.ly/fherki
PL/SQL code for this article
bit.ly/plsqlja15
TEST your PL/SQL knowledge
plsqlchallenge.com
READ more Feuerstein
bit.ly/omagplsql
READ more about PL/SQL
oracle.com/plsql

ORACLE MAGAZINE JULY/AUGUST 2015

Last Chance to
Convert to Digital
And receive your Tom Kyte
collectors edition button!*

Sign up for digital today!


Go to http://bit.ly/TomKyteButton

Copyright 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners. *Subject to digital subscription approval. While supplies last.

DBA

TUNING BY ARUP NANDA

ORACLE DATABASE

Beginning Performance
Tuning: Trace Your Steps
Trace sessions to document activity details and
identify bottlenecks.

n 2012 and 2013, I wrote three articles


for Oracle Magazine on beginning performance tuning that demonstrated how
to identify bottlenecks experienced by an
Oracle database session in the present and
in the past:
Beginning Performance Tuning (bit.ly/
omagdbatune1)
Beginning Performance Tuning: Diagnose
the Past (bit.ly/omagdbatune2)
Beginning Performance Tuning: Active
Session History (bit.ly/omagdbatune3)
And although those tuning techniques
can prove quite helpful in resolving many
performance issues, they dont show the
details of all the activities of a session. For
example, by using those techniques, you
can see what events the session has been
waiting for, how much time a session has
spent on each event, and what resources
(CPU cycles, memory, and so on) an event
consumed. Those tuning techniques do
not, however, show the timing of individual
queries or the different execution steps in
each query. To display those details, you
need to trace the session.
Tracing is the action of enabling a flag
in Oracle Database that instructs the database to write the details of the activities
inside a session to a text file on the server.
In this article, you will learn how to enable
tracing in remote and future sessions and
analyze trace files to resolve performance
issues. There are many ways you can enable
tracing in sessions, but the easiest is to use
the Oracle-provided and -recommended
DBMS_MONITOR package.
TRACING BASICS
Consider the following problem scenario:
your database application performance has
been erratic; it has been acting as expected

at times and badly at other times. How


can you identify the root cause and resolve
the issue? The answer: trace and analyze
the session. To demonstrate the concepts
and the solution, I will use the SH schema,
available with the sample schemas of
Oracle Database.
To see tracing concepts and this articles

problem and solution in action, first


connect to the database as the SH user and
run the query shown in Listing 1.
To start the session trace, you first
need to know the unique identifiers of the
session: the SID and the serial#. Use the
following query to find these identifiers in
the v$session view:

Code Listing 1: Example activity script


-- Example activity script to demonstrate tracing
-- Connect as SH user and execute the script
-- SH schema (part of example schemas) must have been installed.
alter session set query_rewrite_integrity = stale_tolerated
/
alter session set query_rewrite_enabled = true
/
SELECT
sum(s.amount_sold) AS dollars
FROM
sales s
,
times t
WHERE
s.time_id = t.time_id
AND
t.calendar_month_desc = '1998-05'
/
alter session set query_rewrite_enabled = false
/
alter session set query_rewrite_integrity = enforced
/
SELECT
sum(s.amount_sold) AS dollars
FROM
sales s
,
times t
WHERE
s.time_id = t.time_id
AND
t.calendar_month_desc = '1998-05'
/
exit

Code Listing 2: Script to identify the trace file


select
r.value
||'\diag\rdbms\'||
sys_context('USERENV','DB_NAME')
||'\'||
sys_context('USERENV','INSTANCE_NAME') ||'\trace\'||
sys_context('USERENV','DB_NAME')
||'_ora_'||p.spid||'.trc'
as tracefile_name
from v$session s, v$parameter r, v$process p
where r.name = 'diagnostic_dest'
and s.sid = &1
and p.addr = s.paddr;

ORACLE MAGAZINE JULY/AUGUST 2015

43

44

TUNING

select sid, serial#

Code Listing 3: tkprof output, part 1

from v$session
where username = 'SH';

Using the SID and serial# returned, turn


on tracing for the session by executing the
following SQL statement as the SYS user:
begin
dbms_monitor.session_trace_enable (
session_id => <SID>,
serial_num => <serial#>,
waits

=> true,

binds

=> true

plan_stat

=> 'all_executions');

end;

After tracing is enabled, the trace file


a text fileis generated on the database
server at the location specified by the
DIAGNOSTIC_DEST database initialization
parameter. Listing 2 shows a scriptnamed
tfname.sqlthat accepts the SID of the
session as a parameter and shows the complete path of the trace file as the output. For
example, to find the trace file of a session
with SID 246, you would execute

... output
SELECT
FROM
,
WHERE
AND

truncated ...
sum(s.amount_sold) AS dollars
sales s
times t
s.time_id = t.time_id
t.calendar_month_desc = '1998-05'

call
count
cpu
elapsed
disk
query
current
rows

Parse
1
0.00
0.00
0
0
0
0
Execute
1
0.00
0.00
0
0
0
0
Fetch
2
0.00
0.01
0
3
0
1

total
4
0.00
0.01
0
3
0
1

Rows (1st) Rows (avg) Rows (max) Row Source Operation



1
1
1 SORT AGGREGATE (cr=3 pr=0 pw=0 time=61 us)
1
1
1 MAT_VIEW REWRITE ACCESS FULL CAL_MONTH_
SALES_MV (cr=3 pr=0 pw=0 time=52 us cost=3
size=15 card=1)
... output truncated ...

raw trace file and produces a file with the


trace file data in a readable format. Here is
how you would use tkprof on a raw trace file
named ann1_ora_11408.trc:
tkprof ann1_ora_11408.trc
ann1_ora_11408.out sys=no waits=yes

SQL> @tfname 246

aggregate=no width=180

TRACEFILE_NAME

It produces a well-formatted file named


ann1_ora_11408.out, which you can download from the online version of this article.
Listing 3 is a small excerpt of the ann1_
ora_11408.out file. The output file shows
many things: various queries executed
by the session, the execution statistics
of the queries, and more. The statistics
in Listing 3 just after the SQL show the
different types of activities called by the
query (under CALL): PARSE, EXECUTE, and
FETCH. The rest of the output shows execution statistics for the different activities in
a table format. Here are some important
table columns in the tkprof output of the
trace file and their meanings:
COUNT. The number of times that type of
call has been made.
ELAPSED. The total time of the call,
including CPU. (This is the directly observable metric. The greater the elapsed time,
the more time the session is taking.)
CPU. The total CPU time of the call.

C:\APP\ORACLE\diag\rdbms\ANN1\ann1\
trace\ann1_ora_11408.trc

For UNIX-based systems, replace backslashes (\) with forward slashes (/) in the
tfname.sql script. In this case, the trace
filenamed ann1_ora_11408.trcis generated in the C:\APP\ORACLE\diag\rdbms\
ANN1\ann1\trace folder. Because of its size,
I am not showing the entire trace file here,
but you can download it from the Oraclehosted online version of this article, at
bit.ly/omagdbatrc715.
ANALYSIS
Examining a raw trace file can be overwhelming. To glean useful information from
it quickly, convert it to a format you can
easily interpret.
Oracle Database provides a tool called
tkprof for this very purpose. It accepts a

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

QUERY. How many blocks were accessed


(queried) by the call (whether from disk or
buffer cache).
DISK. How many of those queried blocks
came from the disk.
The query execution statistics are the
first thing you should examine during
performance troubleshooting. Look at the
number of calls for each type of operation
in Listing 3. For example, parsing requires
CPU cycles, so the greater the CPU number
for PARSE, the greater the CPU consumption. Next, look at the total time under
ELAPSED. Obviously, your tuning objective
is to reduce the elapsed time of the query
to reduce the overall time used by the
session. But how?
To answer that, notice the number
for TOTAL under CPU in Listing 3,
which shows the total CPU time. My
Beginning Performance Tuning (bit.ly/
omagdbatune1) article demonstrated that
an Oracle Database session is in one of two
states: doing something useful (on CPU)
or waiting for something such as a latch
or a lock. That same article demonstrated
how to measure exactly how much time a
session used and how much of it was spent
on CPU, but that demonstration didnt
break down the elapsed times for individual
SQL statements in a session. Now, with the
tkprof output from the trace file, you not

45

Code Listing 4: tkprof output, part 2


... output
SELECT
FROM
,
WHERE
AND

truncated ...
sum(s.amount_sold) AS dollars
sales s
times t
s.time_id = t.time_id
t.calendar_month_desc = 1998-05

call
count
cpu
elapsed
disk
query
current
rows

Parse
1
0.00
0.00
0
0
0
0
Execute
1
0.00
0.00
0
0
0
0
Fetch
2
0.00
0.05
0
24485
0
1

total
4
0.00
0.05
0
24485
0
1
Rows (1st) Rows (avg) Rows (max) Row Source Operation

1
1
1 SORT AGGREGATE (cr=24485 pr=0 pw=0 time=50655 us)
12309
12309
12309 HASH JOIN (cr=24485 pr=0 pw=0 time=58765 us cost=665 size=536284 card=19153)
12309
12309
12309
NESTED LOOPS (cr=24485 pr=0 pw=0 time=53432 us cost=665 size=536284 card=19153)
12309
12309
12309
NESTED LOOPS (cr=90 pr=0 pw=0 time=5826 us cost=665 size=536284 card=19153)
31
31
31
STATISTICS COLLECTOR (cr=56 pr=0 pw=0 time=283 us)
31
31
31
TABLE ACCESS FULL TIMES (cr=56 pr=0 pw=0 time=71 us cost=18 size=480 card=30)
12309
12309
12309
PARTITION RANGE ITERATOR PARTITION: KEY KEY (cr=34 pr=0 pw=0 time=4410 us)
12309
12309
12309
BITMAP CONVERSION TO ROWIDS (cr=34 pr=0 pw=0 time=2258 us)
31
31
31
BITMAP INDEX SINGLE VALUE SALES_TIME_BIX PARTITION: KEY KEY (cr=34 pr=0 pw=0
time=299 us)(object id 92695)
12309
12309
12309
TABLE ACCESS BY LOCAL INDEX ROWID SALES PARTITION: 1 1 (cr=24395 pr=0 pw=0
time=37669 us cost=665 size=7548 card=629)
0
0
0
PARTITION RANGE JOIN-FILTER PARTITION: :BF0000 :BF0000 (cr=0 pr=0 pw=0 time=0
us cost=665 size=7548 card=629)
0
0
0
TABLE ACCESS FULL SALES PARTITION: :BF0000 :BF0000 (cr=0 pr=0 pw=0 time=0
us cost=665 size=7548 card=629)
... output truncated ...

only know the elapsed time of the individual


SQL statements inside the session but also
how much of it was spent on CPU.
The DISK column value in Listing 3
shows 0, meaning that the query got all of
its blocks from the buffer cache without
needing to go to the physical disk. The
QUERY column shows the number of
rows retrieved at that stage. In this case,
three rows were retrieved. Because Oracle
Database spends some CPU cycles to get
a row, the greater the number of rows
accessed by the query, the more CPU cycles
consumed and the greater the elapsed time.
Right after the tracing statistics in
Listing 3, the output lists the row source
information, which shows the steps the
query executed as well as the statistics for
those steps. In this case, the output shows
that the query retrieved only one row.
Consider the output:

The TIME element in the output shows


how much time the step took. In this case,
the sort step took 61 microseconds.
Tracing captured the finer details of
not just the session but also the individual
SQL statements executed by the session
and even the individual steps inside the
query. With this level of detailed information, you can identify the specific activity
taking up the bulk of the total time used
by the session. Reduce that, and you
reduce the elapsed time of the session and
improve performance.

SORT AGGREGATE (cr=3 pr=0 pw=0

SELECT sum(s.amount_sold) AS dollars

time=61 us)

FROM sales s, times t

RESOLUTION
Now lets see how to use the trace file
information to solve the original problem.
Listing 4 includes another excerpt of the
same ann1_ora_11408.out tkprof output file.
Examine the outputs in Listings 3 and 4,
and notice that the

WHERE s.time_id = t.time_id


AND t.calendar_month_desc = '1998-05'

query appears once in each listing. This is


because the query was executed twice and
therefore captured twice in the raw trace
file. The tkprof tool, by default, consolidates the metrics of both executions of a
specific SQL statement into a single value.
Thats why I included the AGGREGATE=NO
parameter when I ran the tkprof tool, which
caused each occurrence of the query to
be recorded separately in the output file.
Note that although the body of the query is
the same in both occurrences, the execution statistics are different. The ELAPSED
column value shows 0.01 and 0.05 for the
first and second occurrencein Listing 3
and Listing 4respectively. This is why the
session slowed down: it took 0.05 seconds
during the second occurrence instead of
0.01 seconds. I found the specific activity
that caused the performance issue, but why
did the second occurrence take longer?

ORACLE MAGAZINE JULY/AUGUST 2015

46

TUNING

Look at the QUERY column value in


Listing 3 and Listing 4. It was 3 in the first
occurrence of the query in Listing 3, but
it was 24,485 in the second occurrence in
Listing 4. This means that the first occurrence fetched only 3 rows but the second
fetched 24,485 rows. Based on this information, its no surprise that the second occurrence took longer to completeit had to
fetch significantly more rows. I know that the
table is static, so the number of rows fetched
should be the same each time. So, how come
the number of rows fetched was different?
The answer lies in the row source
operation data. In the first occurrence
of the query, in Listing 3, ROW SOURCE
OPERATION shows

SQL statement before the second execution


of the SQL query:
alter session
set query_rewrite_enabled = false;

This SQL statement disabled automatic


query rewrite in the session, so during the
second execution, the query had no choice
but to ignore the presence of the materialized view. This explains the change in the
behavior of the query and the resultant
increase in elapsed time.
For this tuning problem, the solution is
to remove this ALTER SESSION statement
to bring the behaviorand therefore the
performanceof the query execution back
to normal.

MAT_VIEW REWRITE ACCESS FULL


CAL_MONTH_SALES_MV

which means that the query selected from


a materialized view named CAL_MONTH_
MVnot from the database tables. Because
materialized views contain summarized
data, the query had to pull only a few relevant records from the summarynot all the
rows from the tables. In the second occurrence of the query, in Listing 4, ROW SOURCE
OPERATION shows that the query selected
all the rows from tables, including SALES
and TIMES, and from indexesnot from the
materialized view. This is the reason for the
much higher number of rows fetched in the
second query occurrence in Listing 4.
You can also see from the output in
Listing 4 that after fetching all the rows, the
query executed some additional operations,
including nested loops and hash joins. All of
these additional steps and the much higher
number of rows fetched resulted in the
additional elapsed time for the session. You
can identify the exact time elapsed for each
step shown by TIME=VALUE US in the ROW
SOURCE OPERATION output. Adding these
times shows the total elapsed time of that
occurrence of the query.
Why did the execution plan change from
using materialized views to using the underlying database tables when the SQL query
itself didnt change? To get that answer,
I examine the tkprof-formatted ann1_
ora_11408.out trace output file. Notice this

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

FUTURE SESSIONS
In the preceding sections, you learned how
to enable tracing in any session, provided
that you know the SID and serial# of that
session. When a new session is created,
however, it may have already performed
some activity by the time you get its SID and
serial# and execute the DBMS_MONITOR_
SESSION.SESSION_TRACE_ENABLE procedure. In that case, the already-performed
activities will not have been captured by
tracing, but these very activities could be
the cause of the performance issues. How
do you capture them? You need to enable
tracing for sessions that do not exist yet,
and the DBMS_MONITOR package provides
a procedure for that.
To enable tracing on sessions that dont
exist yet, you first need to know the service
name the session uses while connecting.
For this example, suppose the service
name is APP. You execute the following
SQL statement:
begin
dbms_monitor.serv_mod_act_trace_enable
(
service_name => APP,
action_name

=> dbms_monitor

waits

=> true,

binds

=> true

.all_actions,

You can exit the session after executing


this SQL statement, but the database
instance will remember the command.
When a new session starts with the service
name APP, the database immediately turns
on tracing for that session automatically
so that all the activities are captured in the
trace file.
CONSOLIDATING TRACE FILES
Most three-tier applications today use
connection poolsgroups of sessions connected to the database. An application uses
any available session from this pool when it
needs database interaction, and it releases
the session when the interaction is done.
If an application needs another database
interaction later, it will use a second session
from the pool. Similarly, a different application may use a session that was used earlier
by another application.
If you want to trace all the activities of
a specific application, you have to enable
tracing in all the sessions the application
may use. You can achieve this by enabling
trace for the service name used by that
application, as explained in the previous
section. However, each session creates
a separate trace file, so you will end up
with many trace files. To understand the
activities of an application, you will need to
analyze all the different session trace files.
And because many applications using the
connection pool may have used the same
session from that pool, a single trace file
may contain the activities of many applications. So to tune an application in this
environment, you have to look at multiple
trace files and filter out the activities of the
application you are tuning from the different files. Manually filtering application
activities from multiple trace files is both
difficult and error-prone.
Fortunately, there is a much simpler way:
Oracle Database comes with a utility called
TRCSESS that extracts only the required
information from all trace files and produces
a single relevant trace file.
To use TRCSESS, go to the directory
where all the trace files are generated and
use the command

);
end;

trcsess

47

output=alltraces.trc service=APP *.trc

This command pulls the activities of all


sessions connected with the service name
APP and creates a file named alltraces.trc
from all the trace files in that directory.
The format of alltraces.trc is exactly like
that of a regular trace file, so you can use
tkprof with this file as an input to produce a
human-readable version.
In the case of an Oracle Real Application
Clusters (Oracle RAC) database, there is
more than one database server, so the trace
files for a load-balanced application might
be generated in many locations. You can
combine the trace files generated on multiple hosts into a single file, using TRCSESS.
TURN OFF TRACING
Tracing generates trace files on the database
server file system, which slows database
processing. Depending on the speed of

the file system, the performance impact


may not be noticeable, but you should turn
tracing off when it is not needed.
To disable tracing for a session, execute
the following:
begin
dbms_monitor.session_trace_disable (
session_id => <SID>,
serial_num => <serial#>);
end;

CONCLUSION
Tracing enables you to capture all the activities performed by the session and the corresponding performance metrics at a very
granular level, which reveals trouble spots
that are otherwise not visible in session-level
metrics. Tuning features and tools enable
you to create human-readable files from
raw trace files and enable tracing on future
sessions, and they help you extract relevant

information from multiple trace files (for use


with connection pools and Oracle RAC).

Arup Nanda (arup@


proligence.com) has
been an Oracle DBA
since 1993, handling
all aspects of database
administration, from
performance tuning to security and disaster
recovery. He was Oracle Magazines DBA of the
Year in 2003 and received an Oracle Excellence
Award for Technologist of the Year in 2012.

NEXT STEPS
READ more on tracing
bit.ly/1zGacmm
READ more Nanda
bit.ly/omagnanda
DOWNLOAD Oracle Database 12c
bit.ly/epBiUG

ORACLE MAGAZINE JULY/AUGUST 2015

Database Application Developer and DBA

ASK TOM BY TOM KYTE

ORACLE DATABASE

On Learning from Mistakes

Our technologist demonstrates how the Oracle Database


optimizer learns and how to help it.

I-HUA CHEN

ve heard you say the optimizer learns from


its mistakes. What do you mean by that?
The optimizer works by estimating how
many rows the various steps in a plan would
produce and, drawing predominantly on that
information, it chooses a plan. (I discussed
this in detail in the November/December
2014 issue of Oracle Magazine, at bit.ly/
asktom_onqt.) After running the plan, the
optimizer has access to what really happened during query executionhow many
rows were actually produced by each step
but historically it has never done anything
with that information. The optimizer would
continue to make the same estimate every
time it optimized that query.
The estimated row count is perhaps the
single most important element of the query
optimization process. The optimizer assigns
costs to the different steps in a plan, based
in large part on row count estimates, and
uses that information to determine access
methods (use an index or do a full table
scan, for example), join methods (use nested
loops or hash joins), and parallel execution
methods (broadcast an entire set of rows
from one layer of execution servers to the
next or distribute them round-robin), to
name a few. If the optimizer guesses wrong
about how many rows will be returned, the
result will often be a bad query plan.
For example, if I told you that your SELECT
* FROM one_billion_row_table WHERE
indexed_column = 5 query would return half
a billion rows, you and the optimizer would
probably choose to use a full table scan. If
upon executing the query, you received only
two rows, you would realize instantly that you
and the optimizer should have used an index.
In earlier database releasesprior to Oracle
Database 11gthe optimizer would not have
realized that it had made a mistake; it would
have stuck with the same full table scan plan
over and over. But as of Oracle Database 11g,

the optimizer may well realize that it has


made a mistake and correct itself. And in
Oracle Database 12c, the optimizer will not
only correct itself but will also remember
persistentlythat it has made a mistake
and continue to correct itself, even after your
query is flushed from the shared pool. And it
will correct other similar queries as well.
Lets see this in action. Ill start by creating a copy of some test data I havethis
data contains city and state names and a row
for each person in that city/stateso there
is a row for each person in a given city/state.
SQL> create table people
2

compress

as

select name city_name,state

5
6

from cities_state
/

Table created.

I am using Oracle Database 12c, so there


are already statistics on this table, as you
can see in Listing 1.
The fact that the NOW column of the
query against USER_TABLES is the same
as the LAST_ANALYZED column shows
that statistics were created as the data
was loadedthis is a new feature of Oracle
Database 12c. Since Oracle Database 10g,
the database has been computing statistics
automatically for indexes when you create or
rebuild them. With Oracle Database 12c, the
database does the same for tables. Further,
as you can see in the example in Listing 1,
there are basic statistics on the columns in
the table as well.
I added a column to the query against the
USER_TAB_COL_STATISTICS THE_GUESS
column. This is the estimate of rows the
optimizer will use if I use that column in an
equality predicate in the WHERE clause.

Code Listing 1: Existing table statistics with Oracle Database 12c


SQL> select to_char(sysdate,'dd-mon-yyyy hh24:mi') now,
2
num_rows num_rows,
3
to_char( last_analyzed, 'dd-mon-yyyy hh24:mi' ) la
4
from user_tables
5
where table_name = 'PEOPLE'
6 /
NOW
NUM_ROWS LA

24-apr-2015 20:13
114,673,091 24-apr-2015 20:13
SQL> select column_name,
2
num_distinct,
3
round(114673091/num_distinct) the_guess,
4
num_nulls,
5
histogram,
6
notes
7
from user_tab_col_statistics
8
where table_name = 'PEOPLE'
9 /
COLUMN_NAM NUM_DISTINCT
THE_GUESS
NUM_NULLS

CITY_NAME
675
169,886
0
STATE
50
2,293,462
0

HISTOGRAM

NONE
NONE

NOTES

STATS_ON_LOAD
STATS_ON_LOAD

ORACLE MAGAZINE JULY/AUGUST 2015

49

50

ASK TOM

Because I have no histograms on either of


my columns yet, the optimizer will assume
that the data is distributed uniformly and the
expected number of rows from WHERE STATE
= something will be the number of rows in the
table divided by the number of distinct values
in the STATE column. When I look at the data
in the STATE column, I quickly see that this
assumption is not true and that the optimizer
guess will be very far off:
SQL> select *
2
3

from (
select state,

count(*) cnt

from people

group by state

order by state

9
10

where rownum <= 5

CNT


Alabama
Alaska
Arizona
Arkansas
California

Oracle Database 10g, the database has been


spying on you and me. It has been watching
your queries and recording the columns you
use in your WHERE clause in the data dictionary. DBMS_STATS can use that information later to determine which columns might
warrant additional inspection in the form of
histograms. (I wrote about that originally in
the May/June 2006 issue of Oracle Magazine,
at bit.ly/asktom_hist1.)
After I gather statistics again, I see a
marked difference in the statistics collected:
SQL> exec dbms_stats.gather_table_stats(
user, 'PEOPLE', no_invalidate=>FALSE );
PL/SQL procedure successfully completed.

Code Listing 2: Plan statistics with serious skew

STATE

rowsinstead. I knew that, but the optimizer didnt. Furthermore, this skew would
happen with other states as well, as shown
in Listing 3.
In this case, given the information it has
access tothe current set of statisticsthe
optimizer underestimates the number of
rows by an order of magnitude. As I pointed
out in my November/December 2014 column,
when the optimizer is off by orders of magnitude, the possibility of a bad plan is very high,
so the skew in Listing 3 is cause for concern.
So, what can you or I do about it? For a
query this simplea single-table query
with a single-column predicateI might
only need to gather statistics again. Since

1,139,854
291,825
4,130,606
667,541
25,145,815

I can see that Alaska has two orders of


magnitude fewer people in this table than
California does, for example. The data is
obviously skewed, but right now the optimizer does not realize that. If I were to query
by using WHERE STATE = something, the
optimizer would guess that it would receive
about 2.3 million rows, where, in fact, it
would receive wildly varying numbers of
rows, depending on the STATE value input
into the query. I can observe this easily, as
shown in Listing 2.
By using the GATHER_PLAN_STATISTICS
hint, I can get additional, extremely useful
information from DBMS_XPLAN; namely,
I can see the E-Rows (how many rows the
optimizer estimated) and the A-Rows (the
actual number of rows processed by the
query) values in the plan output. I was
able to guess that the optimizer would
guess 2.3 million rows (E-Rows), but I knew
that it would actually process an order of
magnitude fewer rowsabout 291,000

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

SQL> select /*+ gather_plan_statistics */ count(*)


2
from people
3
where state = 'Alaska'
4 /
COUNT(*)

291,825
SQL> select *
2
from table
3
(dbms_xplan.display_cursor
4
(format=>'allstats last')
5
)
6 /

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT AGGREGATE
|
|
1 |
1 |
1 |
|* 2 |
TABLE ACCESS FULL| PEOPLE |
1 |
2293K|
291K|

Code Listing 3: Plan statistics for a different state and more skew
SQL> select /*+ gather_plan_statistics */ count(*)
2
from people
3
where state = 'California'
4 /
COUNT(*)

25,145,815

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT AGGREGATE
|
|
1 |
1 |
1 |
|* 2 |
TABLE ACCESS FULL| PEOPLE |
1 |
2293K|
25M|

51

SQL> select column_name,


2

num_distinct,

histogram

4
5
6

from user_tab_col_statistics

(There are a lot more people living in New


York City, New York, than in Anchorage,
Alaska, for example.) But that solves only
some simple cases: predicates involving a

where table_name = 'PEOPLE'

Code Listing 4: Better plan statistics after DBMS_STATS

COLUMN_NAM NUM_DISTINCT HISTOGRAM



CITY_NAME
STATE

If I query the CITY_NAME column, for


example, as shown in Listing 5, I can see
that the CITY_NAME column has a histogram on it as well, because it, too, is skewed.

675 NONE
50 FREQUENCY

This is an early example of learning on


the part of the optimizer. By watching the
predicates used in queries, the optimizer
will learn to inspect those columns when
gathering statistics and will automatically
generate histograms on single columns
used in WHERE clauses that contain skewed
information. That is, DBMS_STATS knew I
used STATE in a WHERE clause, and when it
gathered statistics this second time, it took
the time to inspect the values in the STATE
column, concluded that the data was not
uniformly distributed, and decided to create
a FREQUENCY histogram on the data.
Now, when I query again against STATE
as shown in Listing 4, the estimated cardinalities are going to be much more accurate. Now the E-Rows estimate is very close
to the A-Rows actual values; this is exactly
what I want to see. When the optimizer
estimates the cardinality correctly, the odds
are good that the plan I am looking at is the
right one. (Conversely, if the estimates are
far off, the odds are that I am looking at a
suboptimal plan.)
But that is just the tip of the iceberg. I
still have other columns in that table (the
CITY_NAME column, for example) that
might suffer from the same issue, and I
might also have much more complicated
predicates that the optimizer would have a
hard time estimating. Fixing single-column
estimates is easyI only need to reference
those columns in a predicate and gather statistics with DBMS_STATS. Note that I need
to use the default METHOD_OPT parameter
to enable DBMS_STATS to automatically
determine on which columns to gather
histograms. If I supply a METHOD_OPT=>
some inputs. parameter value, only the
histograms I request will be collected.

SQL> select /*+ gather_plan_statistics */ count(*)


2
from people
3
where state = 'Alaska'
4 /
COUNT(*)

291,825

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT AGGREGATE
|
|
1 |
1 |
1 |
|* 2 |
TABLE ACCESS FULL| PEOPLE |
1 |
291K|
291K|

SQL> select /*+ gather_plan_statistics */ count(*)


2
from people
3
where state = 'California'
4 /
COUNT(*)

25,145,815

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT AGGREGATE
|
|
1 |
1 |
1 |
|* 2 |
TABLE ACCESS FULL| PEOPLE |
1 |
25M|
25M|

Code Listing 5: DBMS_STATS adding another histogram


SQL> select count(*)
2
from people
3
where city_name = 'Anchorage municipality'
4 /
COUNT(*)

291,825
SQL> exec dbms_stats.gather_table_stats( user, 'PEOPLE', no_invalidate=>FALSE );
PL/SQL procedure successfully completed.
SQL> select column_name,
2
num_distinct,
3
num_nulls,
4
histogram,
5
notes
6
from user_tab_col_statistics
7
where table_name = 'PEOPLE'
8 /
COLUMN_NAM NUM_DISTINCT
NUM_NULLS HISTOGRAM
NOTES

CITY_NAME
675
0 HYBRID
STATE
50
0 FREQUENCY

ORACLE MAGAZINE JULY/AUGUST 2015

52

ASK TOM

single column. What about something more


complex and more likely to happen in the
real world? What about a predicate involving
two columns, for example?
The optimizer has a harder job with more
and more-complex predicateseven with
a predicate involving just two columns.
When the optimizer sees a predicate such
as WHERE x = A and y = B, it will default
to simply taking what it assumes to be the
probability of x = A being true (X percent
of the rows being returned) and the probability of y = B being true (Y percent of the
rows being returned) and multiplying them
by each other. So, if x = A is assumed to
return about 1 percent of the rows and y = B
is assumed to return about 1 percent of the
rows, the optimizer will assume that 0.01
percent of the rows will be returned by the
WHERE clause. But what if it were almost
always true that when Y = B and X = A, that
query would return 1 percent of the rows in
the table, not 0.01 percent? (That estimate
would be off by two orders of magnitude.)
This is where the optimizer needs some
assistance or some introspection (selflearning). In Oracle Database 11g, the DBA
could create extended statistics on (X,Y),
enabling the optimizer to know that there
is a relationship between X and Y, but that
presupposes that the DBA knows that those
statistics need to be created. What if this is
a system where the queries are not known
ahead of timesuch as a data warehouse
or a system where the DBA just isnt familiar
with every single query submitted to the
system (and that probably describes almost
every database today)? It would be hard for
the DBA to proactively create these statistics.
Enter the learning optimizeran optimizer that learns from its mistakes. Lets
take a look at what the optimizer would
estimate for a two-column predicate first,
as shown in Listing 6.
I can see that the optimizer estimated
671,000 rows but actually received
8,175,000 rows. It was off by more than
an order of magnitude, even though I have
histograms on the CITY_NAME column and
the STATE column. The problem is that even
though I have a lot of details on the individual columns, I have no information on
the relationship between the two columns.

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Code Listing 6: First estimate on two-column predicate


SQL> select /*+ gather_plan_statistics */ city_name, state, count(*)
2
from people
3
where city_name = 'New York City'
4
and state = 'New York'
5
group by city_name, state
6 /
CITY_NAME
STATE
COUNT(*)

New York City New York
8,175,132

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT GROUP BY NOSORT|
|
1 |
671K|
1 |
|* 2 |
TABLE ACCESS FULL | PEOPLE |
1 |
671K|
8175K|

Code Listing 7: New estimate on two-column predicate reoptimized with statistics feedback
SQL> select /*+ gather_plan_statistics */ city_name, state, count(*)
2
from people
3
where city_name = 'New York City'
4
and state = 'New York'
5
group by city_name, state
6 /
CITY_NAME
STATE
COUNT(*)

New York City New York
8,175,132

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT GROUP BY NOSORT|
|
1 |
8175K|
1 |
|* 2 |
TABLE ACCESS FULL | PEOPLE |
1 |
8175K|
8175K|

Note

- statistics feedback used for this statement

Code Listing 8: Creating SQL plan directives


SQL> exec dbms_spd.flush_sql_plan_directive;
PL/SQL procedure successfully completed.
SQL> select o.subobject_name col_name,
2
o.object_type, d.type, d.state, d.reason
3
from dba_sql_plan_directives d, dba_sql_plan_dir_objects o
4
where d.directive_id = o.directive_id
5
and o.owner = user
6
and o.object_name = 'PEOPLE'
7
order by 1, 2, 3, 4, 5;
COL_NAME

CITY_NAME
STATE

OBJECT

COLUMN
COLUMN
TABLE

TYPE

DYNAMIC_SAMPLING
DYNAMIC_SAMPLING
DYNAMIC_SAMPLING

STATE

USABLE
USABLE
USABLE

REASON

SINGLE TABLE CARDINALITY MISESTIMATE


SINGLE TABLE CARDINALITY MISESTIMATE
SINGLE TABLE CARDINALITY MISESTIMATE

53

In my data set, I have only big cities.


New York City appears only in the state of
New York. By default, the optimizer will
use the probability of CITY_NAME = New
York City being true and multiply that by
the probability of STATE = New York being
true. That will grossly underestimate the
expected number of rows, because the
CITY_NAME in this case implies the state!
Starting in Oracle Database 11g, the
optimizer would recognize this condition. It
would realize that in this query, the E-Rows
and A-Rows columns are very far apart, and
it would reoptimize the query on the next
execution, as shown in Listing 7.
Now I see that the E-Rows and A-Rows
column values are very close to each other.
The optimizer reoptimized the plan with
the actual observed cardinalities, not its
own estimate. I can see that this happened
in the Note section of the plan. (In Oracle
Database 11g, this was called cardinality
feedback, and in Oracle Database 12c, it is
called statistics feedback.)
In Oracle Database 11g, this reoptimizing
capability would fix the New York City/New
York problem, but only for that specific
query and only for as long as that query
existed in the shared pool. If I restarted the
database, gathered statistics, or parsed
a lot of SQL so that the shared pool aged
this query out, the optimizer would have to
relearn this lesson. In Oracle Database 11g,
the optimizers learning process was shorttermthe learning would not last forever.
Starting in Oracle Database 12c, however,
the optimizer learning that takes place not
only is long-term but is also shared across
similar queries. A new capability called SQL
plan directives (bit.ly/dbms_spd) enables the
optimizer to share the knowledge that it is
having a hard time estimating cardinalities
of certain types of predicates and also to alert
DBMS_STATS to gather additional statistics
to help out in the future.
For example, after running the New York
query in Listing 7, the optimizer has learned
that when it attempts to estimate the rows
returned by a predicate in the form WHERE
CITY_NAME = X and STATE = Y, the default
heuristic it usesjust multiplying probabilities by each otheris flawed. The optimizer
needs more information that it can get via

Code Listing 9: Demonstration of SQL plan directive and dynamic sampling


SQL> select /*+ gather_plan_statistics */ count(*)
2
from people
3
where city_name = 'Los Angeles city'
4
and state = 'California'
5 /
COUNT(*)

3,792,620

| Id | Operation
| Name
| Starts | E-Rows | A-Rows |

|
0 | SELECT STATEMENT
|
|
1 |
|
1 |
|
1 | SORT AGGREGATE
|
|
1 |
1 |
1 |
|* 2 |
TABLE ACCESS FULL| PEOPLE |
1 |
5756K|
3792K|

Note

- dynamic statistics used: dynamic sampling (level=2)


- 1 SQL plan directive used for this statement

Code Listing 10: Generating multicolumn, extended statistics


SQL> exec dbms_stats.gather_table_stats( user, 'PEOPLE',
no_invalidate=>FALSE );
PL/SQL procedure successfully completed.
SQL> select column_name,
2
num_distinct,
3
histogram
4
from user_tab_col_statistics
5
where table_name = 'PEOPLE'
6 /
COLUMN_NAM
NUM_DISTINCT HISTOGRAM

CITY_NAME
675 HYBRID
STATE
50 FREQUENCY
SYS_STSJTGBD9HKF9J6ZR#9#ZGT39Y
714 HYBRID
SQL> SELECT extension_name, extension
2
FROM user_stat_extensions
3
WHERE table_name = PEOPLE;
EXTENSION_NAME
EXTENSION

SYS_STSJTGBD9HKF9J6ZR#9#ZGT39Y ("CITY_NAME","STATE")

dynamic sampling (bit.ly/asktom_dynsam).


In Oracle Database 12c, the optimizer will
generate a SQL plan directive in the SGA (it
is eventually written to disk to a persistent
table) that warns all subsequent queries
that use CITY_NAME and STATE together
that they should dynamically sample to get
a better cardinality estimate. I can demonstrate this easily: Ill force any SQL plan
directives I have in memory to disk so I can
query them, as shown in Listing 8.
This SQL plan directive is telling me that

if I use CITY_NAME and STATE together,


I had better use dynamic sampling when
hard-parsing (optimizing) the query,
because there will be a serious cardinality
misestimation if I dont. I can see this
directive in effect by querying a different
CITY_NAME and STATE combination, as
shown in Listing 9.
In my data set, there is just one Los
Angeles city, and it is in California. If the
optimizer had used its default method
of estimating cardinalities, it would have

ORACLE MAGAZINE JULY/AUGUST 2015

54

ASK TOM

underestimated the number of rows coming


backby a large margin. Instead, the Note
section of this plan tells me that the SQL
plan directive said to use dynamic sampling. And because the optimizer did that,
the estimated cardinality (E-Rows) is very
closewithin an order of magnitudeto
the actual cardinality (A-Rows).
In Listing 9, the optimizer has learned
from its mistake in a broad sense. It has corrected an entire class of queriesany query
using CITY_NAME and STATE together
regardless of the value used in the predicate.
It has also learned this across database
restarts, statistics gathering, and so on. This
SQL plan directive persists in the data dictionary and will continue to be used.
Dynamic sampling is a good fix for the
issue at hand, but it is not without cost.
Every time I hard-parse a query to which
a directive applies, the database must do
this extra sampling work. In most cases,

this is nominal overhead, but it is overhead


and something I can avoid. If I had permanenton-diskextended statistics (bit.ly/
dbms_stats) on the column group (CITY_
NAME,STATE), the optimizer wouldnt have
to dynamically collect them. Fortunately, in
Oracle Database 12c, DBMS_STATS will not
only pick up those single-column statistics
as demonstrated previously but will also
generate the multicolumn, extended statistics, as shown in Listing 10.
Over time, the Oracle Database optimizer
has automated many of the things we used
to have to do manually. In Oracle Database
10g, the optimizer started collecting singlecolumn histograms; in Oracle Database
11g, it introduced cardinality feedback (now
known as statistics feedback); and in Oracle
Database 12c, it introduced SQL plan directives, providing much better long-term
memory for things learned over time while
were querying our data.

Tom Kyte is a database


evangelist in Oracles
Server Technologies
division and has worked
for Oracle since 1993. He
is the author of Expert
Oracle Database Architecture (Apress, 2005,
2010, 2014) and Effective Oracle by Design
(Oracle Press, 2003), among other books.

NEXT STEPS
FOLLOW Tom on Twitter
@OracleAskTom
READ more Tom
bit.ly/omagasktom
Expert Oracle Database Architecture,
Third Edition
bit.ly/kyteexpert
DOWNLOAD Oracle Database 12c
bit.ly/epBiUG
LEARN more about Oracle Database 12c
oracle.com/database

Peak Performance for your Oracle Applications

World-Class Managed Services


Today's systems are extremely complex, consisting of many layers of
technology components and business integration services. Cybernoors
technical expertise and holistic methodology ensure your Oracle systems are
managed optimally and proactively in order to ensure maximum performance
and availability. Our proactive monitoring services guarantee potential issues
are quickly identified and resolved before they impact business operations.
Contact Cybernoor to learn more about our managed services.

cybernoor.com

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

925.924.0400

56

IN THE FIELD BY TOM HAUNERT

History, Hyper-Growth, and


the Hunt

The president of ODTUG looks back, looks at growth, and


looks at Kscope.

racle Magazine caught up with Monty


Latiolais, president of ODTUG since
2012 and an Oracle Application Express
focused consultant with Insum Solutions, to
talk about his start in technology, his history
with ODTUG, and scavenger hunts.
Oracle Magazine: How did you get started
in technology?
Latiolais: I took data processing in high
schoolwith punch cards. I was immediately
attracted to the discipline and the precision
that was required in programming, and at the
same time, I saw that tremendous creativity
could be brought to bear on a solution. After
that first taste of programming, I really knew
what I wanted to do with my life.
College included more punch cards as
well as mainframe and minicomputers, and
I got my degree in business with applied
computer science. After college, I started
working with dBase and FoxBase and some
small PC databases. And then soon after, I
discovered Oracle Database, and I never left.
Oracle Magazine: How did you get started
with ODTUG?
Latiolais: About 15 or 20 years ago I was
doing Oracle Reports development, and
I stumbled across a copy of the ODTUG
Technical Journal. I was struck by how technical it wasit was all about the code. And
at that time, it was information that I really
couldnt get anywhere else. The ODTUG
Technical Journal led me to get on the
ODTUG mailing list, and then I attended my
first ODTUG conference in 2006. In 2009, I
was asked to serve on the conference committee; later that year, I won a seat on the
board of directors; and in 2012, I assumed
the presidency of ODTUG.
Oracle Magazine: What is the mission
of ODTUG, and what is your mission as
ODTUG president?

JULY/AUGUST 2015 ORACLE.COM/ORACLEMAGAZINE

Since I started
working with
the organization
[ODTUG], weve
basically tripled
in size.
Monty Latiolais, ODTUG President

Latiolais: The mission of ODTUG is to


establish members as leaders in the organization through education, provide timely
access to the latest information, coordinate
communication and networking within the
community, and present a united voice to
influence the strategic direction of Oracle
and other vendors. I feel like my role as
president is really to keep the train on the
tracks. We listen to our members and conference attendees, and they continue to
influence and direct our course.

Oracle Magazine: How has ODTUG evolved


since you started participating in the group?
Latiolais: Since I started working with the
organization, weve basically tripled in size.
Over the years, Oracle has acquired companies and expanded, and ODTUG has had to
expand with it and broaden its scope. The
biggest Oracle acquisition with respect to
ODTUG was the purchase of Hyperion.
ODTUG continues to focus on Kscope,
but weve also added a series of one-day
events that are free to our members.
Oracle Magazine: Speaking of Kscope,
Kscope15 wrapped in June. Tell us about this
years conference.
Latiolais: The good news for all our members
who couldnt attend is that we videoed each
and every session, and they are all available
to our members on the ODTUG website.
Outside of sessions, networking activities, the volunteer event, and the 5K run,
one of the most interesting and different
events of Kscope15 was a high-tech scavenger hunt. ODTUG partnered with the
Oracle UX team, and together we had a scavenger hunt featuring some IoT [Internet of
Things] technology. We used a combination
of clues, NFC [near field communication],
Raspberry Pi, Twitter, web-based check-in
using Oracle Application Express, and more.
It was a lot of fun, and it was a great partnership between the Oracle UX team and
ODTUG. It was very successful, and I would
not be surprised if we do something similar
in the years to come.

NEXT STEPS
LEARN more about ODTUG
odtug.com
READ more Latiolais
montylatiolais.blogspot.com

PAUL S. HOWELL

Oct. 2529, 2015


San Francisco

REGISTER NOW

Save $500 by Aug. 16


Education, Conversation, and Inspiration
Cloud

Applications

Platform

as a Service

Engineered

Systems

Big Data & Analytics

Security
Mobile

Register at oracle.com/openworld
Copyright 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates.

Global Sponsor

Innovation Sponsor

Premier Sponsors

Grande Sponsor

You might also like