Oracle Beats EMC, NetApp Storage Magazine Quality Awards

#1 in Quality #1 in Features #1 in Reliability #1 in Support #1 Overall

oracle.com/storage

Source: Storage Magazine, January 2012 issue, network attached storage.

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Oracle and are registered trademarks of Oracle and/or its affiliates.

omg0712pCov4.indd 1 5/30/12 1:12 PM

PUB NOTE: Please use center marks to align page. Print Ad Job No.: 412M_STO_QualityAwards PRODUCTION NOTES READER LASER% RELEASED Headline: Oracle Beats EMC, NetApp - STO Mag... Date: 05/10/2012 Project: Master Print Ad 5/10 Type: Magazine 01 2012 7.875” x 10.5” Live: 7.375” x 10” Trim: 7.875”x 10.5” Please examine these publication materials carefully. Full Page Master Bleed: 8.625”x 11.25” Any questions regarding the materials, Fonts: Univers LT Std. 75 Black, 65 Bold, 55 Roman/Oblique, 45 Light, please contact Darci Terlizzi (650) 506-9775 67 Bold Condensed, 57 Condensed JULY/AUGUST 2012

The Business of Analytics Oracle unveils analytics strategy and releases new EPM, Endeca, and analytics applications / 19 Virtually Everywhere Oracle Virtual Desktop Infrastructure 3.4 delivers secure desktop access / 21 Working with Collections Part 8 in a series of articles on understanding and using PL/SQL / 45 A Function of Character Part 6 in a series on the basics of the relational database and SQL / 57 On Characters, Pivots, and Endings Our technologist substitutes characters, looks at fi shy results, and avoids redo / 62

LOCKDOWN Oracle Database Security solutions deliver layers of enterprise information protection Future-proof Choose the best of today’s tools to build next-generation Oracle Database applications Engineered for Backup Sun ZFS Backup Appliance delivers 20 TB/hour of full backup for Oracle engineered systems

JA12_Cover_R1.indd 1 6/4/12 11:03 AM omg0312pCov2_p001.indd 2 2/7/12 1:30 PM omg0312pCov2_p001.indd 3 2/7/12 1:30 PM 2 FEATURED CONTENT VOLUME XXVI - ISSUE 4 CONTENTS

LOCKDOWN /30 Companies spend billions of dollars each year securing their IT systems worldwide, including software, services, and support. Despite these massive investments, attacks have continued, and the attackers—with the help of social engineering and sophisticated automated tools—have continued to succeed. Two-thirds of sensitive and regulated data resides in databases, and unless the databases are protected using a multilayered security architecture, that data is at risk. Learn how Oracle Database security solutions, including Oracle Database Firewall, Oracle Advanced Security, and Oracle Database Vault, mitigate that risk by addressing potential threats from outside and inside the database. —By David Baum

Cover: I-Hua Chen

Future-Proof / 36

The next platforms for application delivery are here, and users are demanding a rich and portable experience on these rapidly evolving devices. Application developers are now creating rich applications that need to work on everything from the corporate desktop to smartphones and tablets. Development tools must enable rapid application development to reach new devices quickly, and the tools must deliver a full-featured user experience to all devices. Read how three organizations are using Oracle databases and database development tools to deliver feature-rich applications fast to the latest platforms and devices. —By David A. Kelly

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_TOC_R1.indd 2 6/4/12 11:06 AM B:8.5” T:7.75” S:6.75”

It’s not just a wool cap. It’s an opportunity. Opportunities are created and protected in the AT&T network. In here, vendor access is secure. Communications are simple and safe. Retail transactions are protected — online and in-store. As demand spikes, stores and suppliers can react instantly. From any device, anywhere in the world, buyers can contact suppliers securely to get what they need overnight. In here, a wool cap goes from “nice” to “phenomenal” in one season. To learn more, visit att.com/business B:11.125” S:9.25” T:10” GLOBAL GLOBAL NEW TREND PHENOMENON

Download the free scanner app at http://scan.mobi and scan this code to learn more. © 2012 AT&T Intellectual Property. All rights reserved. AT&T, the AT&T logo and all other AT&T marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affi liated companies.

omg0712p003.indd 1 Corrected materials. This is latest file 4/26/12 5/30/12 11:49 AM

This advertisement was prepared by BBDO New York Filename: P25736_ATT_ENT_V1.indd CLIENT: AT&T Proof #: 1 Path: Studio:Volumes:Studio:MECHANIC... Created: 4-26-2012 10:32 AM PRODUCT: Enterprise 2012 Print- Wool Hat Mechanicals:P25736_ATT_ENT_V1.indd Saved: 4-26-2012 11:41 AM JOB#: P25736 Operators: Young, Michael / Casanova, Joe Printed: 4-11-2012 3:45 PM SPACE: Full Page: 4/C Print Scale: 100% BLEED: 8.5” x 11.125” TRIM: 7.75” x 10” Fonts Ink Names SAFETY: 6.75” x 9.25” Omnes (Regular), Helvetica Neue (47 Light Condensed), Optima Cyan GUTTER: None (Regular) Magenta PUBS: None Graphic Name Color Space Eff. Res. Yellow Black ISSUE: 5/1/12 ATT_Hat_V_Mar7_CMYK.tif (CMYK; 475 ppi), ATT_WoolHat_QR.eps, TRAFFIC: Dottie Gallardo att_rp_hz_cmyk_grd_white_bigR.ai, at&t ent single_4 lines_hat ART BUYER: None 2-LOWER-OVERLAPPING_V6.ai ACCOUNT: None RETOUCH: None PRODUCTION: Mike Musano ART DIRECTOR: Marc Klien COPYWRITER: None 4 DEPARTMENTS VOLUME XXVI - ISSUE 4

Up Front / 6

FROM THE MASHUP / 8 EDITOR / 6 News, views, trends, A Convenient Truth and tools —Tom Haunert

At Oracle / 11

EVENTS / 11 RESOURCES / 13 NEWS / 19 INTERVIEW / 21 Find out about upcoming Your guide to Oracle The Business of Virtually Everywhere technology and industry Webcasts, podcasts, white Analytics Oracle Virtual Desktop events. papers, and more Oracle unveils analytics Infrastructure 3.4 enables BRIEFS / 16 strategy and releases EPM, secure desktop access from analytics, and Oracle Endeca The latest product almost anywhere. products. —Fred Sandsmark —Rich Schwerin

Community / 24

PARTNER NEWS / 24 COMMUNITY ARCHITECT / 28 PEER-TO-PEER / 29 BOOK BEAT / 24 BULLETIN / 27 Catching Up to Immersion Learning Bring the Noise Mobile Computing Johannes Ahrends, Wissem Passion and participation Mobile computing presents Elkhlifi, Stewart Bryson drive the Oracle Technology challenges and opportunities —Blair Campbell Network Architect for architects. —Bob Rhubart Community.—Bob Rhubart

Technology / 41

ORACLE ADF / 41 PL/SQL 101 / 45 TUNING / 51 SQL 101 / 57 ASK TOM / 62 Service, Please! Working with Collections Beginning Performance A Function of Character On Characters, Pivots, Integrate Web services with Part 8 in a series on Tuning Part 6 in a series on the and Endings Oracle ADF and Business understanding and using Resolve session performance basics of the relational Our technologist substitutes Components applications. PL/SQL —Steven Feuerstein issues in Oracle Database. database and SQL characters, looks at fishy —Frank Nimphius —Arup Nanda —Melanie Caffrey results, and avoids redo. —Tom Kyte

Comment / 67

IN THE FIELD / 67 ANALYST’S Testing Makes Perfect CORNER / 68 Successful application The Best Defense upgrade testing combines Database security tools leadership, preparation, and protect your data at multiple great people. —Mark C. Clark levels. —David Baum

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_TOC.indd 4 5/24/12 4:16 PM 5

Editorial Publishing Editor in Chief Publisher Tom Haunert [email protected] Jeff Spicer [email protected] Senior Editor Production Director and Associate Publisher Caroline Kvitka [email protected] Jennifer Hamilton [email protected] +1.650.506.3794 Managing Editor Senior Manager, Audience Development and Operations Jan Rogers [email protected] Karin Kinnear [email protected] +1.650.506.1985 Contributing Editor and Writer Blair Campbell Advertising sales Associate Publisher Editor in Chief, Oracle Technology Network Kyle Walkenhorst [email protected] +1.323.340.8585 Justin Kestelyn [email protected] Northwest and Central U.S. Technology Advisor Tom Cometa [email protected] +1.510.339.2403 Tom Kyte Southwest U.S. and LAD Contributors Shaun Mehr [email protected] +1.949.923.1660 Marta Bright, Jeff Erickson, Fred Sandsmark, Rich Schwerin, Leslie Steere Northeast U.S. and EMEA/APAC DESIGN Mark Makinney [email protected] +1.805.709.4745 Senior Creative Director Recruitment Advertising Francisco G Delgadillo Tim Matteson [email protected] +1.310.836.4064 Senior Design Director Mailing-List Rentals Suemi Lam Contact your sales representative. Design Director Richard Merchán Resources Oracle Products Contributing Designers +1.800.367.8674 (U.S./Canada) Jaime Ferrand, Chris Strach Oracle Services Production Designers +1.888.283.0591 Sheila Brennan, Kathy Cygnarowicz Oracle Press Books Editorial Board oraclepressbooks.com Ian Abramson, Karen Cannell, Andrew Clarke, Chris Claterbos, Karthika Devi, Kimberly Floss, Kent Graziano, Taqi Hasan, Tony Jambu, Tony Jedlinski, Copyright © 2012, Oracle and/or its affiliates. All Rights Reserved. No part of this publication Ari Kaplan, Val Kavi, John King, Steve Lemme, Carol McGury, Sumit Sengupta, may be reprinted or other­wise reproduced without permission from the editors. ORACLE MAGAZINE Jonathan Vincenzo, Dan Vlamis 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 Subscription Information OF ANY KIND ARISING FROM YOUR USE OF OR RELIANCE ON ANY INFORMATION PROVIDED Subscriptions are complimentary for qualified individuals who complete the HEREIN. The information is intended to outline our general product direction. It is intended for subscription card found in each issue or online at oracle.com/oraclemagazine. information purposes only, and may not be incorporated into any contract. It is not a commitment For change of address, mail in label with the new address to: Oracle Magazine, to deliver any material, code, or functionality, and should not be relied upon in making purchasing P.O. Box 1263, Skokie, IL 60076-8263. decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks Magazine Customer Service of and/or its affiliates. Other names may be trademarks of their respective owners. [email protected] Fax +1.847.763.9638 Phone +1.847.763.9635 Oracle Magazine (ISSN 1065-3171) is published bimonthly with a free subscription price by: Oracle, Privacy 500 Oracle Parkway, MS OPL-3C, Redwood City, CA 94065-1600. Periodicals Postage Paid at Oracle Publishing allows sharing of its mailing list with selected third parties. Redwood City, CA, and additional mailing offices. • POSTMASTER: Send address changes to: Oracle If you prefer that your mailing address or e-mail address not be included in this Magazine, P.O. Box 1263, Skokie, IL 60076-8263. program, contact Customer Service at [email protected]. Printed by Brown Printing

Oracle PRODUCT INDEX Product Name Page Product Name Page Product Name Page AutoVue 17 Oracle Endeca Information Discovery 19 Oracle SPARC SuperCluster 13 Java Platform, Enterprise Edition 13 Oracle Exadata Database Machine 13, 14, 26, 29 Oracle Spatial 36 Java Platform, Standard Edition 18 Oracle Exalogic Elastic Cloud 25 Oracle Supply Chain and Order Management 18 Analytics for SAP JavaFX 16 Oracle Exalytics In-Memory Machine 24 Oracle Virtual Desktop Infrastructure 21 JavaFX Software Development Kit 18 Oracle Fusion Applications 14 Oracle VM VirtualBox 21 JD Edwards EnterpriseOne solutions 17 Oracle Fusion Sales 18 Oracle WebCenter 13 MySQL 16, 36 Oracle GoldenGate 13 Oracle WebLogic 13 Oracle Advanced Analytics 16 Oracle Hyperion Financial Close Management 19 Oracle WebLogic Server 13, 16 Oracle Advanced Security 30 Oracle Hyperion Planning 19 Oracle Workspaces 36 Oracle Application Development Framework 41 Oracle Hyperion Project Financial Planning 19 Pillar Axiom 600 13 Oracle Application Express 36 Oracle JDeveloper 41 SPARC SuperCluster T4-4 14 Oracle ATG Web Commerce 24 Oracle 16, 17, 27 SPARC T4 servers 14 Oracle Automatic Storage Management 29 Oracle Manufacturing Analytics 16 StorageTek Tape Analytics 18 Oracle Coherence 13 Oracle Business Intelligence 29 6000 13 Enterprise Edition Oracle Data Integration 13 Oracle Procurement and Spend Analytics for SAP 18 Sun Blade X6270 M3 server 25 Oracle Data Integrator 13 Oracle Real Application Clusters 29 X4170 M3 server 14, 25 Oracle Data Integrator Application Adapter 16 Oracle RightNow CX Cloud Service 18 Sun Fire X4270 M3 server 14, 25 for Hadoop Oracle Data Provider for .NET 36 Oracle Secure Global Desktop 21 Sun x86 servers 17 Oracle Database 29, 30, 36, 45, 51, 57, 62 Oracle Social Network 13 Sun ZFS Backup Appliance 16 Oracle Database Firewall 30 14 Sun ZFS Storage Appliance 13 Oracle E-Business Suite 25, 26

oracle magazine July/August 2012

JA12_TOC.indd 5 5/24/12 4:16 PM 6 From The Editor

A Convenient Truth The Web is stored in tables, and that’s good news.

he recent Computerworld article “10 as well as for storage and access to various T Hard Truths for Software Developers” types of information for years. For internal (bit.ly/J8RKme) described “10 aspects of projects, I’ve used relational database tables programming developers must learn to live in situations where I first did not understand with.” The hard truths of the article included how using tables would help, but in each information about the process of developing case the truth was that using the tables was and maintaining code, the people involved convenient and definitely added value to in and affected by code development, and both the process and the result. software development technologies. The second item on this list of hard truths In This Issue was this: most of the Web is just data stored An important truth about some tables, in tables. For me, however, hard truth #2 was specifically Oracle Database tables, is that anything but difficult, and in fact, it was the there are multiple layers of security designed best news in that article. specifically to protect table information from both outside and inside threats. “Lockdown” The Truth About Tables (page 30) describes various Oracle Database The Computerworld article gives examples of security solutions that encrypt, lock, and the many types of information contained in mask the information in Oracle Database tables on the Web and points out that pro- tables. One product, Oracle Database gramming languages have developed features Firewall, monitors activity on the network to specifically for working with information in help prevent unauthorized access, SQL injec- tables. The hard part of the “data stored in tions, privilege or role escalation, and other tables” truth presented in the article appears external and internal attacks. to be that tables are not new, but rather are Supporting the excellent truth that the years-old constructs that have organized the Web is data stored in tables, “Future-Proof” information of the internet in clearly defined (page 36) describes Oracle database prod- structures. The article also points out that ucts and database development tools used at NoSQL is new, but the hard truth there is that three organizations to manage information NoSQL is also about data in tables. in database tables for sophisticated Web and To me, the fact that most of the Web is mobile device applications. The solutions Next Steps data stored in tables is fantastic. The down- include a custom application for customer side to that truth is that only most of the Web relationship management, a geospatial READ is in tables. And as for the hard truth that even application, and an e-mail marketing appli- “10 Hard Truths for Software Developers” a newer technology like NoSQL works with cation, working with table data in Oracle bit.ly/J8RKme data in tables, I see only benefit in adding new Database and MySQL and using Oracle READ more about Oracle Database security capabilities for the structures that already Application Express and Oracle Data Provider oracle.com/us/products/database/security/ contain most of the information of the Web. for .NET development technologies. overview Like many people, I’ve counted on Oracle developer tools tables—on the Web and in intranet applica- Tom Haunert, Editor in Chief oracle.com/technetwork/developer-tools tions—for Web transactions and interactions [email protected]

CONNECT: bit.ly/aVgo69 bit.ly/orclmagfb twitter.com/oraclemagazine linkd.in/orclmag

July/August 2012 Oracle.com/oraclemagazine

JA12_ednote.indd 6 5/24/12 11:27 AM Your Destination for oracle anD Java expertise Written by leading technology professionals, Oracle Press books offer the most definitive, complete, and up-to-date coverage of Oracle products and technologies available.

peoplesoft peopletools Data Management and upgrade Handbook Paula Dean Implement proven strategies for the PeopleSoft PeopleTools data management and upgrade process.

oracle exalogic elastic cloud Handbook Tom Plunkett, TJ Palazzolo, and Tejas Joshi Plan and deploy a reliable, secure, highly available cloud solution.

oracle solaris 11 system administration: the complete reference Michael Jang, Harry Foxwell Master the skills needed to administer the new release of this powerful operating system.

oca Java se 7 programmer i study Guide Edward Finegan, Robert Liguori Get complete coverage of all objectives for exam 1Z0-803 plus challenging practice exam questions.

Available in print and eBook formats Join the Oracle Press Community: www.OraclePressBooks.com Follow us: @OraclePress

omg0712p007.indd 1 5/30/12 12:49 PM 8 MashUp News. Views. Trends. Tools.

12 percent1 of U.S. smartphone owners use check-in apps—geosocial services “The average that allow them to announce where they are. Here are our favorites. employee Facebook Foodspotting foursquare Yelp spends about 15 Its huge user base Don’t just check in More than 20 With 66 million hours a month makes Facebook’s at a restaurant— million people users and 25 complaining check-in capability, check in and worldwide use million reviews of about his or her called Places, hard snap pictures of this app to check local businesses manager. That’s

CHECK-IN APPS CHECK-IN in North America to beat. This app the dishes you in at restaurants basically 24 lets you tell people love. Share and and other and Europe, Yelp where you’ve been, search for favorite businesses, get lets users compare days a year, a where you are right foods by location, recommendations, and share opinions full month of now, and where you with maps. Free connect with on the places workdays, grumbling and getting are going. You can (iPhone, Android, friends, and they go. Free nothing done. Right now employee also check in other BlackBerry, score special (iPhone, Android, teams and entire organizational Facebook users. Windows Phone). discounts. Free BlackBerry, Palm, cultures around the world are Windows Phone). Free (iPhone, foodspotting.com (iPhone, Android, crumbling from misunderstanding Android). BlackBerry, Nokia, yelp.com facebook.com Palm, Windows and neglect.” Phone). —Adrian Gostick and Chester Elton, foursquare.com authors of All In (Free Press, 2012) STRESSED? UNDER YOU’RE NOT ALONE Ready to quit? 67% of IT administrators have SURVEILLANCE considered switching careers because of Setting up a home or office video surveillance system stress. More than 200 IT is no small undertaking. Dropcam is trying to change administrators in U.S. organizations with 10 to 500 that with Dropcam HD, a small monitoring camera that employees were surveyed. takes minutes to set up, is Wi-Fi enabled, and streams Source: GFI Software and Opinion Matters, bit.ly/KrfnWQ video to the cloud. With an account on dropcam.com, you can peek at live or recorded video using a computer Security Threats Rising or smartphone. Dropcam streams 720p HD video and has an 80-degree viewing angle. Cool features include 83% of business and IT executives surveyed believe information security threats are on the rise. And 70% infrared LEDs that let Dropcam HD see in complete rated security as a higher or upper-level priority in darkness, and two-way audio so that you can actually 2011, compared to 49% in 2010. Five hundred U.S. IT hold a conversation with a person on camera from your and business executives who set or implement infor- smartphone or PC. US$149; viewing plans range from mation security policies and processes were surveyed free to US$29.95/month. dropcam.com online in November and December 2011. Source: CompTIA’s Ninth Annual Information Security Trends study, comptia.org SECURITY TOPS MOBILITY CONCERNS A survey of 500 business and IT professionals in a variety of industries in the U.S. revealed that for 70 percent of respondents, security considerations are the greatest risk involved in supporting mobility. Respondents cited these concerns: WRITE ON Typing on the iPad’s native 48% Downloading unauthorized apps keyboard is possible, but it’s 42% Lost or stolen devices not the most comfortable 41% Mobile-specific viruses and malware thing to do. Plus, the native key- 41% Open Wi-Fi networks board covers half the screen, leaving 40% USB flash drives very little real estate for you to work with. 40% Personal use of business devices Logitech’s Ultrathin Keyboard Cover with Bluetooth technology addresses these issues and also doubles as an elegant Source: CompTIA’s Trends in Enterprise Mobility study, comptia.org and sturdy aluminum iPad cover. Thanks to a clever magnetic clip, the keyboard quickly attaches to the iPad. A built-in slot right YOUR What mobile-related security concerns keep above the keys lets the iPad stand at the optimal angle for reading TURN you up at night? Take our Facebook poll at or typing. The keyboard has a great feel when you are typing on bitly.com/oraclmagfb. it, and it makes functions such as text highlighting, copying and

pasting, and searching a breeze. US$99. logitech.com CHRIS STRACH

1 pewinternet.org/reports/2011/rocation/overview.aspx

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_MashUp.indd 8 5/21/12 12:31 PM ddqt_dance_oracle_jul11_8x10.aiqt_dance_oracle_jul11_8x10.ai 1 66/16/2011/16/2011 33:35:29:35:29 PPMM

C

M

Y

CM

MY

CY

CMY

K 12711 NGS Education Ad_Select 1_Layout 1 8/30/11 12:26 PM Page 1

National Geographic Education supports the mission of the National Geographic Society to TOGETHER ORACLE AND inspire people to care about the planet by NATIONAL GEOGRAPHIC EDUCATION ARE creating compelling educational materials for young people and the adults who teach them. NG Education provides unique learning Leading the Way experiences to educators and advocates for improved education in geography, the in Ocean Education environmental sciences, and other disciplines that are critical to understanding our world.

and Marine Research 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 Events 11

Technology Events Oracle User Groups Sacramento Java Users Group Meetings Conferences and sessions to help you stay July 10 and August 14, Sacramento, California on the cutting edge sacjug.org Ohio Oracle Users Group Meeting July 19, Columbus, Ohio InSync12: Quest Australia ooug.org PackerLand Users Group Meeting and New Zealand Users July 19, Green Lake, Wisconsin Conference questdirect.org/events/2464800 August 21–23, Melbourne, Victoria, Australia Southwest Regional Oracle Applications User Group Conference The independent Oracle user groups in Australia come July 20, Irvine, California together to present a comprehensive conference on sroaug.com Oracle applications, middleware, and Oracle database Michigan Oracle Users Summit technology. More than 100 speakers from Australia Golf Outing and abroad, including Oracle employees, developers, July 23, Plymouth, Michigan and users, will deliver keynotes and sessions. mous.us/golf.html insync-conference.com.au/blog Higher Education User Group Regional Conferences July 25, Arlington, Texas August 8–9, Naperville, Illinois AACE International Annual Meeting (STOAUG), and the OAUG Upgrade Special heug.org July 8–11, San Antonio, Texas Interest Group collaborate to present two days of fwww.aacei.org/am/currentam technical sessions on Oracle E-Business Suite Austin Java Users Group Meetings July 31 and August 28, Austin, Texas The American Association of Cost Engineers will Release 12.1 and Oracle Fusion Applications. austinjug.org gather for technical sessions, exhibits, talks, and networking events. The No Fluff Just Stuff Software Oracle Transportation Management User Conference Symposium Tour August 12–15, Philadelphia, Pennsylvania OR2012: The 7th International July 13–14, Columbia, Maryland otmconference.com Conference on Open Repositories July 20–22, Austin, Texas Credit Research Foundation Oracle July 9–13, Edinburgh, Scotland August 3–5, Des Moines, Iowa Users Group Meeting for2012.ed.ac.uk fnofluffjuststuff.com Held at the Credit and Accounts Receivable With the theme “Open Services for Open The No Fluff Just Stuff Software Symposium Open Forum and Expo August 13–15, Chicago, Illinois Content: Local In for Global Out,” this conference Tour covers the latest trends within the Java crfonline.org/events/august/august.asp covers open and augmented content, distributed ecosystem and agility space. systems, and data delivery infrastructures. It Oregon and Southern Washington Oracle Users Group Meeting features general conference sessions and open Gartner Security and Risk August 14, Portland, Oregon user group meetings. Management Summit oswoug.org July 16–17, Sydney, Australia North Central Oracle Apps User Group TechNet Land Forces—South 2012 fbit.ly/IcieoK Training Day July 10–12, Tampa, Florida This event is for IT and business executives August 17, Oakbrook Terrace, Illinois fafcea.org/events/tnlf/south12/intro.asp responsible for creating, implementing, and ncoaug.org At this forum for the U.S. Army and Marine Corps managing a proactive and comprehensive Rocky Mountain Oracle Users Group as well as Department of Defense, Navy, Air Force, strategy for information security, risk manage- Quarterly Education Workshop and Coast Guard security forces, discussions ment, governance, business continuity manage- August 17, Littleton, Colorado rmoug.org focus on technology issues related to joint and ment, and business resiliency. coalition land warfare and U.S. border protection. Southern California Oracle Users Group O’Reilly OSCON Open Source Quarterly Meeting August 21, location to be announced OAUG Connection Point Convention socoug.org July 11–12, Austin, Texas July 16–20, Portland, Oregon fconnectionpoint.oaug.org/2012/Austin foscon.com KC R Users Group Meeting August 25, Kansas City, Missouri The Oracle Applications Users Group (OAUG), More than 3,000 developers, open source groupspaces.com/kcrusersgroup

G ett y I mages the South Texas Oracle Applications Users Group experts, businesspeople, investors, and vendors

oracle magazine July/august 2012

JA12_events.indd 11 5/21/12 10:14 AM 12 Events

Enkitec Extreme Exadata Expo (E4) August 13–14, Dallas, Texas fenkitec.com This two-day gathering is designed for technical directors who already have an Oracle Exadata Database Machine, as well as those who are considering one. A working Oracle Exadata system will be onsite, and experts will explore all facets of working with the engineered system.

XChange August 19–22, Dallas, Texas xchange-events.com/x12 Big data is a top agenda topic at TDWI World Conference in San Diego, California, July 29–August 3. f More than 250 solution providers from the U.S. and Canada will view demonstrations of new will converge for hundreds of sessions on open sessions on desktop and application virtualiza- products, services, and solutions from leading IT source languages and platforms. An exposition, tion, plus live demos and networking opportuni- vendors. One-on-one appointments and small “birds of a feather” sessions, and social events ties. Attendance is limited to 325 attendees. group vendor meetings are available. are also on the agenda. NACUBO 2012 Annual Meeting Medicaid Enterprise Systems NASPE 2012 Annual Meeting July 28–31, Washington DC Conference July 22–25, Jersey City, New Jersey fnacuboannualmeeting.org August 19–23, Boston, Massachusetts fbit.ly/JX9sfC The National Association of College and fmesconference.org The National Association of State Personnel University Business Officers’ 50th annual This conference brings together thought leaders Executives conference includes speakers and meeting offers a variety of education sessions from the public and private sectors to share roundtable discussions, as well as sessions on IT, for professionals in college and university busi- ideas and information related to Medicaid healthcare, retirement trends, performance mea- ness offices. systems and initiatives. surement, and working with the media. NASBO 2012 Annual Meeting Air Force Information Technology Sales 2.0 Conference July 29–August 1, Providence, Rhode Island Conference July 23, Boston, Massachusetts fbit.ly/ICMpGk August 27–29, Montgomery, Alabama fsales20conf.com/boston2012 The National Association of State Budget Officers fafitc.gunter.af.mil Leaders of sales, marketing, and related groups gathers to hear expert speakers discuss the More than 5,000 active duty, guard, reserve, will learn to balance people, process, and tech- economy, state revenues, healthcare reform, and and civilian personnel will discuss how hard- nology to improve overall organizational effec- other pertinent topics. ware, software, and services are used to aid the tiveness at this conference. national defense and intelligence communities. TDWI World Conference BriForum July 29–August 3, San Diego, California LinuxCon North America July 24–26, Chicago, Illinois ftdwi.org August 29–31, San Diego, California fbriforum.com/US With the theme “Big Data Tipping Point,” this fbit.ly/KqjXW7 This gathering features more than 40 technical conference will look at how the internet, social This annual conference focuses on collabora- media, and streaming data are fundamentally tion and education for the Linux community. It REGister for these upcoming Oracle events changing data warehousing and business intel- includes colocated, topic-specific minisummits Oracle OpenWorld 2012 ligence as we know it. and workgroups, including the Linux Kernel September 30–October 4 oracle.com/openworld Summit and the Linux Plumbers Conference. JavaOne TASSCC Annual Conference September 30–October 4 August 12–15, Arlington, Texas oracle.com/javaone MySQL Connect fbit.ly/HOuZoc Events locator September 29–30 Join the Texas Association of State Systems for oracle.com/mysqlconnect Computing and Communications for a confer- Oracle Events Oracle Customer Experience Summit oracle.com/events @ OpenWorld ence focusing on the challenges and opportuni-

October 3–5 Locate User Groups mages

ties faced by public sector IT professionals in the y I oracle.com/cxsummit bit.ly/IjxKyc ett

Lone Star State. G

July/august 2012 Oracle.com/oraclemagazine

JA12_events.indd 12 5/21/12 10:14 AM Resources 13

What’s New at Oracle The latest videos, podcasts, blogs, and more

WEBCASTS CALCULATOR Server Consolidation with Oracle SPARC “2012 OAUG Survey on Cloud Applications” Database Storage Management ROI SuperCluster fbit.ly/HZUBic Calculator fbit.ly/JGVRsH Hear about the key findings from this recent fbit.ly/Iwso4T See why Oracle SPARC SuperCluster provides an Oracle Applications Users Group (OAUG) survey. See how much you can save with Oracle Database ideal platform for server consolidation. 11g and compression technologies. Webcast Series: Social Business Oracle Fact Finders, Episode 1: Managing Thought Leaders RESOURCE CENTERS Storage Systems foracle.com/goto/socialbusiness Big Data Essentials fbit.ly/K74ha1 This series features perspectives about social foracle.com/goto/bigdata Learn how to simplify your storage with Sun tools and the changing workplace. Learn the essentials of big data, from underlying ZFS Storage Appliance. technology to real-world use cases. “Real-Time Data Integration for Next- Oracle SPARC SuperCluster: An Overview Generation Data Warehousing” Oracle Linux Online Forum fbit.ly/Idyuat fbit.ly/JYyurX fbit.ly/H0GcSz Get an overview of the technical and business Discover how Oracle Data Integration products Oracle Linux experts and Progressive Insurance’s advantages of Oracle SPARC SuperCluster. reduce complexity and cost. John Dome discuss implementation of Oracle Linux to increase database performance. Oracle’s Pillar Axiom 600 Hybrid “Zero Downtime System Upgrades and Columnar Compression Migrations Using Oracle GoldenGate” Automate Invoice Processing Operations fbit.ly/IgY7Zc fbit.ly/I9aOqb fbitly.com/HepsYf Learn how Oracle’s Pillar Axiom 600 Hybrid Learn how Oracle GoldenGate’s data replica- Learn how businesses such as the Home Depot, Columnar Compression delivers efficiency and tion capabilities can eliminate downtime during Costco, and Texas Industries have benefited from performance for storage-area network solutions. upgrade, migration, and consolidation projects. Oracle WebCenter. Oracle Social Network video series “Maximize ROI for Data Warehousing” Oracle WebCenter fbitly.com/JlV4JL fbit.ly/ICyr6A fbitly.com/HeCs4u Discover how to use Oracle Social Network for See how to achieve 20 times higher performance Find out how your organization can increase effective sales interactions, file sharing, and data with Oracle Data Integrator on Oracle Exadata. collaboration with Oracle WebCenter portals. access through mobile devices.

Oracle WebLogic DevCast Series SOCIAL MEDIA Orbitz Consolidates OLTP Applications onto foracle.com/goto/weblogicdevcast Oracle Value Chain Execution Oracle Exadata This Webcast series explores the ways that you fon.fb.me/JGV8Yv fbit.ly/ISrrBI can accelerate time to market with Java EE, Get the latest on Oracle’s transportation, trade, See how Orbitz delivers better hotel search capa- Oracle WebLogic, and Oracle Coherence. and warehouse management solutions. bilities with Oracle Exadata.

Webcast Series: Navigating a Pragmatic VIDEOS Oracle Exadata: Extra Performance for Path to Your Applications in the Cloud Oracle’s Pillar Axiom 600 Quality of Service Oracle Applications fbit.ly/IoENnz fbit.ly/JBLNUv fbit.ly/IL9Ax8 Explore best practices for simplifying IT opera- See how to consolidate storage-area network– AFG, Garmin, IQNavigator, and KPN rely on Oracle tions with cloud-based deployment. based storage with Oracle’s Pillar Axiom 600. Exadata for improved application performance.

Oracle’s Systems Webcast Center Oracle WebLogic Server YouTube Channel Redcats Improves Performance 6x on fbit.ly/J7YvDI fbit.ly/IoQLO2 Oracle Exadata Access dozens of Webcasts on Oracle hardware Watch videos about Oracle WebLogic Server 12c fbit.ly/IEEmIq systems and solutions. and Java 7. Redcats migrated a mixed workload to Oracle

oracle magazine July/August 2012

JA12_resources.indd 13 5/21/12 10:23 AM 14 Resources

overHEARD demand exam prep training seminars for SQL, Oracle Database 11g, and Java certification “The main reason that we chose Oracle Exadata was that exams. Save 20 percent when you purchase the it . . . had proven itself, and therefore we felt more confident training and certification exam voucher together. in picking this specific platform to move ahead in our E-BOOKS consolidation and be able to meet the increased performance Archiving for Dummies and availability requirements that our clients had.” fbit.ly/JSaniJ —Eric Zonneveld, Lead Oracle Architect at KPN, in KPN Consolidates Critical Business Apps on Oracle Learn how to meet the stringent regulatory Exadata (bit.ly/JqJLlk) mandates that require long-term preservation of critical data.

Exadata to dramatically lower cost while “Managing Data with Cloud Computing” Server Virtualization for Dummies improving response time sixfold. fbit.ly/JzU1eO fbit.ly/IbEUbt Read how cloud computing can bring flexibility, Discover how getting virtualization right can help KPN Consolidates Critical Business Apps on scalability, and speed to your data center. you slash costs, accelerate application deploy- Oracle Exadata ment, and gain business agility. fbit.ly/JqJLlk PODCASTS KPN uses Oracle Exadata for performance, high “Immutable Zones in Oracle Solaris 11” Introducing the New SPARC availability, consolidation, and quick deployment fbit.ly/ImZkcV SuperCluster T4-4 of critical business applications. Learn about a new feature in Oracle Solaris 11 that fbit.ly/KeSkzd provides read-only root zones for highly secure Learn how Oracle’s SPARC SuperCluster T4-4 Confidence in the Cloud: Tour Oracle’s Global deployment scenarios. is designed, tested, and optimized to handle the Data Centers most-complex multitier workloads. fbit.ly/JBKsgx “EnerNOC Tackles Energy Data Volume Take a virtual tour of Oracle’s data centers with Growth with Oracle Exadata” Introducing the Next Generation of Tom Fisher, Oracle Cloud Services CIO and senior fbit.ly/JGUOZE SPARC Servers vice president. EnerNOC uses Oracle Exadata to boost online fbit.ly/IsIprV transaction processing and data warehouse per- Read about the benefits of Oracle’s SPARC T4 WHITE PAPERS formance and maximize I/O efficiency. servers and SPARC SuperCluster T4-4. “Oracle’s Sun Fire X4170 M3 and Sun Fire X4270 M3 Server Architecture” “Oracle and Cloudera Working Together on web locator fbit.ly/JGeZXP Big Data” Learn why Oracle’s x86 Sun Fire M3 systems are fbit.ly/I66hii Oracle Blog Center the best x86 platform for running Oracle software. Read why Oracle is using Cloudera’s distribution oracle.com/blogs including Apache Hadoop and how the two com- Oracle Consulting “Sun Blade 6000 Server Module panies are working together. oracle.com/consulting Architecture” Oracle Events and Webcasts oracle.com/events fbit.ly/Ibo7WC BLOGS Oracle Podcast Center Read about Oracle’s Sun Blade 6000’s open Oracle Supply Chain Management Blog oracle.com/podcasts modular architecture and multitier blade portfolio fblogs.oracle.com/scm Oracle Newsletters for deploying a broad range of applications. Get the inside scoop on all things supply chain oracle.com/newsletters management. Oracle University “Enterprise-Grade Cloud Applications: The oracle.com/education Benefits of Cloud Plus the Power of Oracle” ORACLE UNIVERSITY Oracle on Facebook facebook.com/oracle fbit.ly/I9HBKN Oracle Fusion Applications Training Oracle on Twitter Learn how Oracle’s cloud strategy delivers the fbit.ly/xHaCPA twitter.com/oracle benefits of the cloud, without compromise. Learn how to efficiently and effectively implement Oracle Support and use Oracle Fusion Applications. oracle.com/support “Integrate for Insight” My Oracle Support fbit.ly/JqHQxl Prepare for Your Certification Exam myoraclesupport.com Discover how you can combine big data with tra- fbit.ly/Jortnk My Oracle Support Communities communities.oracle.com ditional data management. Fast-track your exam preparation with on-

July/August 2012 Oracle.com/oraclemagazine

JA12_resources.indd 14 5/21/12 10:24 AM Select Specialized Partners

70+ Oracle Product Specializations

Skills Certified by Independent Testing

Successful Implementations Confirmed by Customers

3,000 Partners with 70,000 Specialists

oracle.com/specialized

Copyright © 2011, 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. 16 Product Resources

DEMOS Oracle Unveils Sun ZFS Backup Appliance for Oracle Oracle Linux Animated Overview Engineered Systems Watch this demo of Oracle Linux and Oracle has introduced the Sun ZFS Backup helps reduce the risk of failed restores by Ksplice to understand why Oracle Linux is Appliance for Oracle engineered systems, optimizing availability with predictive self- the best Linux for the enterprise. including Oracle Exadata Database Machine, healing features and a fault management „bit.ly/Hhlxcc Oracle Exalogic Elastic Cloud, and Oracle’s architecture that automatically detects and A Quick Introduction to JavaFX SPARC SuperCluster T4-4. Tested, validated, diagnoses underlying problems. End-to-end This demo provides a quick overview of and supported with Oracle engineered data checksumming also automatically JavaFX, the JavaFX scene graph, and a systems, the Sun ZFS Backup Appliance checks and repairs corrupted data down to simple JavaFX application. It is the first demo delivers up to 20 terabytes per hour full the bit level. in the JavaFX Getting Started Demo Series. backup and up to “Business operations are highly depen- „bit.ly/KvLYLs 9.4 terabytes per dent on database availability, making Part 1: Building Your First hour full restore fast backup and recovery an enterprise JavaFX Application throughputs—the imperative,” says Phil Bullinger, senior vice With this demo—Part 1 in a series with fastest published president of storage at Oracle. “Oracle’s Oracle JavaFX evangelist Angela Caicedo— recovery rates Sun ZFS Backup Appliance is purpose-built start learning how to create a simple among general- to work with Oracle engineered systems, JavaFX application using NetBeans 7. purpose storage taking advantage of hardware and software bit.ly/Kh13D1 „ systems for Oracle engineered together to deliver the speed, Oracle Advanced Analytics and engineered systems simplicity, and savings customers need Oracle Data Mining Demonstration data protection. to protect their data and meet stringent This one-hour-plus session focuses pri- The Sun ZFS recovery time objectives.” marily on the data mining component of Backup Appliance bit.ly/Is0F3b Oracle Advanced Analytics. Topics include big data and big data analytics, data mining, and typical use cases. New Oracle BI Applications for Manufacturing and Asset Management bit.ly/J1vZ9P „ Oracle has delivered two new innovations iPhone, is provided. TUTORIALS to its business analytics portfolio: Oracle “For manufacturing and asset-intensive Manufacturing Analytics and Oracle Enterprise industries, maintaining the health of critical Oracle Platform Security Services Asset Management Analytics. The industry’s assets and optimizing production and inven- 11g Release 1: Lesson 1: Overview first and only in-memory analytic applications tory is the difference between bottom-line This tutorial provides an introduction to for manufacturing and asset management business growth and failure,” says Gaurav security industry terms and concepts and puts them into context for Oracle Platform analysis, the new offerings enable the manu- Rewari, vice president of enterprise perfor- Security Services. Get an overview of Oracle facturing, energy production, utilities, and mance management and business intelli- Platform Security Services, its architecture, other asset-intensive industries to gain better gence product development at Oracle. “With and usage benefits. insights and make quick decisions. Oracle Manufacturing Analytics and Oracle „bit.ly/J7xvZO Both solutions provide support for large Enterprise Asset Management Analytics, we numbers of concurrent users and are certi- are enabling customers to get intelligence Oracle WebLogic Server 12c: fied to run on Oracle Exalytics In-Memory into the hands of key decision-makers Configuring and Using Production Redeployment Machine. Native support for tablet and wherever the job may take them.” bit.ly/ItHFjs This tutorial shows you how to use the mobile devices, such as the Apple iPad and Oracle WebLogic Server 12c production redeployment feature to simultaneously New MySQL 5.6 Development Milestone Release deploy two versions of the same application. „bit.ly/IKcZPM A new Development Milestone Release feedback through labs..com. These for MySQL 5.6 delivers enhanced avail- include online operations for ADD index Oracle Data Integrator Application ability, increased performance, and and NoSQL access to InnoDB via the Adapter for Hadoop improved manageability for Web, cloud, Memchached protocol Learn how to use the Oracle Data Integrator Application Adapter for Hadoop. Topics and embedded applications. MySQL 5.6 is “Working with the user community, include an overview of big data and the available now for download in the MySQL Oracle continues to lead MySQL innovation, Oracle Data Integrator application adapter. Developer Zone (bit.ly/JYW1xF). delivering new and anticipated features and „bit.ly/Kh6YI4 In addition, Oracle is providing early enhancements,” says Tomas Ulin, vice presi- access to significant features under dent of MySQL engineering at Oracle. development for community testing and bit.ly/JYW1xF

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_Briefs.indd 16 5/21/12 10:57 AM BRIEFS 17

Oracle and Infosys Improve Supply Chain Performance for High Tech Oracle Releases JD Edwards

Oracle and Infosys, an Oracle Diamond automate complex billing processes, and EnterpriseOne 9.1 Partner, have unveiled Oracle’s project- integrate project management and supply The latest release of Oracle’s integrated suite driven supply chain for high technology chain management to provide real-time of enterprise resource planning software, companies to reduce project-related inven- “what if” scenarios. Oracle’s JD Edwards EnterpriseOne 9.1, helps tory and improve financial forecast accu- “[Oracle’s project-driven supply chain customers further streamline business pro- racy. The solution is designed to increase for high technology companies] leverages cesses with a personalized user experience, supply chain performance on a single, Infosys’ industry-leading technology busi- new industry-specific functionality, produc- unified platform. Oracle’s project-driven ness and systems integration expertise with tivity features, and more support for global supply chain for high technology compa- Oracle’s integrated applications,” says Ravi operations and compliance mandates. And nies also enables Kumar, global head, Consulting and System with the new One View Reporting feature, organizations to Integration Manufacturing Group, at Infosys. business users can create interactive reports increase installation “This solution ties together multiple opera- without IT support. projection efficien- tional layers to help achieve increased preci- “This important new release builds on our cies by delivering sion, financial controls, and cost improve- long-standing commitment to delivering an increased visibility ment across the supply chain.” integrated, standards-based portfolio of inno- into global resources, bit.ly/IKqjnh vative applications that can help streamline processes, reduce costs, and drive business Oracle Database Now Available on Oracle Linux 6 value,” says Lyle Ekdahl, group vice president and general manager, Oracle’s JD Edwards. Oracle Database 11g Release 2 and Oracle Middleware product availability is the result bit.ly/xsm7UX Fusion Middleware 11g Release 1 are of stringent certification testing on Oracle now available on Oracle Linux 6 with the Linux 6 with the Unbreakable Enterprise AutoVue 20.2 Supports Better Unbreakable Enterprise Kernel as well as Kernel,” says Wim Coekaerts, senior vice on Red Hat Enterprise Linux 6 and Oracle president of Linux and virtualization engi- Decision-Making Linux 6 with the Red Hat Compatible Kernel. neering at Oracle. The latest release of Oracle’s family of “The Oracle Database and Oracle Fusion oracle.com/us/technologies/linux industry-leading enterprise visualization solutions, Oracle’s AutoVue 20.2, is now New Sun x86 Servers Deliver the Industry’s Best x86 Platform available. Oracle’s AutoVue 20.2 helps create rich and actionable visual decision-making Oracle has unveiled a new line of Sun multiple world- environments on all delivery platforms with x86 servers based on the Intel Xeon pro- record benchmarks, augmented business visualization. This cessor E5-2600 product family of CPUs. demonstrating framework connects portions of documents The servers offer the industry’s best x86 superior perfor- with business data from enterprise applica- platform, with unrivaled performance and mance on compu- tions for more-informed decisions. reliability for applications and databases, tational, application, and enterprise work- The new release also supports mobile while also offering the tools needed for loads, including new world records on SPEC workers in the utilities and oil and gas indus- cloud-enabled deployments including oper- CPU2006, SPECjEnterprise2010, and Oracle tries. AutoVue 20.2 can be integrated with ating system, virtualization, infrastructure E-Business Suite Release 12.1.3 (bit.ly/J7J7vS). Oracle’s enterprise applications to enable provisioning, and system management at “Oracle’s collaboration with Intel provides a range of mobile devices by leveraging no extra cost when combined with Oracle solutions with great performance and scal- Oracle Virtual Desktop Infrastructure. Mobile Premier Support services. ability to meet the ever-increasing demands support gives field technicians access to work The new Sun x86 servers deliver up to 87 of data center customers,” says Doug order–related documents and lets them percent better computational performance Fisher, corporate vice president, Software capture a digital record of onsite repair work. and feature increased memory and network and Services Group, at Intel. “Extensive co- “New capabilities introduced in bandwidth over the previous generation, engineering, testing, and validation have gone AutoVue 20.2, such as augmented busi- enabling organizations to run additional into creating an excellent balance between ness visualization, reconcile information software and complete tasks faster in the processor, memory, and I/O resources in the from documents and the rest of the Oracle same physical footprint. Running Oracle solution stack. As a result, Oracle’s x86 servers stack, helping companies access critical Solaris or Oracle Linux, Oracle VM, and Oracle based on the Intel Xeon processor E5-2600 information in the format they need to Enterprise Manager Ops Center, the new offer an unprecedented ability to move large make informed business decisions,” says servers reduce costs, streamline data center volumes of data efficiently and handle mul- Thierry Bonfante, senior director of AutoVue operations, and offer better performance tiple millions of transactions per second.” product management at Oracle.

I-HUA CHEN I-HUA and reliability. The new servers have set bit.ly/IM0mSE bit.ly/eWCwYO

ORACLE MAGAZINE JULY/AUGUST 2012

JA12_Briefs.indd 17 5/21/12 10:57 AM 18 BRIEFS

Oracle Introduces Two Business Intelligence Applications for SAP JDK for Mac OS X Available

To give organizations greater business BI and enterprise performance management Oracle has released its first Java insight into their SAP systems, Oracle has applications available today that do not Development Kit (JDK) and JavaFX unveiled Oracle Procurement and Spend require any application changes to run on Software Development Kit for Mac OS X. Analytics for SAP and Oracle Supply Chain Oracle Exalytics In-Memory Machine. Java developers can now download Java and Order Management Analytics for “Oracle is pleased to deliver the first Platform, Standard Edition 7, Update 4 SAP. Available as part of Oracle Business packaged analytic applications built spe- (Java SE 7 Update 4) and JavaFX Software Intelligence Applications Release 7.9.7.1, cifically for SAP customers that run on an Development Kit 2.1 for Mac OS X from these new applications help reduce procure- engineered system for analytics and are fully Oracle Technology Network. ment and spend costs and improve supplier enabled for mobile deployment,” says Paul The Java SE 7 Update 4 SDK includes the performance and supply chain efficiency. Rodwick, vice president of product manage- next-generation Garbage Collection algo- These business intelligence (BI) applica- ment, Oracle Business Intelligence. rithm, Garbage First (G1), which has been tions for SAP are among the 80-plus Oracle bit.ly/ItHFjs highly anticipated by the Java developer community. RightNow CX Cloud Service and Oracle Fusion Sales Integrated JavaFX 2.1 intro- duces playback Oracle RightNow CX Cloud Service is now context and status of these interactions. support for digital integrated with Oracle Fusion Sales. This The offering includes tools that enable media stored in the combination allows sales and marketing sales and service departments to collabo- MPEG-4 multimedia organizations to leverage service interactions rate to proactively solve customer issues, container format from Oracle RightNow CX Cloud Service, a sales representatives to review service containing H.264/AVC customer experience suite, and sales predic- history in preparation for sales calls, video and Advanced tion and segmentation capabilities from and agents to understand customer Audio Coding (AAC) audio. It also includes Oracle Fusion Sales. The offering enables value based on prior buying habits and WebView support for JavaScript to Java organizations to better match products and existing opportunities. method calls. services to specific customer needs based on “Every interaction is a relationship oppor- “We look forward to delivering simul- customer service history; deliver targeted, tunity to grow your business. When these taneous releases of the JRE [Java Runtime personalized customer interactions; and interactions are relevant and add value for Environment] across all major operating identify new opportunities to increase deal customers, customers are more likely to systems later this year, so all Java users size and conversion rates. trust the relationship and seek purchase will be able to take advantage of the latest The integration provides organizations advice,” says David Vap, group vice president features and security fixes,” says Hasan with a comprehensive view of all customer at Oracle. Rizvi, senior vice president of Oracle Fusion interactions across channels and the bit.ly/L5bbgH Middleware and Java products at Oracle. bit.ly/qqM4AV New StorageTek Tape Analytics Delivers Intelligent Monitoring Oracle Acquires ClearTrial Oracle has introduced Oracle’s StorageTek tomers to proactively make decisions about Tape Analytics, intelligent monitoring their tape infrastructure and reduce down- Oracle has entered into an agreement to software for StorageTek tape libraries. time and data management resources. acquire ClearTrial, a provider of cloud-based StorageTek Tape Analytics simplifies tape “Oracle’s StorageTek Tape Analytics soft- clinical trial operations applications that make management by eliminating manual inter- ware allows customers better insight into the planning, sourcing, and tracking of clinical vention and helps improve operational effi- the health of their tape environments and projects and financial performance faster and ciency. The new solution captures library, arms them with the information to maximize more accurate. ClearTrial’s solutions help life drive, and media performance metrics and the value of their storage investments,” says sciences companies manage the complexity presents them in a single console, and can James Cates, vice president of hardware of bringing new therapies to trial. proactively identify potential problems development at Oracle. “Ideal for backup “Adding ClearTrial to the Oracle Health while providing immediate recommenda- and archive data residing locally or in the Sciences Cloud will help our customers tions to prevent data cloud, Oracle’s [StorageTek Tape Analytics] is streamline the clinical development process loss. StorageTek Tape secure, efficient, and cost effective. Its savings and help them bring therapies to market Analytics also allows for customers can be quite substantial, as with greater predictability and at lower rapid drill-down into it does not require special media but rather costs,” says Neil de Crescenzo, senior vice detailed drive and works with the customer’s existing supported president and general manager, Oracle media health spe- media, regardless of the vendor.” Health Sciences.

cifics, enabling cus- bit.ly/IPqOHD bit.ly/IrZPmX CHEN I-HUA

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_Briefs.indd 18 5/21/12 10:58 AM News by Fred Sandsmark 19

The Business of Analytics Oracle unveils analytics strategy and releases new EPM and analytics applications, as well as Oracle Endeca.

racle President Mark Hurd likes to Planning, a new product in Release 11.1.1.2 Otalk about business intelligence and of Oracle’s EPM system, enables project- analytics. Just ask the crowd at Oracle based budgeting, funding, approvals, and OpenWorld Tokyo, where Hurd discussed tracking. This extends financial planning those topics—and Oracle’s strategy around and forecasting—which in the past typically them—in a keynote address on April 4, focused on accounts and cost centers—to 2012. At the same time, several new Oracle activities organized as projects. Project products that enable faster, better decision- Financial Planning can be used both for making were introduced. projects that occur in all types of business To derive benefit from analytics, a (such as IT, HR, or facilities projects) and company needs systems that can both for entire operations in project-centric handle huge data volumes and provide industries, such as aerospace and defense, very fast processing—and then they must construction, and manufacturing. put that power in the hands of people who Account Reconciliation Manager, a new need it, Hurd explained. “The key to ana- feature of Oracle Hyperion Financial Close lytics,” says Hurd, “is to get through tons Management, improves both the speed of information, in a fast way, with a lot of and accuracy of period-end close activi- performance—to be able to ask really hard Oracle President Mark Hurd ties while reducing reporting risks. Prebuilt questions and get a decision to somebody components and starter kits help compa- who can take action.” ating engineered systems built for analytics; nies comply with International Financial Hurd added that today’s emphasis on creating or acquiring industry-specific solu- Reporting Standards (IFRS), eXtensible business analytics is generational. “I’m used tions; and producing a new generation of Business Reporting Language (XBRL), and to taking a long time to get information,” he applications, built on common middleware, sustainability reporting requirements. said, “but my kids aren’t. My kids are used to that can be delivered via public or private The speed and scalability of Oracle instant answers to whatever question they’ve clouds or on-premises data centers. Hyperion Planning—an EPM product that got, whenever they want, and they won’t wait.” To showcase the early fruits of its R&D integrates financial and operational plan- Joined by Balaji Yelamanchili, senior vice investment in business analytics, Oracle ning processes—is significantly boosted president of analytics and performance announced several new or updated prod- in the new EPM system release through management products at Oracle, Hurd ucts, including a new release of Oracle’s support for Oracle Exalytics In-Memory outlined the challenges businesses face in enterprise performance management (EPM) Machine, an engineered system designed implementing analytics—including eight system, general availability of Oracle Endeca for analytics. Usability, performance, and times (or faster) data growth in the last five Information Discovery, and several new accuracy of Oracle Hyperion Planning are years, aging infrastructures and applications, analytic applications. “The next generation also enhanced through a new Web 2.0–style and the need to deliver answers to mobile of analytic systems is so important because user interface, built-in predictive analytics platforms—and the types of solutions Oracle the problem [faced by companies in today’s based on Oracle Crystal Ball, and built-in provides to meet these challenges. environment] is getting harder,” Hurd said. integration with Oracle Fusion Financials, Oracle is spending almost US$15 billion “Because there’s more data.” Oracle’s JD Edwards EnterpriseOne in research and development over three Financials, and the Commitment Control years along four lines, Hurd said: Creating EPM Enhanced feature of Oracle’s PeopleSoft Financials. best-of-breed hardware, operating systems, Release 11.1.1.2 of Oracle’s EPM system Additionally, Oracle Hyperion Data databases, and applications, including busi- delivers new modules and capabilities that Relationship Management, an EPM product ness intelligence and analytics applications; improve performance and provide compa- used to build and retain consistency within vertically integrating those components for nies with greater insight into their projects. master data, now includes out-of-the-box

s Studio Hartmann extreme performance—for example, cre- Oracle Hyperion Project Financial integration with ERP datasources including

oracle magazine July/August 2012

JA12_News.indd 19 5/21/12 11:26 AM 20 News

Oracle E-Business Suite 12.1 and Oracle “Business analytics—getting the right data Fusion Financials. to the right person at the right time to make Oracle Endeca Unveiled Another product of Oracle’s R&D invest- the optimal decision—is the most important ment in business analytics, Oracle Endeca thing you can get from your data.” Information Discovery, is the first Oracle —Mark Hurd, President, Oracle information discovery offering since Oracle acquired Endeca in October 2011. Oracle Endeca Information Discovery enables from that point on, zero in on the real issues unstructured, social media, and machine- exploration and analysis of structured, semi- and real problems.” generated data—to improve analytics. structured, and unstructured data from a Oracle Endeca Information Discovery’s A full range of analytics. Provide software and variety of sources such as data warehouses, three-tier architecture works like this: After engineered systems purpose-built for the full transaction systems, social media, and various datasources are combined and range of analytics—including reporting, mod- sensor data. These datasources can reside enriched in the Integration Suite feature eling, planning, and predictive analysis—that inside or outside of an organization, and of Oracle Endeca Information Discovery democratize analytics and allow anyone in an might include sources that have never been (the first tier), Oracle Endeca Server (the organization to be a data artisan. modeled and that are constantly changing. second tier) organizes that information into Integrated analytic applications. Support Information discovery, also called data a unified index, deriving a model from the those customers who want to create their discovery, complements and enhances busi- data if necessary—a bottom-up approach own analytic applications, but provide out- ness intelligence (BI). Whereas BI provides that is the core of the Endeca application of-the-box analytic capabilities tied to busi- proven answers to known questions, data line. The Studio feature of Oracle Endeca ness processes that allow people to act on discovery provides fast answers to new ques- Information Discovery (the third tier), with what they discover. tions and puts the power to ask those ques- its drag-and-drop interface, creates appli- On premises, on cloud, on mobile. Deliver tions in the hands of businesspeople who cations for exploring and analyzing that analytics via flexible models in any way that know the information best. Data discovery information. In the process of information customers—both IT professionals and end helps companies create new key performance discovery, Oracle Endeca’s optimization users—want them. This includes traditional indicators for BI systems. algorithms exploit the server’s full memory data center solutions and software-as-a- Oracle Endeca Information Discovery uses hierarchy, from on-CPU cache to disk, to service (SaaS)/cloud platforms, and on both a faceted analytical model, similar to that used optimize system performance. traditional screens and mobile devices, in online shopping. A faceted model encour- without compromising the usability or power ages data exploration by presenting all rel- Analytics Applications Extended of the analytics. evant data in a straightforward click-to-select Oracle has also extended its current family “Business analytics—getting the right data manner. (Compare it to a shoe-shopping of applications to support the need for to the right person at the right time to make Website that lets users narrow a selection: analytics. The Tokyo announcement high- the optimal decision—is the most impor- first they might choose men’s shoes, then lighted new offerings in this area, including tant thing you can get from your data,” Hurd sneakers, then white leather, then size 9. Now Oracle Procurement and Spend Analytics told the Oracle OpenWorld Tokyo audience. extend that concept to searches for common- for SAP, Oracle Supply Chain and Order “Analytics is in Oracle’s DNA and is a vital part alities and relevant themes in multiple corpo- Management Analytics for SAP, enhance- of everything we do—database, middleware, rate datasources, such as ERP, customer rela- ments to Oracle Financial Analytics for SAP, applications, and engineered systems.”  tionship management, and HR management Oracle Manufacturing Analytics, and Oracle systems, as well as unmodeled and external Enterprise Asset Management Analytics. Fred Sandsmark is a freelance technology datasources such as social networking sites.) (See Briefs, page 16, for details.) and business writer. Oracle Endeca Information Discovery These new applications, as well as Release “takes you from traditional reporting and 11.1.1.2 of Oracle’s EPM products and Oracle Next Steps analysis to interactive discovery and explo- Endeca Information Discovery, support ration—where you don’t even know all the Oracle’s overall business analytics strategy. WATCH the event Webcast questions you’re going to ask,” Yelamanchili As described by Hurd and Yelamanchili, the bit.ly/JzXgPY said at the Oracle OpenWorld Tokyo launch. strategy recognizes trends such as big data, LEARN more about “You’re going to start with a question, and mobility, in-memory analytics, and cloud, enterprise performance management then move very quickly into understanding, and is built on four foundational principles: bit.ly/KbtjK0 connecting the dots, finding the patterns, Any data, any source. Deliver the ability Oracle Endeca Information Discovery bit.ly/IRbkqX and finding the outliers. And very quickly, to tap into diverse data sets—structured,

July/August 2012 Oracle.com/oraclemagazine

JA12_News.indd 20 5/21/12 11:13 AM Interview by Rich Schwerin 21

Virtually Everywhere Oracle Virtual Desktop Infrastructure 3.4 enables secure desktop access from almost anywhere.

ollowing the availability of Oracle Virtual in a traditional PC environment. But if you FDesktop Infrastructure 3.4, Rich Schwerin, move to a virtual desktop environment, the Oracle Magazine contributor, sat down with administrator is able to deliver virtual desk- Andy Hall, product management director at tops from the data center. And the way this Oracle, to talk about desktop virtualization. works is that the administrator would create The following is an excerpt from that one or more pools of desktops with a golden interview. Download the full podcast at template—a repeatable, reusable reference oracle.com/magcasts. model. So you can create, for instance, the Oracle Magazine: How does Oracle desktop golden master Windows template for your virtualization deliver enterprise desktops? sales team, and another golden master Hall: Oracle desktop virtualization offers a template for your marketing people or your different approach to delivering enterprise engineers, and they can be completely dif- desktops to end users. Don’t run the desktop ferent golden images. Oracle Virtual Desktop on the client machines, where it’s insecure, Infrastructure can clone these golden master where it’s tough to manage, where basically images into desktop pools that you can you’re tied to a device. Instead, why don’t assign as desktops to end users. So when I as you use virtualization to run your desktop your end user log in, I am assigned a partic- in a virtual machine in the data center? It’s Andy Hall, Product Management Director, Oracle ular desktop that the system administrator more secure, it’s easier to manage, and you wants for me. And when I log out, Oracle can access it from more places and from device that are specifically designed for Virtual Desktop Infrastructure has a selec- more devices. accessing virtual desktops in the data center, tion of features that allows the administrator Oracle Magazine: Which products comprise so they have no operating system, no moving to either keep that virtual desktop for me, Oracle’s desktop virtualization solutions? parts, and are really secure. Finally, we have repurpose or reassign it to someone else, Hall: We have two desktop virtualization Oracle Secure Global Desktop, which provides or potentially just throw it away altogether classes: client-side and server-side. A product secure browser-based access to your applica- and clone a brand-new one. This means that called Oracle VM VirtualBox handles client- tions and data running in the data center from you can always re-create and deploy pristine side virtualization. Oracle VM VirtualBox is one wherever you are in the world. The idea is you desktop images to your end users, so you of the most popular client-side hypervisors in start with a browser, type in a URL, log in, and don’t let them get into a mess. the world today. There are more than 2 million you get access to the Oracle applications and Oracle Magazine: How do developers downloads of Oracle VM VirtualBox happening other enterprise applications that are in the and DBAs benefit from Oracle desktop from Oracle Technology Network every month, data center. virtualization? and people are using Oracle VM VirtualBox Oracle Magazine: How do system admin- Hall: Most developers I know tend to use on their PCs, on their Mac istrators benefit from Oracle desktop Oracle VM VirtualBox on the client side, desktops, and on their Linux machines as well. virtualization? because one of the things developers really The big brother to Oracle VM VirtualBox is Hall: If you’ve ever managed a fleet of desk- want to do is to be able to work from any- Oracle Virtual Desktop Infrastructure—which tops, you’ve realized that you’re in a very where and to be able to do everything. And is server-side desktop virtualization—running reactive mode. You’re forever chasing around being able to work from anywhere means desktop operating systems such as Windows and looking to update people’s PCs, you’re that you want a complete development envi- in individual VMs on servers in the data center. fixing security problems, you’re helping end ronment of clients, a middle-tier server, and And if you’re running your desktops from the users who have gotten themselves into a a back-end server, so you can create multiple data center, you can access them from your bit of a predicament somehow—and that’s VMs on your desktop device, whatever that Windows PC, from your Mac, from your iPad, because the device that you’re trying to help might be. Let’s say you’re a Web developer or from specific devices, such as Oracle’s Sun them with is out there in the wild. Effectively or you’re developing something in HTML5.

John Blythe Ray Clients. Clients are an endpoint many users are their own administrators You need to test that against all the different

oracle magazine July/august 2012

JA12_Interview.indd 21 5/21/12 12:06 PM 22 Interview

browsers, so you create multiple VMs to test “One of the things developers really want to against Mozilla Firefox, Microsoft Internet Explorer, or others, and on all the different do is to be able to work from anywhere. . . . platforms that you expect your customers to be using as well. By using virtualization And [that] means that [they] want a in that way, you really can simulate almost complete development environment.” every environment in which you expect your —Andy Hall, Product Management Director, Oracle application to be used. Oracle Magazine: What role does Oracle desktop virtualization play when employees device—you’re really just seeing a view onto in a way that is comparable to a traditional bring their own tablet devices to work? that data. So if someone steals the device, desktop deployment. To achieve that, we’ve Hall: One of the big problems that system they really haven’t stolen anything. Your put in acceleration techniques at various administrators are having is that not just desktop is still running in the data center, places in the stack. So, for instance, when any old end user, but the C-level executive where it’s being looked after; where it’s Oracle Virtual Desktop Infrastructure 3.4 sees is coming to work and saying, “Hey, I’m the tightly secured; and where you can keep video being displayed in a virtual desktop, it chief financial officer, and I expect to be audit trails of who accessed it, from where, uses a different codec to transmit it down to able to access my enterprise applications when, and for how long. the client. And as you jump from device to from this device.” How on earth can you do Oracle Magazine: What’s new in Oracle device, we’ve made the hotdesking, or session that? Typically the applications haven’t been Virtual Desktop Infrastructure 3.4, and what mobility, a lot smoother and smarter. Oracle designed for that device, so how can you makes it important? Virtual Desktop Infrastructure 3.4 also passes deliver your standard enterprise applications Hall: Traditionally, putting together a virtual the location of the endpoint up the wire to the to such a device? Well, it’s very easy to do desktop infrastructure solution from any virtual desktop, and that’s very important in with Oracle Virtual Desktop Infrastructure. vendor is a little bit hairy. You need quite deployments such as healthcare. You simply assign your CFO a virtual desktop a lot of capital expenditure: you have to Oracle Magazine: What makes Oracle’s that runs in the data center, and then install get some shared storage devices, such as a desktop virtualization solutions unique? the Oracle Virtual Desktop Client for iPad. NAS [network-attached storage] appliance; Hall: First, Oracle is the only virtual desktop You start that up, and that is able to find your you need some servers on which you’re vendor that can provide the hardware for virtual desktop server, authenticate, and log going to run your virtual desktops; you need your virtualization layer, the storage service, in, and the CFO can access the desktop on some software that’s going to virtualize the server virtualization software, the his iPad. And we’ve gone further than that, the desktop; and you need some software desktop virtualization software, the remote because we realize that the gestures you use that’s going to allow you to get remote access, and the endpoint device. So we when you’re using a tablet device are very access from it securely over a protocol that deliver the whole stack—hardware and soft- often different from the ones you use when has been designed specifically for accessing ware, engineered to work together. Second, you are using a keyboard and mouse. So we’ve remote desktops. when you’re using Oracle Applications, mapped a certain number of those gestures One of the things that we’re doing with Oracle Virtual Desktop Infrastructure is the to make it more natural to be able to interact Oracle Virtual Desktop Infrastructure 3.4 is to only virtual desktop environment certified with this traditional desktop environment on address some of those challenges by offering for use with those enterprise applications.  your tablet. Plus, you can hop between devices more and simpler deployment options. For and locations and still get access to the same example, we’re offering a greater range of virtual desktop. So let’s say you’re sitting in storage options, so you don’t necessarily Rich Schwerin is a the office and using your virtual desktop, and need to go out and buy a big NAS device. You senior manager with all of a sudden you get a telephone call that can use either local storage or shared storage Oracle Publishing who says you have to come home for dinner now. such as NFS [] or SMB focuses on social media. So you dash home, and when you’re at home [Server Message Block] to set up the virtual you pick up your iPad, connect back into your desktop infrastructure. The other area that virtual desktop server, and pick up the session we’ve improved on greatly is the delivery of from exactly where you left it. a richer user experience, because if you’re Next Steps Oracle Magazine: How does Oracle address using your virtual desktop, you really want desktop virtualization security issues? it to be as good as the experience you have LEARN more about Oracle desktop Hall: The good news is that none of the data when you use a traditional PC. For example, if virtualization bit.ly/ovdimag you’re interacting with from your Oracle you go to YouTube, you’ll see rich media types Virtual Desktop Client on your PC, Mac, inside of your browser, and you expect them LISTEN to the podcast oracle.com/magcasts iPad, or Sun Ray Client exists on the client to be displayed from your virtual desktop

July/august 2012 Oracle.com/oraclemagazine

JA12_Interview.indd 22 5/21/12 12:06 PM Database Appliance or or Puzzle Pieces?

BUY BUILD

Microsoft Database Oracle + Database HP Server Appliance or + NetApp Storage + Cisco Networking + Consultants

Database Appliance: Simple, Reliable, Affordable

oracle.com/databaseappliance or call 1.800.ORACLE.1

Copyright © 2012, 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.

omg0712p023.indd 1 5/30/12 12:54 PM

PUB NOTE: Please use center marks to align page. Print Ad Job No.: 312M_MLT_DBApp_Puzzle PRODUCTION NOTES READER LASER% RELEASED Headline: Database Appliance or Puzzle Pieces? Date: 01/25/2012 Project: Master Print Ad 1/25 Type: Magazine 01 2012 7.875” x 10.5” Live: 7.375” x 10” Trim: 7.875”x 10.5” Please examine these publication materials carefully. Full Page Master Bleed: 8.625”x 11.25” Any questions regarding the materials, Fonts: Univers LT Std. 75 Black, 65 Bold, 55 Roman, 45 Light, please contact Darci Terlizzi (650) 506-9775 67 Bold Condensed, 57 Condensed 24 Book Beat

Oracle BPM Suite 11g Developer’s about using the product across different Apps Associates Offers Oracle Cookbook databases and file types such as XML. Other Exalytics Service and Support By Vivek Acharya topics include orchestrating data integration workflows, error management, operational Packt Oracle Platinum Partner Apps Associates management and monitoring, and more. packtpub.com has launched an initiative to deliver ser- This book is a resource for extract, transform, and load developers; software developers; vices and solutions for Oracle Exalytics Oracle BPM Suite 11g and DBAs who want to get hands-on experi- In-Memory Machine. Apps Associates is Developer’s Cookbook will ence with Oracle Data Integrator quickly. help readers learn how to committed to bringing Oracle Exalytics to develop rich, interactive Developing Essbase Applications: the thousands of customers using Oracle business processes using Oracle Business Advanced Techniques for Finance Business Intelligence, Oracle Essbase, and Process Management Suite 11g. A common and IT Professionals Oracle Hyperion Planning. The company process model based on Business Process Model and Notation is presented to the spe- Edited by Cameron Lackpour will provide early stage proof-of-concept cific role assigned to readers in each chapter. Auerbach Publications evaluation, implementation, deployment, crcpress.com The book is divided into four sections: and support. modeling; implementation; measuring; and deployment, migration, and runtime. Each Learn advanced techniques “Apps Associates’ commitment to the chapter offers practical, task-based recipes. for building analytical development and rollout of a program models, reporting systems, Effective MySQL: Backup and forecasting applica- and Recovery tions using Oracle Essbase. This book, By Ronald Bradford and written by some of the most experienced Patrick Galbraith Oracle Essbase practitioners around the world, covers infrastructure, datasourcing Oracle Press and transformation, database design, cal- oraclepressbooks.com centered on leveraging the power of Oracle culations, automation, APIs, reporting, and project implementation. The book includes Exalytics underscores the inherent ability of Effective MySQL: Backup practical cases that stem from the authors’ the platform to address the growing need for and Recovery offers a no- decades of combined experience using nonsense approach to one high-speed, real-time analytics in the most- Oracle Essbase tools and techniques. The of the most critical tasks of an operational authors are committed to showing readers demanding environments,” says Tyler Prince, DBA—performing, testing, and verifying the right way to work with Oracle Essbase. group vice president, North America Sales, backup and disaster recovery procedures. It Their motto: “We love Essbase and hate to helps DBAs understand the limitations and Alliances and Channels, at Oracle. see it done wrong.” quirks associated with MySQL backups. This appsassociates.com/oracle-exalytics is key to ensuring that the important busi- Oracle Advanced PL/SQL Developer ness information that has been backed up Professional Guide and the method used to recover it will meet Heiler Earns Validated Integration business needs. The book drills down into By Saurabh Gupta real-world problems and provides succinct, Packt with Oracle ATG Web Commerce proven formulas for achieving faster backups packtpub.com Heiler Software, an and gaining greater overall understanding of Oracle Gold Partner, the systems—regardless of the DBA’s experi- Master PL/SQL concepts ence level. The book includes a “Five Minute with Oracle Advanced has achieved Oracle DBA” chapter that presents a real-world sce- PL/SQL Developer Validated Integration nario and the correct way to manage it. Professional Guide. The between Heiler Product book starts with an overview of PL/SQL and Manager 5.3 and Oracle Getting Started with Oracle Data outlines the characteristics and benefits Integrator 11g: A Hands-On Tutorial of the language. It then covers advanced ATG Web Commerce 10. By David Hecksel, Bernard PL/SQL features that include code writing Heiler Product Manager 5.3 is a scalable Wheeler, Peter C. Boyd- using collections, tuning recommendations central master data platform for e-commerce Bowman, and Julien Testut using result caching, and enforcing row- level security. The book also dives deep into and multichannel businesses. It provides Packt the use of Oracle SQL Developer, employing distributors and manufacturers with master packtpub.com best practices in database environments data management for all product data in a and safeguarding the vulnerable areas in Getting Started with central datasource. PL/SQL code to avoid code injection. Oracle Data Integrator The book can serve as a study guide for Heiler’s adapter between Heiler 11g: A Hands-On Tutorial offers readers the Oracle Advanced PL/SQL Developer Product Manager 5.3 and Oracle ATG Web all the information they require to get up Certified Professional certification. Each and running with Oracle Data Integrator, Commerce 10 enables transmission of infor- major certification topic is covered in a Oracle’s data integration platform for high- mation about items, products, structure separate chapter, with practice questions speed data transformation and movement included at the end of every chapter. groups, media assets, and more. The vali- between different systems. Following an dated integration includes preconfigured example scenario, this book covers essen- tial information about the Oracle Data Look for other Oracle books at oracle.com/ export templates, export utilities, and data Integrator architecture. It provides details technetwork/community/bookstore. field validations.

heiler.com GROENING LINDY

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_partner.indd 24 5/23/12 10:24 AM PARTNER NEWS 25

QLogic Supports Newly Launched Oracle x86 Servers Omnix Achieves Platinum QLogic, an Oracle Gold Partner, supports Partner Status Oracle’s new Sun Fire X4170 M3 server, Sun Omnix International, a distributor and Fire X4270 M3 server, and Sun Blade X6270 systems integrator for digital software M3 server with its line of Oracle networking imaging solutions based in Dubai, United products. This includes an 8 Gb FC PCI Arab Emirates, has become an Oracle Express (PCIe) host bus adapter and Platinum Partner. The status recognizes 10 Gb/sec FC over Ethernet (FCoE) Omnix for its expertise in delivering Oracle’s PCIe converged network adapters that are Sun Blade servers by delivering superior Primavera P6 Enterprise Project Portfolio also available in ExpressModules for Sun application performance and I/O scalability Management solutions. To earn Platinum Blade X6270 M3 server. in virtual and nonvirtual environments. status, partners must achieve any combina- With more than 1 million ports shipped to And, with time-tested QLogic FC, FCoE, and tion of five specializations, Oracle Exastack Oracle customers, QLogic’s Oracle-branded network interface card driver stacks, the Ready status, or Oracle Validated Integrations. networking adapters provide Sun Fire M3 highest level of SAN reliability is achieved With its Platinum status, Omnix customers proven FC performance and full to ensure the robustness and continuous International will now be able to broaden spe- hardware offload for FCoE and iSCSI. These uptime of Oracle’s hardware infrastructure cialization areas; receive priority placement in performance attributes support the high and operating environments. the Oracle PartnerNetwork solutions catalog; compute density of Oracle’s Sun Fire and qlogic.com/go/oracle and enjoy joint marketing and sales opportu- nities, discounted training, and more. omnix.ae Kewill Flagship Achieves Validated Integration with Oracle E-Business Suite BIAS Achieves Oracle Exalogic Kewill, a solution provider in global trade and Oracle E-Business Suite 12.1. and logistics and an Oracle Gold Partner, Kewill Flagship can manage multiple Elastic Cloud Specialization has achieved Oracle Validated Integration shipping stations and support hundreds of BIAS Corporation, an Oracle Platinum of Kewill Flagship with Oracle E-Business thousands of shipments per day with a single Partner, is the first Oracle partner to achieve Suite 12.1. Kewill Flagship is a multicarrier software deployment. Oracle has also devel- Oracle PartnerNetwork specialization on enterprise parcel shipping solution for high- oped and markets a standard integration Oracle Exalogic Elastic Cloud. BIAS designs, performance and high-volume shipping. between Oracle Transportation Management acquires, implements, and manages com- The validated Kewill Flagship Adapter is a and Kewill Flagship, and the two companies prehensive IT solutions based on Oracle PL/SQL package that enables standard inte- have a cooperative marketing agreement. technologies for companies worldwide. gration between Kewill Flagship 5.0 kewill.com In achieving a Specialized distinction, BIAS has been recognized by Oracle for Megabyte Earns Multiple Specializations its expertise in delivering services specifi- cally around Oracle Oracle Gold Partner Megabyte has achieved companies. It offers IT project management, Exalogic Elastic Cloud Specialized status in Oracle Business systems analysis, software design, custom- through competency Intelligence foundation, Oracle Database, ization, modification, and support, and has development, busi- and Oracle Financial Management. many years of experience in the develop- ness results, and Founded in 1979, Megabyte is one of ment and implementation of IT solutions. proven success. Malta’s first business computer systems megabyte.net BIAS also holds the following spe- Elemica Introduces Transportation Management Solution cializations: Oracle Exadata, Oracle Elemica, a provider of supply chain inte- Transportation Management. Elemica is an GoldenGate, Oracle gration and optimization services to Oracle Gold Partner. Business Intelligence the chemical, tire and rubber, energy, The Elemica Transportation Management Foundation, Oracle and selected manufacturing industries, solution provides control over, and visibility Enterprise Manager, has introduced the into, the end-to-end logistics order lifecycle. Oracle Application Grid, Service-Oriented Elemica Transportation It incorporates chemical industry and logis- Architecture, Oracle WebCenter Portal, Data Management solution, tics best practices, and its preconfigured Warehousing, Oracle Database Performance a BPO Powered processes support both common and antici- Tuning, Oracle Linux, Oracle Database, and by Oracle service pated needs of the chemical industry. Oracle Real Application Clusters.

LINDY GROENING LINDY based on Oracle elemica.com biascorp.com

ORACLE MAGAZINE JULY/AUGUST 2012

JA12_partner.indd 25 5/23/12 10:25 AM 26 PARTNER NEWS

Transcepta Achieves Validated Integration with INFOPRO’s eICBA Achieves Two Oracle E-Business Suite Oracle Ready Statuses Oracle Gold Partner Transcepta has for IT departments while enabling accounts INFOPRO, an Oracle Platinum Partner attained Oracle Validated Integration payable and procurement teams to leverage headquartered in Malaysia, has achieved for the Transcepta Procure to Pay (P2P) Transcepta’s network. Oracle Database Ready and Oracle WebLogic network with Oracle E-Business Suite “A rigorous technical review is required for Ready status for its eICBA 9 software. Oracle 12.1. The Transcepta P2P network enables Oracle Validated Integration,” says Ognjen Ready status demonstrates that eICBA enterprise customers to electronically Pavlovic, vice president of product strategy 9—a comprehensive, integrated, modular collaborate with suppliers through the at Oracle. “Since Transcepta’s supplier mes- banking solution—has exchange of invoices, purchase orders, saging through Oracle Supplier Network has been tested on Oracle and other documents. been tested and validated by Oracle, cus- Database 11g Release 2 Validated integration tomers can be confident that the Transcepta and Oracle WebLogic between the Transcepta Network integrates with Oracle E-Business Server 11g Release 1. P2P network and Oracle Suite as designed, allowing accelerated time eICBA provides a full E-Business Suite eases to value for our joint customers.” spectrum of conven- integration challenges transcepta.com tional and Islamic banking operations LoadSpring Becomes Oracle Gold Partner at retail, commercial, midsize enterprise, LoadSpring Solutions has achieved Gold levels of customer retention, and create and corporate levels, status in Oracle PartnerNetwork in recogni- differentiation in the marketplace. Gold and incorporates a full tion of its expertise in Oracle’s Primavera P6 members also become eligible to resell all complement of trans- Enterprise Project Portfolio Management Oracle technology products and can apply actional services. solutions and for addressing the challenges to resell Oracle applications and industry Oracle Database Ready and Oracle of joint Oracle/LoadSpring customers. solutions. In addition, they receive access to WebLogic Ready are components of the LoadSpring resells project management Oracle account representatives and My Oracle Oracle Exastack Ready program. That software and offers hosting and implemen- Support updates for all products, discounts program recognizes partners who have devel- tation services to its customers. on training, limited free assessment/exam oped, tested, and tuned their applications With its Gold status, LoadSpring receives vouchers, reduced rates on the purchase of on component parts of the Oracle Exadata the benefit of being able to start developing Oracle licenses for internal use, discounts on Database Machine (pictured above) or Oracle specializations that will allow it to grow its advanced customer services, and more. Exalogic Elastic Cloud engineered systems. business, increase its expertise, reach higher loadspring.com infopro.com.my

Cintra Achieves Three Avnet Distributes Oracle Healthcare Information Exchange and Specializations Analytics in U.S. and Canada Cintra Software & Services, an Oracle Avnet Technology Solutions is now autho- exchanges using Oracle Health Sciences Platinum Partner, has earned three Oracle rized to distribute Oracle Health Sciences solutions. Those Avnet partners participate PartnerNetwork specializations: Oracle solutions in the U.S. and Canada. Those in Avnet’s SolutionsPath practices, which Linux, Oracle Data Warehousing, and solutions include Oracle’s healthcare infor- include strategic planning consultation on Oracle Exadata Database Machine. Cintra mation exchange and Oracle enterprise high-growth vertical markets and data center also holds Oracle Database 11g, Oracle healthcare analytics. Oracle Health Sciences technology areas. Real Application Clusters, Oracle Database has authorized Avnet to distribute these spe- Avnet helps its partners to obtain special- Performance Tuning, Oracle GoldenGate 10, cialized solutions because of Avnet’s proven ization in Oracle Health Sciences solutions and Oracle Business Intelligence Foundation ability to develop and foster an ecosystem of through its “Under Our Wing” program that Suite specializations. highly skilled healthcare IT solution provider includes curricula, study guides, exam syllabi, Cintra’s achievement of multiple special- partners through its SolutionsPath method- and more. izations demonstrates its understanding ology and HealthPath practice. avnet.com of how various Oracle solutions can work Under this agreement , Oracle Platinum together to create value across an organiza- Partner Avnet will support a team of SAVE THE DATE tion. Cintra provides database infrastructure healthcare IT solution providers—Avnet Oracle PartnerNetwork Exchange services including design, implementation, partners—who assist midsize hospitals with @ OpenWorld and ongoing remote DBA support. issues related to accountable care, electronic September 30–October 4 oracle.com/opnexchange

cintra.com health records, and healthcare information GROENING LINDY

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_partner.indd 26 5/23/12 10:25 AM Community Bulletin by Justin Kestelyn 27

Bring the Noise Passion and participation drive the Oracle Technology Network Architect Community.

n this issue, Bob Rhubart, manager of the It is the architect’s nity leaders and technical experts at a wide I architect community on Oracle Technology variety of live, in-person events, including Network, provides an update for and about job to see that all the ongoing series of Oracle Technology that community. Network Architect Days. Oracle Technology Network is orga- of those pieces fit Of course, conversation is a two-way nized around four pillars: Java developers, into a coherent, fully process. So while we invite you to take database administrators and developers, advantage of the stream of architecture system administrators and developers, and functioning whole. content on Oracle Technology Network architects. The boundaries between those as an information consumer, it is equally community segments are fuzzy and porous, no means the sole source of the architec- important that you contribute to the stream. reflecting the practical reality of enterprise ture content on Oracle Technology Network. The aforementioned social channels offer IT, where individual players often straddle Members of the Oracle ACE and Oracle ACE an easy, informal way to participate in the multiple roles. Each role makes a specific Director programs, whose collective expertise conversation. But those interested in a more contribution to the creation, implementa- spans a variety of specialties, are high on the in-depth, formal approach are encouraged tion, and maintenance of IT solutions, and list of contributors. The resulting content to submit articles for publication in order to each contribution is an integral piece of the stream draws from articles, blog posts, social demonstrate and publicize their architecture larger IT puzzle. While each role is essential network updates, podcasts, and videos. expertise and practical knowledge. to the overall process, it is the architect’s Just as architecture itself focuses on In the end, a community is about more job to see that all of those pieces fit into a ensuring that the various elements of a solu- than shared interests. It is a collection of coherent, fully functioning whole. tion fit together and act as a cohesive whole, individual voices and opinions. True, that can That’s not to say that architects stand the architect pillar strives to funnel and filter often be a cacophonous chorus. But that’s above the other roles. But architecture is, by the community information stream into a when you know that the participants are pas- necessity, the context in which all of the indi- coherent channel that represents the inter- sionate about the topic. Oracle Technology vidual roles must operate. This is increas- ests and serves the needs of the architect Network is listening, always working to ingly true as service orientation, cloud com- community. The focal point of that effort gather and distill the architecture conversa- puting, the wildly expanding use of mobile is the Oracle Technology Network Architect tion in a way that makes sense and provides devices, social computing, and the explosion home page, a portal to a wide variety of the greatest value to the community. That’s of data continue to reshape not just the IT resources for architects. our end of the bargain. It’s up to you to add landscape but the very environment in which Among those resources is IT Strategies your voice and your passion.  businesses operate. from Oracle, an evolving library of reference Architects must be able to clearly commu- architectures and best practices. Another Web Locator nicate how all the pieces fit together within is the OTN ArchBeat podcast, featuring an the solution, and how the solution fits into ongoing series of panel discussions in which Oracle Technology Network Architect the larger enterprise picture. That’s no small subject matter experts and community Home Page task, which is exactly why Oracle recognizes leaders share insight in an open forum. oracle.com/technetwork/architect the role of the architect. Speaking of open forums, the Architect Article Submission Guidelines bit.ly/KqsNmM In supporting the architect community, home page also includes links to companion OTN ArchBeat Podcast Oracle Technology Network draws on the com- social channels on Facebook and Twitter feeds2.feedburner.com/OtnArch2Arch munity itself, especially the leaders within where you can track and participate in the ArchBeat Blog that varied and dynamic network: experienced community conversation as it happens. blogs.oracle.com/archbeat/ IT professionals whose interests center on Moving out of social networks and into OTN ArchBeat on Twitter Oracle technologies and how they fit into the the real world, the events listings on the twitter.com/otnarchbeat enterprise IT ecosystem. Oracle’s own experts Architect home page will keep you up to date OTN ArchBeat Facebook Page facebook.com/otnarchbeat are part of that community, but they are by on opportunities to connect with commu-

CONNECT: blogs.oracle.com/otn on.fb.me/otnfb twitter.com/oracletechnet linkd.in/otnli

oracle magazine July/august 2012

JA12_community.indd 27 5/21/12 12:39 PM 28 Architect By Bob Rhubart

Catching Up to Mobile Computing Mobile computing presents challenges and opportunities for architects.

f mobile computing isn’t already on Smartphones now smart caching solutions that leverage a I your architect radar, it will be. Apple has memory grid will play an important role.“ sold 55 million iPads since 2010. Gartner account for nearly Jellema also cites user expectations and expects a 98 percent increase in tablet sales the unique characteristics of mobile apps as in 2012, to 118 million. Nielsen reports that half of all mobile significant considerations. “Mobile apps are a smartphones now account for nearly half of phones in the U.S. mashup of various social networks, multiple all mobile phones in the U.S., a 38 percent types of rich data, and technical aspects such increase over 2011. And the mobile jugger- oriented architecture (SOA), building mobile as communication protocols and types of naut is just getting started. applications may be a bridge too far,” he says. data,” he says. “And the expectation of imme- Karina Ishkhanova, technical lead for “We need to make sure that mobile com- diate response and constantly fresh data will payment systems architecture and design puting converges with a SOA environment by have serious and interesting consequences at School-Day Solutions, sums up her take correlating service capabilities with the needs with regard to event-driven architecture.” on the mobile challenge for architects in of the mobile applications.” Folding mobile computing into the enter- one word: uncertainty. That uncertainty, Addressing the needs of mobile applica- prise IT mix seems inevitable as consumers’ according to Ishkhanova, applies to the evo- tions will require a head-on approach. “The enthusiastic embrace of mobile computing lution of the operating systems for mobile growth in mobile computing forces architects continues to change how they interact with apps, the availability of APIs and other nec- to think about multichannel delivery from the commercial, governmental, and social institu- essary components, and the stability of data ground up rather than as an afterthought,” tions. But as with any disruptive change in the streams that can be interrupted at any time says Anbu Krishnaswamy, an enterprise enterprise IT landscape, new challenges mean by lost connections or dead batteries. architect at Oracle. “The challenge for archi- new opportunities for architects.  “Properly designed, thought-through tects is to identify the right content for the architecture takes center stage and becomes right channel and reuse the plumbing under- Bob Rhubart a matter of survival not only for single neath to provide consistent access to the (bob.rhubart@oracle applications but for entire companies,” underlying business processes.” .com) is manager of the Ishkhanova says. “Mobile computing An organization’s ability to reuse existing architect community demands data loss–tolerant architectures “plumbing” and meet the increasing on Oracle Technology with multiplatform adaptability and insanely demands of mobile computing depends Network, the host of the optimized resource usage.” a great deal on the viability and integrity Oracle Technology Network ArchBeat podcast Those mobile computing demands place of the organization’s existing architec- series, and the author of the ArchBeat blog an even greater importance on inter- ture. “The introduction of multichannel (blogs.oracle.com/archbeat). operability and standards, according to support should have no major impact on an Oracle ACE Director Ronald van Luttikhuizen, architecture that has always followed best Next Steps managing partner at Vennster. “New devel- practices and core architecture principles opments happen so quickly nowadays that of abstraction, modularity, and reuse,” he Get more architect information your architecture needs to be able to support says. “In theory, mobile devices become just oracle.com/technetwork/architect the rapid development of new function- another delivery channel.” LISTEN to ArchBeat podcasts on mobile challenges ality and services,” van Luttikhuizen says. Even so, adding and supporting that bit.ly/Ia758G “Mashups, cloud computing, and service ori- mobile delivery channel won’t be without to all ArchBeat podcasts entation are a few things that can help.“ its challenges. “The scalability of enterprise feeds2.feedburner.com/otnarch2arch Mike van Alst, an architect with MShift, systems will be put to the test,” says Oracle bit.ly/9X6j2T believes that service orientation especially ACE Director Lucas Jellema, CTO at AMIS Get the Oracle mobile app for iPhone and iPad bit.ly/IqFhvL is key to mobile success. “Without service- Services. “To alleviate that anticipated load,

CONNECT: blogs.oracle.com/archbeat facebook.com/brhubart twitter.com/brhubart linkedin.com/in/bobrhubart

July/august 2012 Oracle.com/oraclemagazine

JA12_architect.indd 28 5/21/12 1:07 PM Peer-To-Peer by Blair Campbell 29

Immersion Learning Peers delve into social media, virtualization, and “extreme BI” to gain insight.

Johannes Ahrends Wissem Elkhlifi Stewart Bryson

Company: CarajanDB, a tech consulting firm Company: Motorola Mobility, a communications Company: Rittman Mead, a technology firm specializing in Oracle solutions corporation focused on Oracle business intelligence solutions Job title/description: Manager, focusing on Job title/description: Senior DBA, responsible Job title/description: U.S. managing director, the development of private cloud infrastructures, for Oracle Database installation, upgrades, overseeing projects, staff, and sales while doing especially for Oracle databases configuration, tuning, and PL/SQL development consulting and training Location: Erftstadt (near Cologne), Germany Location: Barcelona, Spain Location: Atlanta, Georgia Length of time using Oracle products: Oracle credentials: Oracle Certified Length of time using Oracle products: 20 years Professional (Oracle Database 10g) with 12 years 15 years experience using Oracle products

What’s your favorite tool or technique on How did you get started in IT? After receiving the job? The whole concept of managing What advice do you have for those just my master’s degree in philosophy, I realized storage in a grid infrastructure with Oracle getting into database development? I see that I needed to go out and make a living— Automatic Storage Management. With that a lot of programmers who, after taking on that I wouldn’t be able to generate a job very reliable infrastructure, it’s much easier a project, start programming immediately through a syllogism. After working at a to maintain an Oracle database, migrate it after reading a specification. In my opinion, marketing job, I decided my best bet was to to Oracle Real Application Clusters, or move it’s better to lean back and think about the get into technology. So I pounded the bricks it on the fly to a new SAN [storage-area task and the best way to approach it. Also, and convinced a company to give me a break network] box or other disk structures. take time to understand the concepts and in the application support group. What technology has most changed your best-practice examples. You’ll benefit in the Which Oracle technologies are you currently life? I’d say first computers, next the long run by avoiding performance problems, finding most valuable? I’ve been working with internet, and finally virtualization. I’ve been bad programming, and extensive bug-fixing. the combination of Oracle Exadata Database working with virtualization solutions for How are you using social media in your work Machine and Oracle Business Intelligence about four years now, and these solutions life? Lately I’ve become addicted to social Enterprise Edition 11g, delivered with an agile have allowed me to easily set up Oracle Real media tools such as Twitter and Facebook methodology. I like to call this setup “extreme Application Clusters with Oracle Database to connect with Oracle experts around BI.” These two technologies are a natural fit in 10g and Oracle Database 11g, and to create the globe. I’m now connected with many terms of performance and functionality. test databases with Oracle Data Guard and experts, including Hans Forbrich, Eddie What advice do you have for those just getting Oracle GoldenGate. Virtualization is also Awad, Syed Jaffar Hussain, Kai Yu, Ben into business intelligence development? helping us help our clients to save energy. Prusinski, and Tanel Poder. Most developers get their feet wet with How are you using social media in your What would you like to see Oracle, as a Oracle Business Intelligence Enterprise work life? I blog and use Twitter and company, do more of? Provide more Oracle Edition doing front-end development: Facebook, but Xing [xing.com, a professional documentation in Spanish, French, and delivering analytic reports and dashboards. business network]—which in Germany is German. Certainly English is the number I’d recommend getting started with Oracle more popular than LinkedIn—is my main one IT language, but there are a lot of Business Intelligence Enterprise Edition platform for connections to peers, looking for DBAs—especially here in Spain—who face metadata development first. This type of contacts, and exchanging basic knowledge difficulties understanding Oracle concepts development provides a deeper respect for through the site’s Oracle group. due to the language barrier. what the product can really deliver. 

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

oracle magazine July/August 2012

JA12_peer_R1.indd 29 6/4/12 11:09 AM 30

July/August 2012 Oracle.com/oraclemagazine

JA12_Database_Security_R1.indd 30 6/4/12 11:12 AM 31

Oracle Database security solutions deliver layers of enterprise information protection.

ackers who manage to Hbreak in to government and corporate enterprise systems make the news— sometimes very big news. An organization’s most privileged IT users may not get the same news attention, but their ability to access I-HUA CHEN I-HUA sensitive information as well BY DAVID BAUM as to configure systems, LOCKDOWN

ORACLE MAGAZINE JULY/AUGUST 2012

JA12_Database_Security_R1.indd 31 6/4/12 11:12 AM 32

Andrew Meade, senior database administrator at TransUnion Interactive, leads a team of DBAs charged with keeping the company’s data available, secure, and compliant. “We have a lot of sensitive information that we must protect, and Oracle gives us many different ways to defend our data against attacks,” he says.

modify databases, and grant privileges makes internal system panies overlook. According to Forrester Research, while 70 percent administrators and DBAs a security risk to the enterprise and a target of companies have an information security plan, only 20 percent of for hackers. And they aren’t the only potential liabilities: in some them have a database security plan. cases, sensitive production data moves through development and Samar thinks security professionals can learn a lesson from test environments, where any developer can see it. history. In medieval Europe, castles had multiple defenses—wide “In most organizations, two-thirds of sensitive and regulated data moats, high walls, iron doors, and even counterattacking archers resides in databases,” points out Vipin Samar, vice president of data- to repel different types of attackers. “Similarly, in the IT world, you base security technologies at Oracle. “Unless the databases are pro- have to defend your databases from casual onlookers, opportunistic tected using a multilayered security architecture, that data is at risk to insiders, and state-sponsored hackers,” he says. “Data is your king, be read or changed by administrators of the operating system, data- but if your defensive moat is a firewall of pawns, it is easy for an bases, or network, or hackers who use stolen passwords to pose as enemy knight to jump across and checkmate your king.” administrators. Further, hackers can exploit legitimate access to the database by using SQL injection attacks from the Web. Organizations Database Encryption need to mitigate all types of risks and craft a security architecture that Oracle Advanced Security, an Oracle Database 11g option, helps protects their assets from attacks coming from different sources.” organizations protect sensitive data on the network, on storage Companies spend billions of dollars each year securing their IT media, and within the database. It addresses privacy and regulatory systems worldwide, including software, services, and support, Samar requirements including the Payment Card Industry Data Security adds. Despite these massive investments, attacks have continued, Standard (PCI DSS), Health Insurance Portability and Accountability and the attackers—with the help of social engineering and sophis- Act (HIPAA), and numerous breach notification laws. ticated automated tools—have continued to succeed. This is partly A need to comply with PCI DSS regulations motivated TransUnion because traditional security strategies have focused on protecting Interactive to adopt Oracle Advanced Security’s Transparent Data the network perimeter and desktop and machines, rather than Encryption feature and Oracle Database Firewall. internal server assets. Ultimately, what is most important is pro- “We have a lot of sensitive information that we must protect,

tecting the databases themselves, yet this is the area that many com- and Oracle gives us many different ways to defend our data against Peter Stember

July/August 2012 Oracle.com/oraclemagazine

JA12_Database_Security.indd 32 5/25/12 10:51 AM 33

snapshot attacks,” says Andrew Meade, senior been time consuming and costly,” says TransUnion Interactive database administrator at TransUnion Meade. “For us, tokenization is not really a transunion.com Interactive. “We don’t want that informa- Headquarters: Chicago, Illinois viable solution.” tion stored in plain text on a disk. Oracle Industry: Financial services Full-disk encryption wasn’t viable either Advanced Security’s Transparent Data Oracle products: Oracle Database 11g, Oracle because it would have required TransUnion Encryption ensures that any time infor- Advanced Security, Oracle Database Firewall Interactive to take key databases offline mation is written to disk or backed up to whenever encryption keys are rotated. another location, it is completely encrypted.” “Neither solution satisfied our needs for a Meade leads a team of database administrators charged with zero-downtime implementation,” Meade says. keeping TransUnion Interactive’s data available, secure, and com- TransUnion Interactive chose Transpararent Data Encryption in pliant. It’s a high-volume, nonstop operation that processes thou- part because of the flexibility it provides. “Oracle Advanced Security sands of transactions per second. with Transparent Data Encryption is the perfect solution for us,” TransUnion Interactive is the consumer subsidiary of TransUnion, Meade says. “It lets us encrypt all of our data without any application providing credit-report, credit-monitoring, and alert services for con- or infrastructure changes. It’s fully integrated with Oracle Database. sumers along with educational tools to help them stay on top of their And key management is built in. No downtime is required to create finances and avoid identity theft. or rotate the keys, so it works well for us. It is easy to use, easy to “We used tablespace encryption in Oracle Database 11g to implement, and easy to maintain.” protect our databases and address regulatory compliance issues,” TransUnion Interactive recently passed a PCI audit that focused on says Ramdas Kenjale, director of architecture and infrastructure encryption and key rotation, validating the effectiveness of its Oracle at TransUnion Interactive. “This method allowed us to encrypt our solution. Users see little or no difference in the level of service. “The data very quickly, without changing our applications or modifying performance impact of Transparent Data Encryption is negligible,” our infrastructure. Transparent Data Encryption encrypts data when adds Meade. “In our case, it is less than 1 percent.” written to disk and decrypts it after a user has been successfully authenticated and authorized.” Oracle Database Firewall Kenjale says Oracle’s approach with Transparent Data Encryption TransUnion Interactive is now implementing Oracle Database shields his team from the details of encrypting specific columns in Firewall to complement its existing network security strategy. Most each database table. It fulfills PCI DSS requirements by encrypting security experts see database firewalls as an important adjunct to data in storage, in transit, and on backup media. All access controls network firewalls, which protect a data center from unauthorized that are enforced by Oracle Database remain in effect, including access from the outside. object grants, roles, virtual private database, and Oracle Database To guard against unauthorized database access, Oracle Database Vault. Oracle’s two-tier system includes a master encryption key that Firewall monitors the SQL network traffic going to the database, protects data encryption keys. and provides a first line of defense against threats originating from both outside and inside the organization. It monitors data access, Weighing the Alternatives enforces access policies, highlights anomalies, and protects against TransUnion Interactive considered alternatives from other security network-based attacks. vendors such as full-disk encryption, in which data is encrypted at “Oracle Database Firewall reveals precisely what types of queries the hardware level, and tokenization, in which a token represents are hitting our database, who is submitting them, and where they the actual data. “Tokenization would have meant changing all of come from,” says Meade. “All that information is exposed based on our applications and parts of our architecture, which would have our preferences, which we specify via a graphical user interface.”

Database Security: The Big Picture

Database security is an essential component toring and auditing of these privileged users. reduce threats from Web users. Deploy a data- of a complete IT security program. According to “Some organizations still use generic shared base firewall that can analyze SQL and prevent Vipin Samar, vice president of database security accounts, which doesn’t allow them to track which rogue statements from hitting the database. technologies at Oracle, it often begins with users made which changes,” says Samar. “Rather 2. Use data encryption to secure primary data- the three As: authentication, authorization, than granting excessive privileges for the sake of base and backup data when it is written to disk. and auditing. convenience, it is better to assign the least privi- 3. Encrypt network traffic to reduce the risk of Many Oracle customers implement Oracle leges for each user to do his or her job.” someone sniffing data on the wire. Identity Management to enable centralized access When considering their overall security archi- 4. Empower DBAs to tune and manage data- control, along with granular role-based controls tecture, Samar believes that customers should bases, but restrict them from viewing or modi- and provisioning capabilities. adopt a multitiered perspective by viewing fying sensitive data. In addition, Oracle Database Vault limits the potential threats from outside and inside the 5. Audit sensitive operations and the activities of activities of privileged users by placing sensitive database. He suggests that organizations follow privileged users. database tables and applications in a protective these guidelines: 6. Mask sensitive data before sharing it with realm. Oracle Audit Vault provides robust moni- 1. Use a network-based database firewall to development and testing teams.

oracle magazine July/August 2012

JA12_Database_Security.indd 33 5/25/12 10:52 AM 34

Meade is in the process of developing a white list and a black list Kuppinger sees database encryption and database firewalls as of various types of SQL statements. “Anything that is on the white an important part of a complete database security strategy. Other list gets through, and everything on the black list is blocked,” he essential technologies include data masking for test environments explains. “The database firewall analyzes SQL traffic. Based on poli- and controlling access to databases. “It’s important to have solutions cies we establish, it chooses to block, substitute, log, or send an alert for every aspect, starting with strong authentication and granular about each suspicious statement.” access control to databases, ensuring that operators and database In addition to evaluating the legitimacy of SQL statements, Oracle administrators can’t abuse their privileges,” Kuppinger concludes. “If Database Firewall can consider factors such as the requester’s IP you trust only one database security solution, you will fail to address address, time, and program name. TransUnion Interactive can choose all of these different aspects. Leaving some doors open doesn’t really to deploy it in blocking mode as a database policy enforcement system solve your enterprise security issues.”  as well as for supplemental auditing and compliance purposes. David Baum ([email protected]) is a freelance business writer. A Comprehensive View Martin Kuppinger, founder and principal analyst at KuppingerCole, a Next Steps leading analyst company for identity-focused information security, explains the importance of this type of defense. “While a network READ more about firewall controls access to IT resources at the IP level, it looks at database security packets, so it doesn’t have a very deep understanding of what “Effective Data Leak Prevention Programs: Start by Protecting Data at the happens at the SQL level. Database firewalls provide in-depth pro- Source—Your Databases” tection for communication to databases by monitoring and enforcing oracle.com/us/products/database/039434.pdf normal application behavior. They prevent SQL injection attacks and Oracle Database Security oracle.com/us/products/database/security/overview unauthorized SQL commands.”

Oracle Storage Networking, Powered by QLogic, Optimized with Oracle Linux

THE QLOGIC AND ORACLE alliance extends over 17 years of collaboration to deliver a stable, reliable, and highly responsive environment for your critical business needs. Oracle-branded storage networking products, powered by QLogic, offer the performance as well as the confi dence that comes with knowing this platform has been fully tested and optimized for Oracle Linux including the latest version of Oracle Linux 6. As a component of Oracle’s Validated Confi gurations, the StorageTek 8 Gb FC PCIe HBAs and Sun Storage 10 GbE FCoE CNAs are also integral to the Oracle Linux validated enterprise solutions. Together, Oracle Linux and QLogic enable organizations to confi dently deploy these solutions knowing that they will achieve the high performance, scalability, and reliability they have been seeking.

To fi nd out more about Oracle’s StorageTek 8 Gb FC PCIe HBAs and Sun Storage 10 GbE FCoE CNAs, powered by QLogic, and our partnership with Oracle Linux visit us at www.qlogic.com/go/oracle.

Oracle and Java are registered trademarks of Oracle and/or its affi liates. Other names may be trademarks of their respective owners.

July/August 2012 Oracle.com/oraclemagazine

JA12_Database_Security.indd 34 5/25/12 10:52 AM SEpt. 30 - OCt. 4, 2012 San FranCiSCO

rEGiStEr nOW Save $500 by July 13th

2,000 Sessions | 450 Exhibitors | 400 Demos

Register at oracle.com/openworld

Marquee Sponsor Diamond Sponsor Grande Sponsors

Marquee Sponsor Diamond Sponsor Grande Sponsors

Copyright © 2012, 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.

omg0712p035.indd 1 5/30/12 12:58 PM pUB nOtE: Please use center marks to align page. Master Ad Size Job No.: 412M_CRP_OOW12_OMag prODUCtiOn nOtES rEaDEr LaSEr% rELEaSED Headline: Register Now - Save $500 by July 13th Date: 05/22/2012 Project: Global Fulfillment 5/22 7.875” x 10.5” Type: Magazine 01 2012 Live: 7.125v” x 9.75” Trim: 7.875”x 10.5” Please examine these publication materials carefully. Oracle Magazine Bleed: 8.625”x 11.25” Any questions regarding the materials,

(Full Page Ad) Fonts: Univers LT Std. 75 Black, 65 Bold, 55 Roman, 45 Light, please contact Darci terlizzi (650) 506-9775 67 Bold Condensed, 57 Condensed

- 36

FUTURE -PROOF

JULY/AUGUST 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_developer.indd 36 5/25/12 8:45 AM 37

FUTURE -PROOFChoose the best of today’s tools to build next-generation Oracle Database applications. BY DAVID A. KELLY

rends in application development have come and gone over the years. TRemember when client/server was new? Rich, thick-client applications ran on UNIX-based and later on PCs. Remember the rise of the ? A Web browser on a PC became the delivery method for portable—across different desktops—thin-client applications. The next platforms for application delivery are here, and users are demanding a rich I-HUA CHEN I-HUA and portable experience on these rapidly evolving devices.

ORACLE MAGAZINE JULY/AUGUST 2012

JA12_developer_R1.indd 37 6/4/12 11:15 AM 38

Purdue Pharma’s Sayee Natarajan, director of sales systems (left), and Larry Pickett, vice president and CIO, rely on the development speed and agility of Oracle Application Express for rapid iteration. “We’ve been able to make changes based on business needs very quickly and very effectively,” Pickett says.

“These days, application developers are creating rich, browser- tiple platforms, including the iPad. based applications that need to work on everything from the corpo- Purdue is a privately held pharmaceutical company based in rate desktop to smartphones and tablets,” says Michael Hichwa, vice Stamford, Connecticut. The company—and independent associ- president of software development at Oracle. Hichwa is responsible ated companies—engage in the research, development, production, for several Oracle developer products aimed at database applica- and marketing of prescription and over-the-counter medicines and tion development, including Oracle SQL Developer (see “Database healthcare products. Purdue is an industry leader in pain manage- Development Choices” sidebar). ment and is introducing important products in other therapeutic According to Hichwa, development tools for Oracle database prod- areas such as insomnia. ucts are leveraging HTML5/CSS3 technology Since a restructuring in 2005, the at the same time that they’re becoming snapshots company has focused on bringing new, inno- more declarative, to facilitate faster develop- vative medicines to the marketplace while Purdue Pharma L.P. ment. “We want to enable our customers to simultaneously managing costs and creating purduepharma.com build out applications faster, and with all the Location: Stamford, Connecticut an agile IT infrastructure that can rapidly features they need,” Hichwa says. Employees: More than 1,500 adapt to meet changing business needs, all Faster application development enables Oracle products: Oracle Application Express, the while staying ahead of technology. organizations to see lower development costs Oracle Database “The rapid pace of technology change is and realize a faster return on investment. It something that we have to stay on top of,” says Lyris also makes it possible to keep up with the lyris.com Larry Pickett, vice president and CIO at Purdue. latest IT drivers, such as cloud, social net- Location: Emeryville, California “Over the past several years, we’ve focused on working, and mobile computing. Employees: 150 using newer technologies and approaches, to Revenue: US$40 million in 2011 support the growth of the company.” Oracle products: MySQL The Express Path For example, after the restructuring, Pickett Pharmaceutical company Purdue Pharma Spatial Eye and his team looked for creative ways to drive is one company with an eye on trends as it spatial-eye.com down costs while still meeting Purdue’s busi- deploys its state-of-the-art custom-built Location: Culemborg, the Netherlands ness needs. “That’s where Oracle Application customer relationship management (CRM) Oracle products: Oracle Data Provider for Express first came into play,” Pickett says. .NET, Oracle Database 11g Release 2, Oracle database application, originally built for Sayee Natarajan, Purdue’s director of sales Spatial, Oracle Workspaces

the desktop, to 1,000 field users on mul- systems, used Oracle Application Express to Gibbons Catherine

July/August 2012 Oracle.com/oraclemagazine

JA12_developer.indd 38 5/25/12 8:46 AM 39

prototype a new CRM solution to manage Purdue’s sales territories. “The new CRM system worked so well, we rolled it out to our entire field sales force,” says Pickett. “We’re continuously improving it with new capabilities, while continuing to receive rave reviews from users.” The application is also providing Purdue with significant cost savings. Comparing it to the system it replaced, Pickett estimates savings of about US$2 million annually, “so over the life of the system so far, we’ve saved the company roughly [US]$12 million,” he says. Another benefit is the agility and development speed Purdue gets from Oracle Application Express, says Natarajan. “Oracle Application Express allows us to do rapid iteration and rapidly respond to feedback from our users, proving that the agile develop- ment idea really works.” Pickett concurs. “We’ve been able to make changes based on business needs very quickly and very effectively,” he says. Based on input from users in the field, Natarajan’s team “has been able to iterate six major versions a year along with six minor versions.” According to Pickett, Purdue’s salespeople are very excited about Lyris needed a solid database that could scale for cloud deployments, says Navdeep Singh, vice president of IT and operations. MySQL was the solution. the solution—especially new hires coming from competitors. “Our salespeople feel that our Oracle Application Express–based CRM system is better than anything on the market,” says Pickett. “It’s dent of IT and operations at Emeryville, California–based Lyris. “We adding a lot of value.” needed a very solid database that could easily scale and seamlessly Over the years, Natarajan and his team have deployed the CRM integrate with other components—such as [Apache] Hadoop—to application to Microsoft Windows, Red Hat Linux, Oracle Linux, Mac enable the rapid processing of massive amounts of data and auto- OS, and most recently, the Apple iPad. The port to the iPad took only mate digital marketing activities.” Like many other companies Singh 90 days. “The fact that we could port our application to the iPad in had worked for in the past, Lyris developed its current application 90 days speaks to the power of Oracle Application Express and our offering using MySQL. ability to rapidly prototype,” says Natarajan. Lyris has been providing digital marketing automation solutions The company uses Oracle Application Express for more than 40 and services to its customers—sophisticated marketers who want to production applications, including its eCaseFile system for adverse deploy intelligent multichannel campaigns across e-mail, social, and events and the product R&D pipeline project-tracking system, both mobile channels—for more than 10 years. “Our software helps orga- of which are mission-critical. The project-tracking system, says nizations automate digital messaging campaigns using rules based Pickett, works on the iPad as well as the company’s portal and “cap- on the specific customer segments they’re targeting,” says Singh. tures all of the decisions and decision criteria for advancing projects For example, using the Lyris platform, marketers can define rules through our R&D pipeline to our product portfolio, so the system is that specify precise message sequences to selected subsegments, the tool we use to get new products to market—managing the cost, such as sending follow-up e-mails or social notifications to a group the timing, critical-path decisions, and so on. It’s a really innovative of customers only after an initial message has been viewed, and not application that our R&D executives are using.” sending subsequent messages to customers who have not yet taken action on earlier communications. Building Cloud-Ready Database Applications Lyris ensures that its products deliver top-notch performance by When you’re building a cloud-based product that must be able to scaling horizontally with multiple instances of MySQL Database and scale exponentially, you need a solid, reliable database solution. then taking advantage of MySQL’s replication feature. “Replication is “That’s where MySQL comes in,” says Navdeep Singh, vice presi- absolutely critical to scaling our technologies,” says Singh. “Multiple

Database Development Choices

When it comes to tools for building database easily step into the world of Web-based applica- productive tool that helps you build the best SQL applications, developers have many choices— tions by using a tool that’s embedded in Oracle and PL/SQL possible,” says Michael Hichwa, vice from Oracle and the open source community. Database. Development and deployment are fast president of software development at Oracle. Oracle Application Express. Oracle Application and easy, through a Web browser. Open source. Database developers can use many Express is a no-cost rapid Web application Oracle SQL Developer. Oracle SQL Developer is different open source dynamic scripting languages development tool included with all editions and a free tool from Oracle that provides a graphical and tools with Oracle database products, including releases of Oracle Database 11g. For developers interface for database development, a migration Ruby, Python, and PHP. PHP has long been associ- whose skills may be primarily SQL and PL/SQL, path from other databases, and data modeling ated with MySQL, and has been used with Oracle Oracle Application Express enables them to capabilities. “Oracle SQL Developer is a highly Database since Oracle Database 10g. Bo b Morris

oracle magazine July/August 2012

JA12_developer.indd 39 5/25/12 8:47 AM 40

The Spatial Eye product portfolio includes a spatial data ware- house application and an application called Call Before You Dig. Spatial Eye Call Before You Dig is an off-the-shelf solution that can be configured and customized for various communication processes (phone, fax, e-mail) and datasources. The company’s flagship product, Spatial Workshop (available in Standard, Professional, and Ultimate editions), lets users explore, visualize, query, analyze, and integrate spatial data to varying degrees. Spatial Eye Call Before You Dig and Spatial Workshop run on Windows and work with spatial data contained in an Oracle database running the Oracle Spatial option. Spatial Workshop can be used as a desktop application, or as a mobile field system. Geographic information from Oracle Spatial can be taken into the field using standard Oracle replication techniques, Spatial Eye depends on Oracle Data Provider for .NET for integration with Oracle so users have access to up-to-date information before they start databases, says Patrick van Dijk, lead developer and architect. tearing up a roadway, for example. Spatial Eye’s products and ser- vices also leverage the Oracle Workspaces API. replicas of the production database let us run sophisticated reports For example, a city planner designing a new electrical system for without affecting the performance of the core application.” This the city or a neighborhood can develop alternatives of the plan, and approach also provides Lyris with higher availability, because one of then use Oracle Workspaces to store and compare different versions. the many replicas can take over processing automatically if neces- Spatial Workshop supports a plug-in, developed using the Oracle sary, allowing marketers -solid application reliability and access Workspaces API, to tap into that data and facilitate the comparison. to up-to-the-minute reports that measure the impact of their digital But ODP.NET is the primary Oracle development tool for Spatial marketing initiatives. Eye. “ODP.NET is very rich, and the implementation does a lot,” says Singh also points out how much information and support is avail- van Dijk. “It scales well, both in terms of analysis and in getting data able to the MySQL developer and DBA communities, not only from from the Oracle server into the online application.” Oracle but also from MySQL internet support channels, newsgroups, community forums, and the like. “MySQL is really easy to monitor, Tools for Tomorrow manage, and maintain. And, you don’t necessarily need high-end Regardless of which tools developers use to create the next genera- hardware,” says Singh. tion of applications, development will still revolve around the data Singh doesn’t foresee any future problems scaling his MySQL held in relational databases, such as Oracle Database and MySQL. solution to meet his company’s evolving needs. “It’s pretty simple. “SQL is still the backbone of the industry,” says Oracle’s Hichwa. It’s Our product wouldn’t function without MySQL,” says Singh. “No still a very effective way to manipulate data, he adds, noting Oracle’s matter how our business evolves in the future, I’m certain MySQL goal is to make sure “developers have the best experience possible will be a part of it, especially given how well it plays with emerging big when creating applications that target Oracle databases.”  data technologies.” David A. Kelly (davidakelly.com) is a business, technology, and travel Digging Deeper with Oracle Data Provider for .NET writer who lives in West Newton, Massachusetts. Although Web-based delivery is the wave of the future for many appli- cations, the approach is not a one-size-fits-all solution. For example, Next Steps independent software vendor and Oracle partner Spatial Eye, located in the Netherlands, uses Microsoft tools and technologies such as READ more about Microsoft .NET to develop Microsoft Windows–based applications for MySQL spatial analysis. oracle.com/us/products/mysql For integration with Oracle databases, Spatial Eye’s Windows- Oracle Database 11g Release 2 oracle.com/us/products/database based solutions rely on Oracle Data Provider for .NET (ODP.NET) to Oracle Application Express move data. “From a developer perspective, ODP.NET is very easy to oracle.com/technetwork/developer-tools/apex/overview use,” says Patrick van Dijk, lead developer and architect at Spatial Oracle SQL Developer Eye. “ODP.NET integrates very well with our environments.” oracle.com/technetwork/developer-tools/sql-developer/overview Users of Spatial Eye software include utility companies, such as Oracle Data Provider for .NET power, water, and telecom, and also municipalities and other agen- oracle.com/technetwork/topics/dotnet/whatsnew/index-101716.html cies that may have underground physical assets that need to be iden- dynamic scripting languages oracle.com/technetwork/articles/dsl

tified and managed. Hendriks Ton

July/August 2012 Oracle.com/oraclemagazine

JA12_developer.indd 40 5/25/12 8:47 AM Java Developer Oracle ADF By Frank Nimphius 41

Oracle Application Development Framework and Oracle Jdeveloper Service, Please! Integrate Web services with Oracle ADF and Business Components applications.

esides being used in SOA, Web services In the JavaBean Data Control or Business accessed from a JavaBean wrapper in the Bare a common access pattern in Web Components approach, the Web services Business Components project. The JavaBean application development for remote data are accessed through the standard Java API wrapper is accessed from methods of the queries, application integration, and appli- for XML Web Services (JAX-WS) proxy client, WsDepartments entity object and the cation departmentalization. Rather than which gives you programmatic control for WsDepartmentsView view object. enabling developers to directly access data- manipulating data in transit. Rather than The JAX-WS Proxy Client, JavaBean base tables owned by other lines of business, using the JAX-WS proxy client alone, I recom- Wrapper, WsEntity, and WsViewObject companies can expose the services interface mend using it in conjunction with a JavaBean classes are all provided in the sample work- to ensure data integrity and consistent appli- wrapper. The wrapper provides a stable API for spaces. WsEntity and WsViewObject are code cation of business logic on the source data. your Business Components application inte- templates that assist in the development In this column, you will learn about the gration, so that if the Web service changes, of programmatic view objects and entities Web services integration options available for you’ll only need to regenerate your JAX-WS for Web services CRUD access. In general, Oracle Application Development Framework proxy client code and drop it into place. I recommend building templates such as (Oracle ADF) applications. Stepping through a The example provided with this column these for recurring tasks in your application sample application, you’ll learn how to embed shows you how to integrate a Web service development projects. (Both templates are calls from Oracle ADF’s Business Components and a Business Components application by located in the oramag.sample.application models into Web services for create, read, using this recommended approach. Before .model.fmwExtensions package of the update, and delete (CRUD) operations. delving into the step-by-step development Business Components project. Examine the process, let’s take a closer look at the inte- code to learn more.) Web Services Integration in gration architecture. In the sample integration this article Oracle ADF covers, you’ll first create the program- SOAP-based Web services and Oracle ADF Sample Application Integration matic entity object WsDepartments (using can be integrated in several different ways. Architecture a wizard in conjunction with the WsEntity Oracle ADF’s Web Service Data Control The sample applications include a basic class template) and then you’ll use that feature is easiest to configure at design time, but complete Java Platform, Enterprise object as the basis for the programmatic but it does not provide much control of a ser- Edition Web service and a starter Business view object WsDepartmentsView, which vice’s runtime behavior, nor of the exchanged Components application that you’ll extend you’ll also create by using the wizard and the data. Thus, using Web Service Data Control is to support integration with the Web service. WsViewObject class template. You’ll then best for simple interactions only. The Web service obtains data from the complete and test the integration by adding On the other hand, using the JavaBean Departments table in the Oracle HR sample the programmatic view object on the appli- Data Control feature or Business Components database schema. cation module, for use from the Oracle ADF feature of Oracle ADF supports deeper, more By default, Business Components Data Controls panel. complex integration scenarios. JavaBean queries data from database tables and Data Control can be used for integrations views. For Business Components to work Getting Started involving plain-old Java objects (POJOs). For with other datasources, such as Web ser- To begin, download the sample application applications that use Business Components vices, PL/SQL stored procedures, or Java at bit.ly/I5LIrR and unzip the file. The file as the business service layer, it makes sense Naming and Directory Interface (JNDI) ser- contains two folders: to integrate the Web service application at vices (LDAP, for example), developers create • starter-app contains two workspaces: the Business Components service integra- programmatic view objects and entities that a completed Web services application tion layer and take full advantage of Business override the Business Components frame- and a Business Components application Components benefits such as participating work default behavior. workspace with the JAX-WS proxy client in master-detail relationships and leveraging Figure 1 shows the class hierarchy contained in its own project. This article advanced framework features such as using and the integration architecture used in shows you how to complete the business model-driven lists of values. the sample. The JAX-WS proxy client is components in the project to integrate with

oracle magazine July/august 2012

JA12_adf.indd 41 5/21/12 1:52 PM 42 Java Developer

the Web services application. • completed-app contains completed JAX-WS Proxy Client application workspaces for the Business ADF Business Components application and the Web Components service. (As you’ll see, the completed app also includes some advanced capabilities.) JavaBean Wrapper HrDeptEmpServiceClientWrapper To follow the steps in this column, you’ll need the studio edition of Oracle JDeveloper 11g Release 2 (11.1.2.2) or later, available as a free download on Oracle Technology Entity Object extended by WsEntity Network. You’ll also need an Oracle Database WsDepartments Abstract Class instance with an unlocked HR schema. referenced by Preliminary setup tasks include changing extended by the database connection to point to your HR View Object WsViewObject WsDepartmentsView Abstract Class database schema from both the Business

Components application project and the exposed in Web services project, as follows: 1. Launch Oracle JDeveloper 11g Release 2. Application Module Select File -> Open, and navigate to the directory containing the unpacked sample application. Figure 1: Sample Oracle ADF Web service integration architecture 2. Open the starter-app folder and then the WebService folder, and select the At this point, the Web service has been provide information to Oracle JDeveloper WebService.jws file, followed by Open. deployed and is running on the integrated about the properties and datatypes provided The workspace will now open in Oracle Oracle WebLogic Server. You must also provide by the Web service. For the example integra- JDeveloper. the correct database connection information tion, the Web service Departments entity has 3. Select View -> Database -> Database for the Business Components application: the following properties defined: Navigator, and expand the WebService 8. Using File -> Open, navigate to the • BigDecimal departmentId; node to find the hrconn node. OraMag-AdfBcWsApp folder. • String departmentName; 4. Right-click the hrconn node, and select 9. Select the OraMag-AdfBcWsApp.jws file. • BigDecimal locationId; Properties from the context menu. Edit 10. Click Open to open the workspace. • BigDecimal managerId; the database connection information to 11. Select View -> Database -> Database You can obtain this information from the work with your setup. Test the changes, Navigator. Expand the OraMag- Departments.java class file or by examining and then click OK to close the connec­- AdfBcWsApp node, and right-click the the structure in the oramag.sample.proxy tion properties. hrconn node. .client.types package, located in the JaxWs- With a working connection to your data- 12. Select Properties from the context menu ProxyClient project. base, you can now deploy and run the Web to edit the database connection infor- You’ll use this information as you step service using Oracle WebLogic Server, which mation to work with your database con- through the wizard. With the OraMag- is integrated into Oracle JDeveloper. In the figuration. Test your changes, and then AdfBcWsApp application still selected, open Application Navigator click OK to close the connection proper- the Application Navigator. 5. Expand the hrDeptEmpService project ties. You can now start integrating the 1. Expand the AdfBcModel -> Application node and then the oramag.sample.jaxws Business Components application and Sources node and subsequent nodes until .hr.session package structure. the Web service. you can select the oramag.sample 6. Continue expanding the package struc- .application.model.entities package node. ture until you locate the class file Building a Web Service–Based 2. Right-click the oramag.sample hrDeptEmpServiceBean.java. Entity Object .application.model.entities package 7. Right-click hrDeptEmpServiceBean.java Web services are integrated into Business node, and select New Entity Object from and choose Run from the context menu Components via programmatic view the context menu. The Create Entity to deploy and run the service. (If a Create objects. To implement CRUD behavior, the Object wizard launches. In step 1 of 6 of Default Domain dialog box appears, create view objects must be based on an entity the wizard a password for the default Oracle WebLogic object that overrides the built-in frame- • In the Name field, type WsDepartments. Server domain associated with Oracle work methods, doDML and doSelect, of the • Uncheck the Existing Object checkbox. JDeveloper and click OK to continue.) Business Components entity object. You 3. Click Next and then Yes to accept

July/august 2012 Oracle.com/oraclemagazine

JA12_adf.indd 42 5/21/12 1:53 PM Java Developer 43

WSDEPARTMENTS as the schema 11. In the Override Methods dialog box, As with the programmatic entity object object name. check the Group By Class checkbox and creation, a wizard guides you through the 4. In step 2 of 6, click the New button then locate WsEntity (and its methods) process. These steps begin in the (repeatedly) to open a New Entity in the list. OraMag-AdfBcWsApp application in the Attribute properties page and create the Select the doDML and doSelect methods Application Navigator: four entity attributes detailed in Table 1. under the WsEntity class. Also check the 1. Expand the AdfBcModel -> Application When you have finished creating all four Copy Javadoc checkbox (at the bottom of the Sources node until the oramag.sample attributes, click Next. dialog box), so that the override instructions .application.model.views node appears. 5. Click Next to skip the wizard step 3 of 6. from the template populate the file. 2. Right-click the oramag.sample In the wizard step 4 of 6 12. Click OK. .application.model.views package node • Check the Generate Entity Object Class Oracle JDeveloper generates a Java class and select New View Object from the checkbox. containing method signatures and com- context menu. The Create View Object • Click the Classes Extend button to ments instructing you how to access the wizard launches. On the Name page launch the Override Base Classes JavaBean wrapper class in the AdfBcModel (Create View Object – Step 1 of 9) dialog box. project from this class. To simplify your tasks • Enter WsDepartmentsView in the entity 6. In the Override Base Classes dialog box, for this example integration, I’ve provided Name field. click the Browse button next to the Row the complete code for you. • Keep the Data Source option set to field. The Find Superclass search dialog 13. Open the entity-code-complete.txt file, Entity object. box appears. located in the entities package, and 3. Click Next to continue. On the Entity 7. Type WsEntity in the Match Class or copy and paste the file’s contents over Objects page (step 2 of 9) Package Name field. When the WsEntity WsDepartmentsImpl.java, replacing the • Expand the oramag.sample.application (oramag.sample.application.model entire generated content. .model.entities package, and select the .fmwExtensions) package appears in 14. Close all tabs in Oracle JDeveloper, and WsDepartments entity object. the dialog box, click it and then click OK save all your work. • Click the right arrow to move to save the change. Click OK again to You now have a programmatic entity WsDepartments to the Selected pane. dismiss the dialog box and redisplay the object that can be used as the basis for the Click Next. wizard step 4 of 6. view object that will access the Web service. 4. Click the double-arrow to move all 8. Click Finish to conclude the wizard. The next step is to create the programmatic Available attributes to the Selected pane. Oracle JDeveloper generates a custom view object. 5. Click Next until the wizard step 7 of 9 entity class, WsDepartmentsImpl, based appears. Set the Java properties for on the template, and places its metadata Building the Programmatic the view object as follows: check the file on the XML edit pane. Now you override View Object Generate View Object Class checkbox the abstract methods of the WsEntity tem- When using programmatic view objects, you (causes the wizard to create a custom plate class in WsDepartmentsImpl to make must override the Business Components view object implementation class whose Business Components write data updates to framework methods that query the database default framework methods you can the Web service. for data. The view object methods you will override). Under this checkbox 9. In the WsDepartments.xml editor, typically need to override include create, • Uncheck the Include bind variable select the Java menu option and the executeQueryForCollection, createRowFrom- accessor checkbox (the sample applica- link next to the Entity Object Class label ResultSet, getQueryHitCount, and hasNext- tion does not use bind variables). to open the entity implementation ForCollection. (See “Key Framework Methods • Uncheck the Include custom data class, WsDepartmentsImpl, in the to Override for Programmatic View Objects” in source methods checkbox. (In other Java code editor. Oracle Application Development Framework applications, you might use this feature 10. In the Java code editor, right-click Developer’s Guide For Forms/4GL Developers to generate signatures for the methods anywhere in the file and choose to learn more.) For this sample integration, to be overridden, but this sample appli- Source -> Override Methods from the the template provides much of the code, so cation provides you with a template context menu. you won’t be selecting all these methods. class for this task). • Click the Classes Extend button. In Name Type Other property to set the Override Base Classes dialog box, DepartmentId BigDecimal Check Primary Key checkbox click the Browse button (next to the DepartmentName String Set Database Column Type to VARCHAR2(30) Object field) to open the Search dialog ManagerId BigDecimal None box. In the Search dialog box, type LocationId BigDecimal None WsViewObject in the Match Class or Table 1: Attribute definitions for the custom entity object Package Name field. When the package

oracle magazine July/august 2012

JA12_adf.indd 43 5/21/12 1:54 PM 44 Java Developer

name appears in the Match Class or Package Name field, click the name to select it, and then click OK to exit the Search dialog box. Click OK again to redisplay step 7 of 9 of the wizard. 6. Click Finish to close the view object cre- ation wizard. In the WsDepartmentsView .xml editor, click the Java menu. 7. Select the link next to the View Object Class label to open the class in the Java code editor. 8. Move the cursor anywhere in the code within the Java editor, right-click, and choose Source -> Override Methods from the context menu. Figure 2: Web services integration application with advanced functionality 9. In the Override Methods dialog box, check the Group By Class checkbox to sort the methods by class. Locate 2. Right-click the AppModule entry, and select and view link between the WsDepartments WsViewObject in the list, and select its Open AppModule from the context menu. entity and the Employees entity, using createRowFromResultSet, 3. In the AppModule.xml editor window, the DepartmentId attribute to define the executeQuery­ForCollection, and click the Data Model menu. parent-child relationship. getQueryHitCount methods. Be sure to 4. In the Available View Objects field, The completed-app workspaces include check the Copy Javadoc checkbox. expand the oramag.sample.application this extra functionality as well as a model- 10. Click OK. .model.views package and select driven list of values on the DepartmentId The generated file is now populated with WsDepartmentsView. attribute of the EmployeesView object (see methods for accessing the JavaBean wrapper 5. Click the right arrow to move the selected Figure 2). I encourage you to explore the code class; the file includes comments (from the view object to the Data Model list. and learn about these powerful features. template’s javadoc) that include override 6. Right-click the WsDepartmentsView1 instructions. instance, and choose Rename from the Summary For your own integration projects, this context menu. Oracle ADF enables application developers is the approach you’ll take, overriding the 7. Rename the view object instance to integrate Web services into their Business methods as needed. For the purposes of this allWsDepartments and click OK before Components applications at the service article, I’ve provided that code for you. saving your work. layer, using a standard JAX-WS proxy client 11. Open the viewObject-code-complete.txt Assuming that the Web service you in conjunction with programmatic entity and file, located in the views package, and deployed during initial setup is still running, view objects.  copy and paste its entire contents over you can test the application by using the the entire WsDepartmentsViewImpl Oracle JDeveloper component tester. Frank Nimphius is a senior principal product class, replacing all the generated content. Right-click the AppModule entry in the manager for Oracle JDeveloper and Oracle 12. Save your work, and close all the open tabs. Application Navigator and choose Run from Application Development Framework. He is the context menu to launch the Business a coauthor of Oracle Fusion Developer Guide: Final Steps Component tester. Building Rich Internet Applications with Oracle At this point, you’ve created a programmatic In the opened Oracle ADF Model Tester, ADF Business Components and Oracle ADF entity object and a custom view object that double-click the allWsDepartments instance Faces (McGraw-Hill, 2010). uses the entity. To make these components to read data from the Web service. available to integrate the Web service with Click the arrows to browse and modify Next Steps the Business Components application, you the data, and see how the entity and view must expose the custom view object by objects you created populate the UI and READ more about Oracle ADF adding it to the application module. You can make changes to data on the Web service. bit.ly/KsyrKB also then test the integration. Starting from The Business Components project also con- DOWNLOAD the Application Navigator tains a pregenerated Employees entity and Oracle JDeveloper 11g bit.ly/KDqHjz 1. Expand the AdfBcModel -> Application view object that query employee data directly Sources node and the oramag.sample from the database. As an advanced self- the sample application for this article bit.ly/I5LIrR .application.model.services package. study exercise, create an entity association

July/august 2012 Oracle.com/oraclemagazine

JA12_adf.indd 44 5/21/12 1:55 PM Database Application Developer | PL/SQL PL/SQL 101 By Steven Feuerstein 45

Oracle Database Working with Collections Part 8 in a series of articles on understanding and using PL/SQL

n the previous article in this series, I defined. For example, a sparse collection You will rarely encounter a need for a I showed you how to work with a PL/SQL has an element assigned to index value 1 varray (How many times do you know in record, which is a composite datatype com- and another to index value 10 but nothing in advance the maximum number of ele- posed of one or more fields. In this article, between. The opposite of a sparse collection ments you will define in your collection?). I will explore another composite datatype, is a dense one. The associative array is the most commonly the collection. An Oracle PL/SQL collection Method. A collection method is a procedure used collection type, but nested tables is a single-dimensional array; it consists of or function that either provides informa- have some powerful, unique features one or more elements accessible through an tion about the collection or changes the (such as MULTISET operators) that can index value. contents of the collection. Methods are simplify the code you need to write to Collections are used in some of the most attached to the collection variable with dot use your collection. important performance optimization fea- notation (object-oriented syntax), as in tures of PL/SQL, such as my_collection.FIRST. Nested Table Example • BULK COLLECT. SELECT statements that Let’s take a look at the simple example in retrieve multiple rows with a single fetch, Types of Collections Listing 1, which introduces the many aspects increasing the speed of data retrieval. Collections were first introduced in Oracle7 of collections explored later in the article. • FORALL. Inserts, updates, and deletes that Server and have been enhanced in several When I run the block in Listing 1, I see the use collections to change multiple rows of ways through the years and across Oracle following output: data very quickly Database versions. There are now three types • Table functions. PL/SQL functions that of collections to choose from, each with its Veva return collections and can be called in the own set of characteristics and each best Steven FROM clause of a SELECT statement. suited to a different circumstance. You can also use collections to work with Associative array. The first type of collec- Listing 1 also includes references to the lists of data in your program that are not tion available in PL/SQL, this was originally lines in the code block and descriptions of stored in database tables. called a “PL/SQL table” and can be used how those lines contribute to the nested This article introduces you to collections only in PL/SQL blocks. Associative arrays can table example. and gives you a solid foundation in both col- be sparse or dense and can be indexed by lection syntax and features. integer or string. Declare Collection Types Nested table. Added in Oracle8 Database, the and Variables Collection Concepts and nested table can be used in PL/SQL blocks, Before you can declare and use a collec- Terminology in SQL statements, and as the datatype of tion variable, you need to define the type Before exploring collections, it is helpful to columns in tables. Nested tables can be on which it is based. Oracle Database have a common collections vocabulary that sparse but are almost always dense. They can predefines several collection types in sup- includes the following terms. be indexed only by integer. You can use the plied packages such as DBMS_SQL and Index value. The location of the data in a col- MULTISET operator to perform set opera- DBMS_UTILITY. So if you need, for example, lection. Index values are usually integers but tions and to perform equality comparisons to declare an associative array of strings for one type of collection can also be strings. on nested tables. whose maximum length is 32767, you could Element. The data stored at a specific index Varray. Added in Oracle8 Database, the write the following: value in a collection. Elements in a collection varray (variable-size array) can be used in are always of the same type (all of them are PL/SQL blocks, in SQL statements, and as l_names DBMS_UTILITY.maxname_array; strings, dates, or records). PL/SQL collec- the datatype of columns in tables. Varrays are tions are homogeneous. always dense and indexed by integer. When In most cases, however, you will declare Sparse. A collection is sparse if there is at a varray type is defined, you must specify the your own application-specific collection en

Ch least one index value between the lowest maximum number of elements allowed in a types. Here are examples of declaring each of

I-Hua I-Hua and highest defined index values that is not collection declared with that type. the different types of collections:

oracle magazine july/august 2012

JA12_PLSQL.indd 45 5/21/12 2:36 PM 46 PL/SQL 101

1. Declare an associative array of numbers, Code Listing 1: Nested table example indexed by integer:

1 DECLARE TYPE numbers_aat IS TABLE OF NUMBER 2 TYPE list_of_names_t IS TABLE OF VARCHAR2 (100); 3 INDEX BY PLS_INTEGER; 4 happyfamily list_of_names_t := list_of_names_t (); 5 children list_of_names_t := list_of_names_t (); 2. Declare an associative array of numbers, 6 parents list_of_names_t := list_of_names_t (); 7 BEGIN indexed by string: 8 happyfamily.EXTEND (4); 9 happyfamily (1) := ‘Veva’; TYPE numbers_aat IS TABLE OF NUMBER 10 happyfamily (2) := ‘Chris’; 11 happyfamily (3) := ‘Eli’; INDEX BY VARCHAR2(100); 12 happyfamily (4) := ‘Steven’; 13 3. Declare a nested table of numbers: 14 children.EXTEND; 15 children (children.LAST) := ‘Chris’; 16 children.EXTEND; TYPE numbers_nt IS TABLE OF NUMBER; 17 children (children.LAST) := ‘Eli’; 18 19 parents := happyfamily MULTISET EXCEPT children; 4. Declare a varray of numbers: 20 21 FOR l_row IN 1 .. parents.COUNT TYPE numbers_vat IS VARRAY(10) 22 LOOP 23 DBMS_OUTPUT.put_line (parents (l_row)); OF NUMBER; 24 END LOOP; 25 END; Note: I use the suffixes _aat, _nt, and _vat, for associative array type, nested table Lines Explanation type, and varray type, respectively. 2 I declare a new nested table type. Each element in a collection declared with this type is a string whose maximum You might be wondering why the syntax length is 100. for defining a collection type does not use 4–6 I declare three nested tables—happyfamily, children, and parents—based on my new collection type. Note that I also assign a default value to each variable by calling a constructor function that has the same name as the type. the word collection. The answer is that the 8 I “make room” in my happyfamily collection for four elements by calling the EXTEND method. IS TABLE OF syntax was first introduced in 9–12 I assign the names of the members of my immediate family (my wife, Veva; my two sons, Chris and Eli; and myself). Oracle7 Server, when there was just one type Note the use of typical single-dimension array syntax to identify an element in the array: array_name (index_value). of collection, the PL/SQL table. 14–17 Now I populate the children nested table with just the names of my sons. Rather than do a “bulk” extend as on line From these examples, you can draw the 8, I extend one index value at a time. Then I assign the name to the just-added index value by calling the LAST method, which returns the highest defined index value in the collection. Unless you know how many elements you following conclusions about collection types: need in advance, this approach of extending one row and then assigning a value to the new highest index value is • If the TYPE statement contains an INDEX the way to go. BY clause, the collection type is an associa- 19 Both of my children are adults and have moved out of the ancestral home. So who’s left in this place with too many bedrooms? Start with the happyfamily and subtract (with the MULTISET EXCEPT operator) the children. Assign the tive array. result of this set operation to the parents collection. It should be just Veva and Steven. • If the TYPE statement contains the VARRAY 21–24 The result of a MULTISET operation is always either empty or densely filled and starts with index value 1. So I will keyword, the collection type is a varray. iterate through all the elements in the collection, from 1 to the COUNT (the number of elements defined in the collection) and display the element found at each index value. • If the TYPE statement does not contain an INDEX BY clause or a VARRAY keyword, the collection type is a nested table. Initializing Collections Here is an example of initializing a nested • Only the associative array offers a choice of When you work with nested tables and table of numbers with three elements (1, 2, indexing datatypes. Nested tables as well as varrays, you must initialize the collection and 3): varrays are always indexed by integer. variable before you can use it. You do this • When you define a varray type, you specify by calling the constructor function for that DECLARE the maximum number of elements that type. This function is created automatically TYPE numbers_nt IS TABLE OF NUMBER; can be defined in a collection of that type. by Oracle Database when you declare the l_numbers numbers_nt; Once you’ve declared a collection type, you type. The constructor function constructs BEGIN can use it to declare a collection variable as an instance of the type associated with the l_numbers := numbers_nt (1, 2, 3); you would declare any other kind of variable: function. You can call this function with no END; arguments, or you can pass it one or more DECLARE expressions of the same type as the ele- If you neglect to initialize your collection, TYPE numbers_nt IS TABLE OF NUMBER; ments of the collection, and they will be Oracle Database will raise an error when you l_numbers numbers_nt; inserted into your collection. try to use that collection:

July/august 2012 Oracle.com/oraclemagazine

JA12_PLSQL.indd 46 5/21/12 2:37 PM PL/SQL 101 47

SQL> DECLARE that used a constructor function. Following 4. Fill a collection directly from a query with 2 TYPE numbers_nt IS TABLE OF are examples of the other approaches: BULK COLLECT (covered in more detail in NUMBER; 1. Assign a number to a single index value. the next article in this series): 3 l_numbers numbers_nt; Note that with an associative array, it is 4 BEGIN not necessary to use EXTEND or start DECLARE 5 l_numbers.EXTEND; with index value 1. TYPE numbers_aat IS TABLE OF 6 l_numbers(1) := 1; NUMBER 7 END; DECLARE INDEX BY PLS_INTEGER; 8 / TYPE numbers_aat IS TABLE OF DECLARE NUMBER l_numbers numbers_aat; * INDEX BY PLS_INTEGER; BEGIN ERROR at line 1: l_numbers numbers_aat; SELECT employee_id ORA-06531: Reference to uninitialized BULK COLLECT INTO l_numbers collection BEGIN FROM employees ORA-06512: at line 5 l_numbers (100) := 12345; ORDER BY last_name; END; END; You do not need to initialize an associative array before assigning values to it. 2. Assign one collection to another. As long Iterating Through Collections as both collections are declared with the A very common collection operation is to Populating Collections same type, you can perform collection- iterate through all of a collection’s ele- You can assign values to elements in a col- level assignments. ments. Reasons to perform a “full collection lection in a variety of ways: scan” include displaying information in the • Call a constructor function (for nested DECLARE collection, executing a data manipulation tables and varrays). TYPE numbers_aat IS TABLE OF language (DML) statement with data in the • Use the assignment operator, for single ele- NUMBER element, and searching for specific data. ments as well as entire collections. INDEX BY PLS_INTEGER; The kind of code you write to iterate • Pass the collection to a subprogram as an l_numbers1 numbers_aat; through a collection is determined by the OUT or IN OUT parameter, and then assign l_numbers2 numbers_aat; type of collection with which you are working the value inside the subprogram. BEGIN and how it was populated. Generally, you will • Use a BULK COLLECT query. l_numbers1 (100) := 12345; choose between a numeric FOR loop and a The previous section included an example l_numbers2 := l_numbers1; WHILE loop. END; Use a numeric FOR loop when Answer to the Challenge • Your collection is densely filled (every index 3. Pass a collection as an IN OUT argument, value between the lowest and the highest The PL/SQL Challenge question in last issue’s “Working with Records in PL/SQL” article and remove all the elements from that is defined) tested your knowledge of how to declare a collection: • You want to scan the entire collection, not record variable based on a table or a cursor. terminating your scan if some condition The question asked which of the following DECLARE could be used in the question’s code block so is met that a value (“Keyboard”) from the question’s TYPE numbers_aat IS TABLE OF Conversely, use a WHILE loop when table would be displayed. All the choices are NUMBER • Your collection may be sparse listed below; only (c) and (d) are correct. INDEX BY PLS_INTEGER; • You might terminate the loop before you a. l_numbers numbers_aat; have iterated through all the elements in l_part plch_parts%TYPE; the collection

b. PROCEDURE empty_collection ( You should use a numeric FOR loop with l_part plch_parts; numbers_io IN OUT numbers_aat) dense collections to avoid a NO_DATA_ IS FOUND exception. Oracle Database will c. l_part plch_parts%ROWTYPE; BEGIN also raise this exception, however, if you try numbers_io.delete; to “read” an element in a collection at an d. END; undefined index value. CURSOR parts_cur BEGIN IS The following block, for example, raises a SELECT * FROM plch_parts; l_numbers (100) := 123; NO_DATA_FOUND exception: empty_collection (l_numbers); l_part parts_cur%ROWTYPE; END; DECLARE

oracle magazine july/august 2012

JA12_PLSQL.indd 47 5/21/12 2:37 PM 48 PL/SQL 101

TYPE numbers_aat IS TABLE OF NUMBER The following block will display three initially set to the lowest defined index value. INDEX BY PLS_INTEGER; artists’ names; note that the index values do If the collection is empty, both FIRST and l_numbers numbers_aat; not need to start at 1. LAST will return NULL. The WHILE loop ter- BEGIN minates when l_index is NULL. I then display DBMS_OUTPUT.PUT_LINE (l_numbers (100)); DECLARE the name at the current index value and call END; l_names DBMS_UTILITY.maxname_array; the NEXT method to get the next defined BEGIN index value higher than l_index. This func- When, however, you know for certain l_names (100) := ‘Picasso’; tion returns NULL when there is no higher that your collection is—and will always be— l_names (101) := ‘O’’Keefe’; index value. densely filled, the FOR loop offers the sim- l_names (102) := ‘Dali’;= I call this procedure in the following block, plest code for getting the job done. The pro- show_contents (l_names); with a collection that is not sequentially cedure in Listing 2, for example, displays all END; filled. It will display the three names without the strings found in a collection whose type / raising NO_DATA_FOUND: is defined in the DBMS_UTILITY package. This procedure calls two methods: FIRST If your collection may be sparse or you DECLARE and LAST. FIRST returns the lowest defined want to terminate the loop conditionally, a l_names DBMS_UTILITY.maxname_array; index value in the collection, and LAST WHILE loop will be the best fit. The proce- BEGIN returns the highest defined index value in dure in Listing 3 shows this approach. l_names (-150) := 'Picasso'; the collection. In this procedure, my iterator (l_index) is l_names (0) := 'O''Keefe';

Take the Challenge!

Each PL/SQL 101 article offers a quiz to test your knowledge of the informa- indx := l_names.NEXT (indx); tion provided in it. The quiz appears below and also at PL/SQL Challenge END LOOP; (plsqlchallenge.com), a Website that offers online quizzes on the PL/SQL END; language as well as SQL and Oracle Application Express. /

Question c. Which of the following blocks will display these three lines after execution: DECLARE l_names DBMS_UTILITY.maxname_array; Strawberry BEGIN Raspberry l_names (1) := 'Strawberry'; Blackberry l_names (10) := 'Blackberry'; l_names (2) := 'Raspberry'; a. DECLARE DECLARE l_names DBMS_UTILITY.maxname_array; indx PLS_INTEGER := l_names.FIRST; BEGIN BEGIN l_names (1) := 'Strawberry'; l_names (10) := 'Blackberry'; WHILE (indx IS NOT NULL) l_names (2) := 'Raspberry'; LOOP DBMS_OUTPUT.put_line (l_names (indx)); FOR indx IN 1 .. l_names.COUNT indx := l_names.NEXT (indx); LOOP END LOOP; DBMS_OUTPUT.put_line (l_names (indx)); END; END LOOP; END; END; / / d. b. DECLARE DECLARE l_names DBMS_UTILITY.maxname_array; l_names DBMS_UTILITY.maxname_array; BEGIN BEGIN l_names (1) := 'Strawberry'; l_names (1) := 'Strawberry'; l_names (10) := 'Blackberry'; l_names (10) := 'Blackberry'; l_names (2) := 'Raspberry'; l_names (2) := 'Raspberry'; FOR indx IN l_names.FIRST .. l_names.LAST indx := l_names.FIRST; LOOP DBMS_OUTPUT.put_line (l_names (indx)); WHILE (indx IS NOT NULL) END LOOP; LOOP END; DBMS_OUTPUT.put_line (l_names (indx)); /

July/august 2012 Oracle.com/oraclemagazine

JA12_PLSQL.indd 48 5/21/12 2:38 PM PL/SQL 101 49

l_names (307) := 'Dali'; Code Listing 2: Display all strings in a collection show_contents (l_names);

END; CREATE OR REPLACE PROCEDURE show_contents ( / names_in IN DBMS_UTILITY.maxname_array) IS BEGIN I can also scan the contents of a collection FOR indx IN names_in.FIRST .. names_in.LAST in reverse, starting with LAST and using the LOOP DBMS_OUTPUT.put_line (names_in (indx)); PRIOR method, as shown in Listing 4. END LOOP; END; Deleting Collection Elements / PL/SQL offers a DELETE method, which you can use to remove all, one, or some elements Code Listing 3: Use WHILE to iterate through a collection from a collection. Here are some examples: 1. Remove all elements from a collection; CREATE OR REPLACE PROCEDURE show_contents ( use the DELETE method without any names_in IN DBMS_UTILITY.maxname_array) arguments. This form of DELETE works IS with all three kinds of collections. l_index PLS_INTEGER := names_in.FIRST; BEGIN WHILE (l_index IS NOT NULL) l_names.DELETE; LOOP DBMS_OUTPUT.put_line (names_in (l_index)); l_index := names_in.NEXT (l_index); 2. Remove the first element in a collection; END LOOP; to remove one element, pass the index END; value to DELETE. This form of DELETE / can be used only with an associative array or a nested table. Code Listing 4: Scan a collection in reverse

l_names.DELETE (l_names.FIRST); CREATE OR REPLACE PROCEDURE show_contents ( names_in IN DBMS_UTILITY.maxname_array) 3. Remove all the elements between the IS l_index PLS_INTEGER := names_in.LAST; specified low and high index values. This BEGIN form of DELETE can be used only with an WHILE (l_index IS NOT NULL) associative array or a nested table. LOOP DBMS_OUTPUT.put_line (names_in (l_index)); l_index := names_in.PRIOR (l_index); l_names.DELETE (100, 200); END LOOP; END; / If you specify an undefined index value, Oracle Database will not raise an error. You can also use the TRIM method with tions, which will be covered in a future article. Next Steps varrays and nested tables to remove ele- The next article in this PL/SQL 101 series ments from the end of the collection. You will explore how to use collections with DOWNLOAD Oracle Database 11g can trim one or many elements: PL/SQL’s most important performance- bit.ly/fherki related PL/SQL features: FORALL and TEST your PL/SQL knowledge plsqlchallenge.com l_names.TRIM; BULK COLLECT.  l_names.TRIM (3); READ PL/SQL 101, Parts 1–7 bit.ly/fc0uoJ Steven Feuerstein READ more Feuerstein Get Comfy with Collections (steven.feuerstein@ stevenfeuerstein.com It is impossible to take full advantage of quest.com) is Quest toadworld.com/sf PL/SQL, including some of its powerful Software’s PL/SQL Oracle PL/SQL Programming features, if you do not use collections. This evangelist. He has amzn.to/IDhqef article has provided a solid foundation published 10 books on Oracle PL/SQL Language Pocket Reference amzn.to/KuEMl6 for working with collections, but there are Oracle PL/SQL (O’Reilly Media) and is an Oracle Oracle PL/SQL Best Practices still several advanced features to explore, ACE Director. More information is available at amzn.to/JTXAcg including string-indexed and nested collec- stevenfeuerstein.com.

oracle magazine july/august 2012

JA12_PLSQL.indd 49 5/21/12 2:38 PM Great minds don’t think alike.

To continue to lead the way in technology and science, we must develop the next generation of innovators. Steps we take today can empower young people to develop and test their own ideas and approach science, technology, engineering, and math not just as fields of study in school but as ways of understanding our world.

Join the Lawrence Hall of Science in inspiring and preparing kids from all backgrounds to do science.

lawrencehallofscience.org/brilliant

JA_Oracle2.indd 8 5/21/11 3:56 AM DBA | Performance Tuning By Arup Nanda 51

ORACLE DATABASE Beginning Performance Tuning Resolve session performance issues in Oracle Database.

t’s the middle of the night, and you get a (idle), it’s really not slow at all—it just has update t1 I frantic call from someone complaining nothing to do. If a session is waiting for set col2 = 'y' that the database is slow. The caller demands some resource, such as a block or a lock, it where col1 = 1; to know why—and what you’re going to do has stopped processing. Until it gets that about it. Sound familiar? If it does, you are not resource, the session will continue to wait. This statement will hang. Why? The alone. High performance is a common expec- When it gets that resource, it does some answer is simple: the first session holds a lock tation of database system users: they get very processing and then moves on to the next on the row, which causes the second session unhappy when they don’t get it, and they are resource it needs, waits for that to be avail- to hang and the user to complain that the usually not shy about letting you know. What able, and starts processing . . . and the cycle session is slow. To know what the second should you do next? In this article, you will goes on until the session has nothing else to session is doing, the first thing you need to learn some techniques for troubleshooting do. If it waits for resources often, the session check is the STATE column in V$SESSION: Oracle Database performance issues. will appear slow. But it’s not really slow—it’s To use the scripts in this article, you need just following a pattern of go, stop, go again, select sid, state to create some tables in a test schema and stop again, and so on. Your mission is to find from v$session access some dynamic performance views. and eliminate the “stop” issues in the session. where username = 'ARUP'; The database user SYS has all privileges to How difficult is it to get information about access the views, so you need the password what’s causing the session to stop? It’s SID STATE for the SYS user. The script for setting up actually very easy: Oracle Database is instru- ————— ——————————————————————— the example tables is available in the online mented to talk about what the database ses- 3346 WAITING version of this article, at bit.ly/IvwqLE. sions are doing. All you need to do is to listen 2832 WAITED KNOWN TIME attentively or, more precisely, look for that Session State information in the right place, and that place Study the output carefully. Session 3346 Before you start troubleshooting why a data- is a view called V$SESSION. Everything you (in the SID column) indicates that it is base is slow, you have to first understand that need for your analysis is in this view. waiting for something—and therefore not the database itself is never slow or fast—it To explain how to use the V$SESSION working. That should be your first clue that has a constant speed. The sessions connected view, I will use a very common scenario—row the session is experiencing one of those per- to the database, however, slow down when locking—as an example. To follow along, first formance bumps in the road. But before you they hit a bump in the road. To resolve a set up the previously mentioned tables as can determine what the session is waiting session performance issue, you need to iden- described in the online version of this article. for, let’s study the state of session 2832 in tify the bump and remove it. Fortunately, it’s Then connect as user ARUP from two dif- the output, which shows that it waited for very easy to do this in most cases. ferent sessions. From the first session, issue some known amount of time earlier. The The first step to resolving a session perfor- the following SQL statement: important point is that session 2832 is not mance issue is to ascertain what that data- waiting for anything right now, meaning base session is doing now. An Oracle Database update t1 that it’s working productively. session is always in one of three states: set col2 = 'x' where col1 = 1; Next, let’s see what the second session 1. Idle. Not doing anything—just waiting to (3346) is waiting for. That information is be given some work. The output will show “1 row updated,” readily available in the EVENT column in the 2. Processing. Doing something useful— indicating that the row was updated. Do same V$SESSION view. The EVENT column running on the CPU. not issue a COMMIT after the statement. By not only shows an event a session is waiting 3. Waiting. Waiting for something, such not committing, you will force the session for currently, but also shows an event a session as a block to come from disk or a lock to to get and hold a lock on the first row of the has waited for earlier. The query against be released. T1 table. Now go to the second session and V$SESSION in Listing 1 displays information If a session is waiting to be given work issue the following SQL statement: from the EVENT column for both sessions.

oracle magazine July/august 2012

JA12_TUNING.indd 51 5/21/12 3:17 PM 52 Tuning

The output in Listing 1 shows that session Code Listing 1: Query for displaying sessions, session state, and events 3346 is waiting right now for an event:

“enq: TX – row lock contention”—short select sid, state, event for “enqueue for transaction-level lock on from v$session where username = 'ARUP'; row” or, in plain English, a row-level lock. The session is waiting because it wants to SID STATE EVENT lock one or more rows, but another session ————— ————————————————————————— ———————————————————————————————————————————— 2832 WAITED KNOWN TIME SQL*Net message from client has already placed locks on the row or rows. 3346 WAITING enq: TX - row lock contention Unless that other session commits or rolls back its transaction, session 3346 will not Code Listing 2: Query for displaying sessions, session state, and wait details get the lock it needs and will have no choice but to wait. On the other hand, the state of session 2832, “WAITED KNOWN TIME,” col "Description" format a50 select sid, means that it is working—not waiting— decode(state, 'WAITING','Waiting', right now. It was, however, waiting earlier 'Working') state, for an event called “SQL*Net message from decode(state, 'WAITING', client” (I will discuss this specific event 'So far '||seconds_in_wait, later.) There is one very important lesson 'Last waited '|| in these results: you cannot look at the wait_time/100)|| ' secs for '||event EVENT column alone to find out what the "Description" session is waiting for. You must look at the from v$session STATE column first to determine whether where username = 'ARUP'; the session is waiting or working and then Output: inspect the EVENT column. SID STATE Description After you determine that a session is ————— —————————— ——————————————————————————————————————————————————————————————————————————————— waiting for something, the next thing you 2832 Working Last waited 2029 secs for SQL*Net message from client 3346 Waiting So far 743 secs for enq: TX - row lock contention need to find out is how long the session 4208 Waiting So far 5498 secs for SQL*Net message from client has been waiting. A very long wait usually indicates some sort of bottleneck. Where can you get information on the length of the Idle Event STATE column value; it still shows “Waiting.” waiting period? The answer is right there in Note the details of session 4208 in Listing 2; You have to check the EVENT column to the V$SESSION view, in the SECONDS_IN_ it’s currently waiting 5,498 seconds for a determine whether the session is truly idle. WAIT column. “SQL*Net message from client” event. Recall You may be tempted to modify the query Getting the amount of time a session has from the previous section that an Oracle in Listing 2 to filter sessions that include been waiting makes sense for sessions that Database session can be in one of the three the “SQL*Net message from client” and are waiting right now, but what about the states: working, waiting for a resource, or “rdbms ipc message” idle events. Although sessions that are working now? Recall that waiting for work. But how can a session you can do that, I highly discourage doing the EVENT column shows not only the event determine whether it is idle? It will expect that, for multiple reasons. First, not all a session is experiencing now but also the to be given work by clients via SQL*Net, but instances of the “SQL*Net message from last wait event the session has experienced. there is no way for it to know in advance if client” event indicate that the session Another column—WAIT_TIME—in the same any work is coming from the clients. All it is idle. Consider the possibility that the V$SESSION view shows how long that wait can do is wait for some instruction coming network might be truly slow, in which case lasted. (Note that WAIT_TIME is shown in through SQL*Net. Until then, it will have the session will also wait for these events. centiseconds [hundredths of a second].) nothing else to do but eagerly stare at the Remember, the session doesn’t have the Now that you know how to get informa- SQL*Net interface, and this condition is ability to determine whether the client is tion on the sessions waiting and working, reported as “SQL*Net message from client” truly idle or is sending instructions that are let’s put all the information together in a in the V$SESSION view’s EVENT column, slow or stuck in the network. All it can do single query, shown in Listing 2. It clearly which is practically the same thing as just is wait, and it will wait with the “SQL*Net shows the state of the sessions: whether they being idle. message from client” event. Second, idle are working or waiting; if they are working, You can disregard another EVENT column events may provide some clues to Oracle what they were waiting for earlier and for value, “rdbms ipc message,” because it is an Support about what else is going on inside how long; and if they are waiting, what for event status for sessions that are idle. Note a session. So I recommend displaying these and for how long. that an idle session does not show IDLE as the “idle” EVENT values.

July/august 2012 Oracle.com/oraclemagazine

JA12_TUNING.indd 52 5/21/12 3:18 PM Tuning 53

Diagnosis of Locking Code Listing 3: Getting row lock information The output of Listing 2 provides enough

information to enable you to make a diag- select row_wait_obj#, nosis about the performance of these three row_wait_file#, row_wait_block#, sessions. Session 4208 is idle, so any com- row_wait_row# plaints that session 4208 is slow just aren’t from v$session related to the database. Any performance where sid = 3346; issues related to this session could be related ROW_WAIT_OBJ# ROW_WAIT_FILE# ROW_WAIT_BLOCK# ROW_WAIT_ROW# to a bug in the code that’s going through an ——————————————————— ———————————————————— —————————————————————— ——————————————————— infinite loop or high CPU consumption on 241876 1024 2307623 0 the application server. You can redirect the To get the object information: performance troubleshooting focus toward the application client. select owner, object_type, object_name from dba_objects The story of session 3346 is different. where data_object_id = 241876; This session is truly a bottleneck to the application. Now that you know why this OWNER OBJECT_TYPE OBJECT_NAME ——————— ———————————————— ———————————————— session appears slow—it is waiting for ARUP TABLE T1 a row lock—the next logical question is which session holds that lock. The answer is also found in—I hope you guessed it—the Code Listing 4: Finding the row information V$SESSION view, in, more specifically, the BLOCKING_SESSION column. (Note that in REM Filename: rowinfo.sql an Oracle Real Application Clusters [Oracle REM This shows the row from the table when the REM components of ROWID are passed. Pass the RAC] environment, the blocking session REM following in this exact order may exist in a different instance. In such REM 1. owner a case, the blocking instance is displayed REM 2. table name in the V$SESSION view’s BLOCKING_ REM 3. object_id REM 4. relative file ID INSTANCE column.) REM 5. block ID You can find out the blocking session REM 6. row Number and instance by issuing the following SQL REM select * statement: from &1..&2 where rowid = select dbms_rowid.rowid_create ( rowid_type => 1, blocking_session B_SID, object_number => &3, blocking_instance B_Inst relative_fno => &4, from v$session block_number => &5, row_number => &6 where sid = 3346; ) / B_SID B_INST SQL> @rowinfo ARUP T1 241876 1024 2307623 0 —————— ——————— 2832 1 COL1 C ————— — 1 x The output shows clearly that SID 2832 is holding the lock that SID 3346 is waiting for. Now you can follow a cause/effect relation- the object number of the table whose row is ROW_WAIT_BLOCK#, and ROW_WAIT_ ship between the session in which an update being locked. You can then get the name of ROW#—which show the relative file ID, to a row is being blocked and the session that the table from the DBA_OBJECTS view, using the block ID in that file, and the row’s slot holds the lock on that row. this object number, as shown in Listing 3. number inside that block, respectively, for You can find the specific row that is locked The output shows that some row in the that specific row. Using this information, by first finding the table containing that row. T1 table is the point of the row lock con- you can identify the ROWID of the row. The To find that table, use the same V$SESSION tention. But which specific row is locked? ROWID, the physical address of every row in view; in this case, the information is in the That data is available in three V$SESSION an Oracle Database instance, can be used to ROW_WAIT_OBJ# column, which shows view columns—ROW_WAIT_FILE#, uniquely identify a row.

oracle magazine July/august 2012

JA12_TUNING.indd 53 5/21/12 3:19 PM 54 Tuning

Listing 4 shows a SQL script that enables Code Listing 5: Sessions from a specific user you to select the specific blocking row from

the table with the information gathered so select SID, osuser, machine, terminal, service_name, far. Save this script in a file named rowinfo logon_time, last_call_et from v$session .sql. The script expects the input in the fol- where username = 'ARUP'; lowing order: owner, table name, object#, file#, block#, and row#. You can call this SID OSUSER MACHINE TERMINAL SERVICE_NAME LOGON_TIME LAST_CALL_ET ————— ———————— —————————— ——————————— ————————————————— —————————————— ————————————————— script and pass all the requested parameters 3346 oradb prodb1 pts/5 SYS$USERS 05-FEB-12 6848 by copying and pasting the corresponding 2832 oradb prodb1 pts/6 SERV1 05-FEB-12 7616 output from Listing 3. 4408 ANANDA ANLAP ANLAP ADHOC 05-FEB-12 0 The output in Listing 4 shows the specific OSUSER. The operating system user as which the client is connected. The output indicates that session 4408 row on which a lock is being requested but is connected from the ANLAP machine, where a Windows user, ANANDA, has logged in. that is locked by another session. So far you MACHINE. have identified not only the source session The name of the machine where the client is running. This could be the database server itself. For two of the sessions, the machine name shows up as “prodb1.” Session 4408 runs on a different machine— of the locking but the specific row being ANLAP—presumably a laptop. locked as well. TERMINAL. Is it possible that the session holding the If the session is connected from a UNIX server, this is the terminal where it runs.

lock (SID 2832) is somehow disconnected LOGON_TIME. This shows when the session was first connected to the Oracle Database instance. from the client? That can occur in connec- LAST_CALL_ET. tion pools or when users access the database This shows when the session last issued some SQL. The output indicates that session 3346 made its last SQL call 6,848 seconds ago. with thick-client tools such as Oracle SQL Developer. After you identify the session holding the lock, you may want to wait until Code Listing 6: Session waits for a specific machine it commits or rolls back the transaction. Either action releases the lock. col username format a5 col program format a10 In the case of a dead connection, you col state format a10 may alternatively decide to kill the session, col last_call_et head 'Called|secs ago' format 999999 which will force a rollback releasing the col seconds_in_wait head 'Waiting|for secs' format 999999 col event format a50 locks held by the blocking session and select sid, username, program, enabling the waiting sessions to continue. decode(state, 'WAITING', 'Waiting', Occasionally the problem can be pretty 'Working') state, last_call_et, seconds_in_wait, event simple: for instance, someone issued an from v$session UPDATE statement from a thick-client tool where machine = 'appsvr1' but forgot to commit and thus caused every / Called Waiting session to wait for those updated rows. SID USERNAME PROGRAM STATE secs ago for secs EVENT Identifying that blocking session enables ————— ———————————— ———————————————— —————————— ———————————— ———————————— ———————————————————————————— you to send a gentle reminder to rectify that 2832 ARUP sqlplus.exe Waiting 152 151 SQL*Net message from client situation immediately. 3089 ARUP sqlplus.exe Waiting 146 146 enq: TX - row lock contention More on the Session 3346 ARUP sqlplus.exe Working 18 49 SQL*Net message from client In many troubleshooting situations, just knowing the SID of each session is not enough. You may need to know other details, user’s sessions. the appsvr1 application server. All of them such as the client machine the session is con- Suppose you receive a complaint that are running SQL*Plus (as shown in the necting from, the user (of both the database the applications running on the applica- PROGRAM column). SID 3346 is the only one and the operating system), and the service tion server named appsvr1 are experiencing that is working (indicated by “Working” in name. All of this information is also readily performance issues. Listing 6 shows a query the STATE column). Because it’s working, available in the same V$SESSION view you against the V$SESSION view—including the EVENT column shows the last time the have been using. Let’s briefly examine the columns you’ve used in previous queries in session waited. The wait time in this case columns that provide that information, by this article—for the sessions connected from is meaningless, because the session is not running the script shown in Listing 5. that machine and the output. waiting but actually working. The “Called Using the columns shown in Listing 5, From the output, you can easily see secs ago” column (representing the “last_ you can get very detailed information on a that three sessions are connected from call_et” column in V$SESSION) displays 18,

July/august 2012 Oracle.com/oraclemagazine

JA12_TUNING.indd 54 5/21/12 3:19 PM Tuning 55

which means that the session made a SQL SQL_FULLTEXT mance tuning session: call 18 seconds ago. ————————————————————————————————————————————————————— 1. Check whether the session is working The other sessions are waiting. SID 3089 update t1 set col2 = 'y' where col1 = 1 or waiting. If the latter, determine is waiting for a row lock. From the output, what it is waiting for and how long it has you can see that the session has been Data Access Issues been waiting. waiting for 146 seconds and that it also I have used row-level locking as the cause of 2. Compare the waiting period of the session made its last SQL call 146 seconds ago. This a slowdown in this article. Although locking- with how long ago it issued a SQL call. indicates that the session has been waiting related contention is a very common cause, 3. If the cause of the wait is a lock conten- for that particular lock ever since it made it is not the only cause of performance prob- tion, find the session holding the lock that SQL call. lems. Another major cause of contention is and get the details of the session. (If the Finally, session 2832 is also waiting; in this disk I/O. When a session retrieves data from session holding the lock is an orphan case, it is waiting with a “SQL*Net message the database data files on disk to the buffer session, you may want to kill it to release from client” event, which means it is idle, cache, it has to wait until the disk sends the the lock.) waiting to be given some work. The session data. This wait shows up for that session as 4. Find the SQL statement the session is issued its last SQL statement 152 seconds ago “db file sequential read” (for index scans) or executing. and has been idle for 151 seconds. “db file scattered read” (for full-table scans) 5. If the session is waiting for I/O, find out Armed with this information, you can in the EVENT column, as shown below: which segment (table, materialized view, diagnose performance issues very accurately. index, and so on) the I/O is waiting for. You can tell the complaining user that of the select event The techniques presented in this article three sessions connected from the appsvr1 from v$session will help you resolve about 20 percent of the application server, one session is idle, one where sid = 3011; performance issues you encounter as a DBA. is working, and one is waiting for a lock. The Oracle Database is instrumented to provide user is probably referring to the slowness of EVENT information on its inner workings so that you this last session. Now you know the reason ——————————————————————————————— can zero in on the exact cause of an issue— and how you can rectify it. db file sequential read all you have to do is listen. I sincerely hope that this article has Getting the SQL When you see this event, you know that helped you realize how simple it is to diag- Another key piece of performance tuning the session is waiting for I/O from the disk to nose some common but seemingly thorny information is the SQL statement a session is complete. To make the session go faster, you performance issues in Oracle Database by executing, which will provide more insights have to reduce that waiting period. There are identifying the right information sources. into the workings of the session. The same several ways to reduce the wait: Happy tuning!  V$SESSION view also shows the SQL state- 1. Reduce the number of blocks retrieved ment information. The SQL_ID column in by the SQL statement. Examine the SQL the V$SESSION view shows the ID of the statement to see if it is doing a full-table Arup Nanda (arup@ last SQL statement executed. You can get scan when it should be using an index, proligence.com) has been the text of that SQL statement from the if it is using a wrong index, or if it can be an Oracle DBA for more V$SQL view, using the SQL_ID value. Here rewritten to reduce the amount of data than 16 years, handling is an example of how I have identified the it retrieves. all aspects of database SQL statement executed by the session that 2. Place the tables used in the SQL state- administration, from appears slow to the user. ment on a faster part of the disk. performance tuning to security and disaster 3. Consider increasing the buffer cache recovery. He was Oracle Magazine’s DBA of the select sql_id to see if the expanded size will accom- Year in 2003. from v$session modate the additional blocks, therefore where sid = 3089; reducing the I/O and the wait. Next Steps 4. Tune the I/O subsystem to return data SQL_ID faster. READ online-only article content ————————————————— The online article at bit.ly/IvwqLE includes bit.ly/IvwqLE g0uubmuvk4uax additional information on how to address Read more about performance tuning Oracle Database 2 Day + Performance Tuning performance issues related to disk I/O. Guide 11g Release 2 (11.2) set long 99999 bit.ly/IlXslg select sql_fulltext Conclusion Oracle Database Performance Tuning Guide 11g from v$sql In summary, this article presented the fol- Release 2 (11.2) bit.ly/IBPsBW where sql_id = 'g0uubmuvk4uax'; lowing steps for starting a successful perfor-

oracle magazine July/august 2012

JA12_TUNING.indd 55 5/21/12 3:20 PM SEPT 30 – OCT 4, 2012 SAN FRANCISCO Register Now SAVE $400 If You Register by July 13th

oracle.com/javaone

Bronze Sponsors

The Java™ PaaS Company

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

omg0712p056.indd 1 5/30/12 2:21 PM

PUB NOTE: Please use center marks to align page. Master Ad Size Job No.: 412M_CRP_JavaOne_Omag PRODUCTION NOTES READER LASER% RELEASED Headline: Register Now - Save $400 Date: 05/22/2012 Project: Global Fulfillment 5/22 7.875” x 10.5” Type: Magazine 01 2012 Live: 7.125” x 9.75” Trim: 7.875”x 10.5” Please examine these publication materials carefully. Oracle Magazine Bleed: 8.625”x 11.25” Any questions regarding the materials,

(Full Page Ad) Fonts: Univers LT Std. 75 Black, 65 Bold, 55 Roman, 45 Light, please contact Darci Terlizzi (650) 506-9775 67 Bold Condensed, 57 Condensed Database Application Developer and DBA SQL 101 BY MELANIE CAFFREY 57

ORACLE DATABASE A Function of Character Part 6 in a series on the basics of the relational database and SQL

art 5 in this series, “An Order of Sorts” PRETTY PRINTING simple query in Listing 1 obtains all unique P(Oracle Magazine, May/June 2012), The most-basic character functions enable last name values from the EMPLOYEE table introduced the ORDER BY clause of a SQL you to change the way alphanumeric data is and displays them in all capital letters. It does SELECT statement (or query) and how it formatted in a result set. For example, the this by applying the UPPER character func- behaves in conjunction with certain options and keywords to order (or sort) the data in Code Listing 1: Query that lists every unique last name value in uppercase letters query results. Now you are ready to start

learning how to use SQL functions in your SQL> set feedback on queries to transform result set data so that SQL> select distinct UPPER(last_name) "Uppercase Employee Last Name" it displays differently from how it is stored in 2 from employee 3 order by UPPER(last_name); the database. This article focuses on the SQL character functions (also known as string Uppercase Employee Last Name functions or text functions), which enable ———————————————————————————————————————————— ECKHARDT you to manipulate how character data is dis- FRIEDLI played. Subsequent articles in this series will JAMES introduce the date and number functions. LEBLANC MICHAELS To try out the examples in this and subse- NEWTON quent articles in the series, you need access PETERSON to an Oracle Database instance. If necessary, 7 rows selected. download and install an Oracle Database edition for your operating system from bit.ly/fherki. I recommend installing Oracle Code Listing 2: Query that displays all department locations in lowercase letters Database, Express Edition. If you install the Oracle Database soft- SQL> select name, LOWER(location) "Lowercase Department Location" ware, choose the installation option that 2 from department 3 order by location; enables you to create and configure a data- base. A new database, including sample user NAME Lowercase Department Location accounts and their associated schemas, will —————————————————————————————————————— ———————————————————————————————————————————— Accounting los angeles be created for you. (Note that SQL_101 is Payroll new york the user account you’ll use for the examples in this series; it’s also the schema in which 2 rows selected. you’ll create database tables and other objects.) When the installation process Code Listing 3: Query that shows certain names converted and with the initial letter capitalized prompts you to specify schema passwords,

enter and confirm passwords for SYS and SQL> set lines 32000 SYSTEM and make a note of them. SQL> select first_name, last_name, INITCAP(first_name) "First Name", Finally—whether you installed the data- INITCAP(last_name) "Last Name" 2 from employee base software from scratch or have access 3 where employee_id in (6569, 6570); to an existing Oracle Database instance— download, unzip, and execute the SQL script FIRST_NAME LAST_NAME First Name Last Name —————————————— ————————————— —————————————— ————————————— available at bit.ly/JsDOX2 to create the tables michael peterson Michael Peterson for the SQL_101 schema that are required for mark leblanc Mark Leblanc this article’s examples. (View the script in a 2 rows selected.

I-HUA CHEN I-HUA text editor for execution instructions.)

ORACLE MAGAZINE JULY/AUGUST 2012

JA12_SQL_101.indd 57 5/24/12 4:52 PM 58 SQL 101

tion to the LAST_NAME column. Similarly, Code Listing 4: Query that demonstrates the INITCAP function the query in Listing 2 uses the LOWER

character function to display all department SQL> select INITCAP('eMPLOYEE lAST nAMES') "INITCAP Literal", location names from the DEPARTMENT INITCAP(UPPER(last_name)) "Converted Employee Last Name" 2 from employee table in lowercase letters. All functions take 3 where employee_id in (6569, 6570); some kind of input parameter(s). Character functions require input parameters that INITCAP Literal Converted Employee Last Name ———————————————————————————— —————————————————————————————————————————— are alphanumeric—either a character (or Employee Last Names Peterson string) literal or a column with a VARCHAR2, Employee Last Names Leblanc CHAR, or CLOB datatype. The data in the 2 rows selected. EMPLOYEE table’s LAST_NAME column and the DEPARTMENT table’s LOCATION column is stored with a datatype of VARCHAR2. Recall Code Listing 5: Query that applies the RPAD and the LPAD functions that a literal character value is any list of

alphanumeric characters enclosed in single SQL> select RPAD(name, 15, '.') department, LPAD(location, 15, '.') location quotation marks, such as ‘Smith’, ‘73abc’, or 2 from department; ‘15-MAR-1965’. DEPARTMENT LOCATION Listings 3 and 4 demonstrate the ————————————————————— —————————————————————— INITCAP function. The query in Listing 3 Accounting...... LOS ANGELES Payroll...... NEW YORK uses INITCAP to convert certain first and

last names from being stored in all 2 rows selected. lowercase in the EMPLOYEE table to being displayed with initial capital letters. The Code Listing 6: Query that demonstrates the CONCAT function INITCAP function capitalizes the first letter of a string and lowercases the remainder SQL> select CONCAT(first_name, last_name) employee_name of the string, as demonstrated by the 2 from employee query in Listing 4. That query also shows 3 order by employee_name; that the input parameter for an INITCAP EMPLOYEE_NAME function can consist of a character func- —————————————————————————————————————————————————————————————————————————————————— tion’s application to a string or a database BetsyJames column that stores alphanumeric data. DonaldNewton EmilyEckhardt Specifically, the query applies the UPPER FrancesNewton function to the LAST_NAME column of the MatthewMichaels EMPLOYEE table for certain employees. The RogerFriedli markleblanc UPPER function is said to be nested inside michaelpeterson the INITCAP function. The Oracle Database server applies nested functions in order, 8 rows selected. from innermost function to outermost function. In Listing 4, the UPPER function takes three input parameters: the column long, counting the space, the LPAD function converts the values peterson and leblanc to name or string literal you want to pad; the adds four filler characters to its left. PETERSON and LEBLANC. Then the INITCAP length to which the string should be padded; function converts those uppercase values to and the character, space, or symbol (the The Helpful Dual Peterson and Leblanc. filler) to pad with. For example, the query in Oracle Database provides a single-row, single- Listing 5 specifies that the department name column table called DUAL that is useful for Padding Your Results should be right-padded to a total length of many purposes, not the least of which is To pad something is to add to it. The LPAD 15 with the “.” filler character. If any depart- learning about Oracle functions. DUAL is an and RPAD functions enable you to pad your ment name is exactly 15 characters or longer, Oracle system table owned by the SYS user, character-data results by repeating a char- no filler character will be added. Because not the SQL_101 schema. Many Oracle system acter, space, or symbol to the left or right of Accounting is 10 characters long, the RPAD tables are made available to all users via any string. LPAD pads to the left of a string; function adds five filler characters to its public synonyms. Synonyms will be discussed RPAD pads to the right. right. The query also specifies that the loca- in subsequent articles in this series. Listing 5 demonstrates the power of the tion should be left-padded to a total length The DUAL table contains no data that’s RPAD and LPAD functions. Note that each of 15. Because LOS ANGELES is 11 characters useful in and of itself. (It has one row with

July/august 2012 Oracle.com/oraclemagazine

JA12_SQL_101.indd 58 5/21/12 3:34 PM SQL 101 59

one column—called the DUMMY column— Code Listing 7: Query that demonstrates the concatenation operator, || that contains the value X.) You can use DUAL

to try out functions that work on string lit- SQL> select first_name||' '||last_name employee_name erals and, as you’ll see in subsequent articles 2 from employee 3 order by employee_name; in this series, on number literals and even on

today’s date. EMPLOYEE_NAME The following demonstrates the single- —————————————————————————————————————————————————————————————————————————————— row, single-column output of a SELECT Betsy James Donald Newton statement executed against the DUAL table: Emily Eckhardt Frances Newton SQL> select * Matthew Michaels Roger Friedli 2 from dual; mark leblanc michael peterson D - 8 rows selected. X Code Listing 8: Query that demonstrates nested CONCAT calls 1 row selected.

SQL> select CONCAT(first_name, CONCAT(' ', last_name)) employee_name To display the current date, you can query 2 from employee the DUAL table as follows: 3 order by employee_name;

EMPLOYEE_NAME SQL> select sysdate —————————————————————————————————————————————————————————————————————————————— 2 from dual; Betsy James Donald Newton Emily Eckhardt SYSDATE Frances Newton —————————— Matthew Michaels 18-APR-12 Roger Friedli mark leblanc michael peterson 1 row selected. 8 rows selected. And finally, the following example shows how you can practice any function in the Code Listing 9: Query that trims extra spaces SELECT clause of a SQL statement, using the DUAL table: SQL> select '''' ||TRIM(TRAILING ' ' FROM 'Ashton ') || '''' first_name, '''' || TRIM(LEADING ' ' FROM ' Cinder ') || '''' last_name SQL> select rpad('Melanie', 10, '*') 2 from dual; Melanie, lpad('Caffrey', 10, '.') FIRST_NA LAST_NAME Caffrey ———————————— ———————————————— 2 from dual; 'Ashton' 'Cinder '

MELANIE CAFFREY 1 row selected. ——————————— ——————————— Melanie*** ...Caffrey Code Listing 10: Query that trims extra spaces, including rightmost extra spaces

1 row selected. SQL> select '''' || TRIM(TRAILING ' ' FROM 'Ashton ') || '''' first_name, '''' || TRIM(' Cinder ') || '''' last_name Note that functions work even though there 2 from dual; is no usable data in DUAL. In the preceding FIRST_NA LAST_NAM examples, the SYSDATE function displays the ———————————— ————————————— current date and time of the operating system 'Ashton' 'Cinder' hosting the database, and the RPAD and LPAD 1 row selected. functions add padding to my name.

oracle magazine July/august 2012

JA12_SQL_101.indd 59 5/21/12 3:34 PM 60 SQL 101

Stringing Strings Together Code Listing 11: Query that demonstrates the INSTR character function Sometimes it makes sense to combine

certain strings, such as the FIRST_NAME SQL> select last_name, INSTR(last_name, 'ton') ton_starting_point and LAST_NAME values from the EMPLOYEE 2 from employee 3 order by last_name; table, in the result set display. You can use

concatenation to accomplish this task—with LAST_NAME TON_STARTING_POINT either the CONCAT function, illustrated in ————————————————————————————————————————————— ——————————————————————————— Eckhardt 0 Listing 6, or the (more commonly used) Friedli 0 concatenation operator || (two pipe charac- James 0 ters), illustrated in Listing 7. Michaels 0 Newton 4 The CONCAT function takes two param- Newton 4 eters and concatenates them. You can also leblanc 0 nest multiple CONCAT function calls, as peterson 0 shown in Listing 8. The queries in Listings 7 8 rows selected. and 8 concatenate literal strings with column data values. (I prefer the concatenation Code Listing 12: Query that demonstrates the SUBSTR character function operator, because it has unlimited input parameters and makes the concatenated output more readable.) SQL> select last_name, SUBSTR(last_name, 1, 3) 2 from employee 3 order by last_name; Giving Your Data a Trim Sometimes you want to remove unwanted LAST_NAME SUB ———————————————————————————————————————————— ———— spaces or characters from data when you Eckhardt Eck display it. For example, data inserted into a Friedli Fri table column via a form application might James Jam Michaels Mic include extraneous characters or spaces— Newton New preceding and/or following the actual data Newton New value—that the form input field doesn’t trim. leblanc leb peterson pet Listing 9 shows a query that trims extra spaces from string values. The TRIM func- 8 rows selected. tion in Listing 9 takes two parameters. The first parameter is the character, symbol, Code Listing 13: Query that demonstrates the INSTR and SUBSTR character functions or space (delimited by single quotes) to be removed. The second parameter speci- SQL> select last_name, INSTR(last_name, 'ton') ton_position, SUBSTR(last_name, fies the string literal or column value to be INSTR(last_name, 'ton')) substring_ton trimmed. The TRIM function supports three 2 from employee keywords: LEADING, TRAILING, and BOTH. 3 order by last_name;

The example in Listing 9 uses the TRAILING LAST_NAME TON_POSITION SUBSTRING_TON keyword to right-trim the FIRST_NAME ———————————————————————————————————————————— ————————————————— —————————————————————————————— value. The TRIM function applied to the Eckhardt 0 Eckhardt Friedli 0 Friedli LAST_NAME value specifies the LEADING James 0 James keyword to left-trim the spaces from that Michaels 0 Michaels value. And, as you can see, the spaces to the Newton 4 ton Newton 4 ton right of the LAST_NAME value remain and leblanc 0 leblanc are included in the output. peterson 0 peterson Compare the output in Listing 9 with 8 rows selected. that in Listing 10, which trims the rightmost extra spaces from the LAST_NAME value. When no keyword is specified, the default Searching for Strings Within Strings position of a substring within a string value. behavior for the TRIM function is to trim When you need to search column values for Listing 11 demonstrates the INSTR function leading as well as trailing characters. The similar string pattern values, you can do so applied to the LAST_NAME column of the older RTRIM and LTRIM functions are avail- with the INSTR character function. INSTR— EMPLOYEE table to locate all occurrences of able for backward compatibility. which stands for in string—returns the the “ton” substring. As you can see, the INSTR

July/august 2012 Oracle.com/oraclemagazine

JA12_SQL_101.indd 60 5/21/12 3:34 PM SQL 101 61

Code Listing 14: Query that demonstrates the LENGTH function a query that uses the LENGTH function to display the length of all FIRST_NAME values

SQL> select first_name, LENGTH(first_name) length from the EMPLOYEE table. 2 from employee The online version of this article at bit.ly/ 3 order by length desc, first_name; JAQPk3 includes examples of LENGTH and

FIRST_NAME LENGTH other character functions in WHERE and ————————————————————————————————————————————— —————————————— ORDER BY clauses. Frances 7 Matthew 7 michael 7 Conclusion Donald 6 This article has shown you how character Betsy 5 functions can be used in SELECT statements Emily 5 Roger 5 to manipulate the ways data is displayed. mark 4 You’ve seen how to convert data values to uppercase, lowercase, and mixed cases and 8 rows selected. how to search for strings within strings. You’ve also seen how to pad and trim data function takes as input the literal or column you with this task. Listing 12 shows a query and how to specify a string’s total length. value you want to search, followed by the that uses the SUBSTR function to extract the By no means does this article provide an substring pattern to search for. In Listing 11, first three characters of every LAST_NAME exhaustive list of the Oracle character func- the INSTR function finds the “ton” pattern in value from the EMPLOYEE table. The SUBSTR tions. Review the documentation for more only two column data values—both of them function takes two required parameters details: bit.ly/HZUBC5. Newton—and returns 4 as their position. and one optional input parameter. The first The next installment of SQL 101 will Because it did not find the search string in any parameter is the literal or column value on discuss number functions and other miscel- other values, the output for those values is 0. which you want the SUBSTR function to laneous functions.  Two additional parameters—starting operate. The second parameter is the posi- position and occurrence—are optional. The tion of the starting character for the sub- Melanie Caffrey is starting position specifies the character in string, and the optional third parameter is a senior development the string from which to begin your search. the number of characters to be included in manager at Oracle. She The default behavior is for the search to the substring. If the third parameter is not is a coauthor of Expert begin at the first character—otherwise specified, the SUBSTR function will return PL/SQL Practices known as character position 1. The occur- the remainder of the string. for Oracle Developers rence parameter lets you specify which Listing 13 demonstrates the SUBSTR and and DBAs (Apress, 2011) and Expert Oracle occurrence of the substring you’d like to find. INSTR functions working together to display Practices: Oracle Database Administration from For example, the word Mississippi includes the portion of every LAST_NAME value from the Oak Table (Apress, 2010). two occurrences of the “issi” substring. To the EMPLOYEE table that contains the “ton” search for the starting-position location of substring. In this example, the output from Next Steps the second occurrence of this pattern, you the INSTR function provides the value for the must provide the INSTR function with an input parameter that specifies the position READ occurrence parameter of 2: for the SUBSTR function’s starting character. online-only article content In the LAST_NAME values in which the sub- bit.ly/JAQPk3 SQL> select INSTR('Mississippi', 'issi', string “ton” is not found, the entire LAST_ SQL 101, Parts 1–5 bit.ly/JKZzDt 1, 2) NAME value is returned, for two reasons: READ more about relational database 2 from dual; SUBSTR treats a starting position of 0 the design and concepts same as a starting position of 1 (that is, as the Oracle Database Concepts 11g INSTR('MISSISSIPPI','ISSI',1,2) first position in the string), and because the Release 2 (11.2) bit.ly/aonqPP —————————————————————————————————— query omits the optional length parameter, Oracle Database SQL Language Reference 11g 5 the full remainder of the string is returned. Release 2 (11.2) 1 row selected. bit.ly/yWtbz1 When Size Matters Oracle SQL Developer User’s Guide Release 3.1 Extracting Strings from Strings Occasionally you need to determine a bit.ly/I9w52z Sometimes you need to extract a portion of string’s length—for example, to determine DOWNLOAD the sample script for a string for your desired output. The SUBSTR the maximum number of characters a form this article bit.ly/JsDOX2 (for substring) character function can assist entry field should permit. Listing 14 shows

oracle magazine July/august 2012

JA12_SQL_101.indd 61 5/21/12 3:35 PM 62 Database Application Developer and DBA

Oracle Database On Characters, Pivots, and Endings Our technologist substitutes characters, looks at fishy results, and avoids redo.

want to insert a value into a table as 1 row created. Although that approach works, I’m not I follows: a fan of it, because you have to change your SQL> select * from test; SQL statement. create table test (name varchar2(35)); Yet another approach is to use a zero- insert into test values ('&Vivek'); NAME length substitution variable name, which ————————————————————————————————————————— will make SQL*Plus just leave that & char- But the system asks for a value for the Hello World acter alone: substitution variable. How can I insert an &Vivek ampersand (&)? SQL> insert into test This is probably one of the most fre- That prevents SQL*Plus from scanning values ('&'||'Vivek yyy'); quently asked questions out there, not only the input to try to find the substitution char- on AskTom (asktom.oracle.com) but on any acter. Another approach is to use a different 1 row created. Oracle Database forum. substitution character: Before I give the answers, I’ll explain the SQL> select * from test problem fully. By default, SQL*Plus will scan SQL> set define @ where name like '% yyy'; each line of input and look for an & char- acter. Upon finding it, SQL*Plus will scan SQL> insert into test (name) NAME the characters after the ampersand and use values ( '&Vivek @X' ); ————————————————————————————————————————— those as a variable name (the variable name Enter value for x: this was x &Vivek yyy in the above example is Vivek). SQL*Plus old 1: insert into test (name) will then prompt the user for a value for values ( '&Vivek @X' ) This is perhaps better than using chr(38) Vivek—like this: new 1: insert into test (name) to avoid the & character in your SQL, but it values ( '&Vivek this was x' ) still is not something I recommend. By the SQL> insert into test (name) way, even though I’ve been using SQL*Plus values ('&Vivek'); 1 row created. for almost 25 years, I had no idea that the Enter value for vivek: Hello World last solution—with ‘&’ ||’Vivek’—would work old 1: insert into test (name) In this case, the @ character is doing what that way. That was something new I learned values ('&Vivek') the & used to do. from a reader of AskTom! new 1: insert into test (name) There are other approaches, such as values ('Hello World') avoiding the & character in your SQL: Dynamic Pivot I have a table like this: 1 row created. SQL> insert into test values (chr(38)||'Vivek xxx'); create table fish ( Here you can see how SQL*Plus turned fish_id number, &Vivek into Hello World. Now the question 1 row created. fish_type varchar2(3), is how to stop it from doing that. The easiest fish_weight number); method is simply to issue the SQL*Plus set SQL> select * from test define off command: where name like '% xxx'; insert into fish values (1,'COD',20); insert into fish values(1,'HAD',30); SQL> set define off NAME insert into fish values(2,'COD',45); SQL> insert into test (name) ————————————————————————————————————————— insert into fish values(2,'HKE',10); values ('&Vivek'); &Vivek xxx insert into fish values(2,'LIN',55);

July/august 2012 Oracle.com/oraclemagazine

JA12_ASKTOM.indd 62 5/21/12 3:47 PM Database Application Developer and DBA Ask Tom by Tom Kyte 63

insert into fish values(3,'CTY',90); Code Listing 1: Static SQL for existing data insert into fish values (3,'HAD',60);

insert into fish values (3,'COD',52); SQL> select fish_id, 2 sum(decode(fish_type,'COD',fish_weight)) cod, 3 sum(decode(fish_type,'HAD',fish_weight)) had, I would like it to be displayed as 4 sum(decode(fish_type,'HKE',fish_weight)) hke, 5 sum(decode(fish_type,'LIN',fish_weight)) lin, COD HAD HKE LIN CTY ...... 6 sum(decode(fish_type,'CTY',fish_weight)) cty 7 from fish 1 20 30 X X 8 group by fish_id 2 45 X 10 55 9 order by fish_id 3 52 60 X X 10 / .... FISH_ID COD HAD HKE LIN CTY —————————————— —————————————— —————————————— —————————————— —————————————— —————————————— The columns aren’t fixed in number or 1 20 30 2 45 10 55 name, because there can be multiple species. 3 52 60 90 How can I create this display? In SQL you need to know the number, name, and datatype of every single column Code Listing 2: Stored procedure that determines column names at parse time, so you’ll have to use a bit of dynamic SQL. Before I show the dynamic SQL> create or replace procedure go_fishing( p_cursor in out sys_refcursor ) SQL, I will first develop a static SQL state- 2 as 3 l_query long := 'select fish_id'; ment that works against the existing data. 4 begin Listing 1 contains a query that works in all 5 for x in (select distinct fish_type from fish order by 1 ) releases of Oracle Database. (Note that in 6 loop 7 l_query := l_query || Oracle Database 11g and later releases, I 8 replace( q'|, sum(decode(fish_type,'$X$',fish_weight)) $X$|', could have used the built-in PIVOT syntax, 9 '$X$', but it too requires dynamic SQL.) 10 dbms_assert.simple_sql_name(x.fish_type) ); 11 end loop; Now, to make the SQL in Listing 1 12 dynamic, I will create a stored procedure 13 l_query := l_query || ' from fish group by fish_id order by fish_id'; that executes a query to determine what the 14 15 open p_cursor for l_query; column names are and use that information 16 end; to dynamically construct the pivot query, as 17 / shown in Listing 2. Procedure created. Note: In Listing 2, the fish_type column is obviously a foreign key to another table in which fish_type is the primary key. The table Code Listing 3: Ref cursor, cursor, and fetch in which fish_type is the primary key is the lookup table for valid fish types. Replace my SQL> variable x refcursor SELECT DISTINCT... with a simple SELECT SQL> exec go_fishing( :x )

against that table. PL/SQL procedure successfully completed. What I did in the stored procedure in Listing 2 was to generate a list of distinct fish SQL> print x

types and add a column to the query for each FISH_ID COD CTY HAD HKE LIN one. I used the string —————————————— —————————————— —————————————— —————————————— —————————————— —————————————— 1 20 30 2 45 10 55 q'|, sum(decode(fish_type,'$X$', 3 52 90 60 fish_weight)) $X$|'

as a template for the original static SQL: plate was replace $X$ (a string I chose at concatenating into the SQL statement was random to represent COD, HAD, and so on) “safe”—that it was a simple SQL name sum(decode(fish_type,'COD', with the value x.fish_type. Note that I did and not some SQL that would change the fish_weight)) cod, not just replace $X$ with the value x.fish_ meaning of my SQL statement. In short, type blindly. I used the DBMS_ASSERT that DBMS_ASSERT call is protecting The only thing I had to do with the tem- package to validate that the data I was against SQL injection. If SQL injection is a

oracle magazine July/august 2012

JA12_ASKTOM.indd 63 5/21/12 3:47 PM 64 Ask Tom

topic you are not up to speed on, or if you table; if they did, tables would only grow. Redo and Global Temporary Tables just want to see some really interesting SQL We would never be able to reuse space left Do temporary tables generate redo for injection techniques, I encourage you to behind after a delete. standard data manipulation language] check out bit.ly/IgU3YQ and bit.ly/K7aAKW. If you need to find the “newest rows” in a operations? After I build the query in a string, I use a table, you’ll have to have some bit of data—a I think that because every DML operation ref cursor to open a cursor that can be sent time stamp, for example—associated with generates undo, every DML operation on back to a client application, as shown in each row that would enable you to identify global temporary tables will generate redo. Listing 3. a new row. Some people might mention In short, there is no redo generated on ORA_ROWSCN as a solution, but the over- temporary table blocks. However, any undo Finding the Last Row head of using it to find “new rows” would be generated for those blocks will have redo I have created a view based on multiple tables overwhelmingly huge—you’d have to inspect generated. Thus, many operations against in Oracle Database, and I am able to fetch the every single row every single time. global temporary tables will generate redo as records within a view via SELECT. My question is: If there are newly added records and I want Code Listing 4: Creating table for “last row” test to fetch only the newly added records inside the view, what is the SQL query for fetching SQL> create table t ( x int, y varchar2(4000), z varchar2(4000) ); those? I tried using the rowid, but it didn’t Table created. return the results as expected. You would have to tell me how you SQL> insert into t values ( 1, rpad('*',1,'*'), rpad('*',1,'*') ); 1 row created. could identify “new rows” if you printed them out on a piece of paper. If you cannot SQL> connect / tell which rows are “new” or what the “last Connected.

row” was, neither can I. Rowids are an SQL> insert into t values ( 2, rpad('*',3000,'*'), rpad('*',3000,'*') ); address of a row on a block in a file—they 1 row created. are not monotonically increasing values. SQL> connect / Even if you only insert into a table, you will Connected. find that the rows might not be in “insert order”—sometimes they might be, but other SQL> insert into t values ( 3, rpad('*',3000,'*'), rpad('*',3000,'*') ); 1 row created. times they won’t. In short, you can never count on their being in any sort of order. SQL> connect / For example, I used an automatic segment Connected.

space managed (ASSM) tablespace with an SQL> insert into t values ( 4, rpad('*',1,'*'), rpad('*',1,'*') ); 8 K block size and inserted some data, as 1 row created. shown in Listing 4. Now, arguably row “4” is the “last” and Code Listing 5: Query to see order of rowids newest row in the T table, but if I start looking at the rows—and what database SQL> connect / blocks they are on—I’ll see a different story, Connected. as shown in Listing 5. If I were to try to use ROWID to find the SQL> select dbms_rowid.rowid_block_number(rowid), x from t; “last” row or the newest row, I’d be very DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) X much let down at this point. What I did was ————————————————————————————————————————————————————— —————————————— put a small row 1 on the first block and place 18948 1 a larger row 2 on the same first block, but 18948 2 then when I tried to insert row 3, it was too 18948 4 18949 3 big to fit on the first block with those rows, so it went to the second block in the table. SQL> select rowid, x from t order by rowid desc; However, when row 4 came along—it was ROWID X small again—there was room for it on the —————————————————————————— ————————————— first block. AAAaxGAAEAAAEoFAAA 3 Rows go on a block that has free space on AAAaxGAAEAAAEoEAAC 4 it—enough free space to hold those rows. AAAaxGAAEAAAEoEAAB 2 AAAaxGAAEAAAEoEAAA 1 They do not go to the “last block” in the

July/august 2012 Oracle.com/oraclemagazine

JA12_ASKTOM.indd 64 5/21/12 3:48 PM Ask Tom 65

a side effect of generating undo. 3 t_resource_type number(8) Table created. The example in Listing 6 demonstrates 4 ,t_resource_address1 varchar2(50) operations that generate and do not gen- 5 ,t_resource_hst_id number(11) And then I’ll add a unique index—more erate redo. 6 ); specifically, a unique function-based index: In Listing 6 there was 0 redo size with a direct path INSERT (but you have to Code Listing 6: No redo created in direct path insert commit the INSERT before you can read it) because the direct path INSERT bypassed SQL> create global temporary table gtt undo generation. The conventional path 2 on commit preserve rows load generated 412,112 bytes of redo, but 3 as that was to protect the UNDO information 4 select * from all_objects where 1=0; Table created. only—not the data loaded. That is apparent if you use a conventional path INSERT into SQL> set autotrace on statistics a “normal” table: SQL> insert into gtt select * from all_objects; 72259 rows created.

SQL> create table t Statistics —————————————————————————————————————————————————————————————————————————————————————————— 2 as … 3 select * from all_objects where 1=0; 412112 redo size Table created. … 72259 rows processed

SQL> set autotrace traceonly statistics; SQL> insert /*+ append */ into gtt select * from all_objects; SQL> insert into t select * from 72259 rows created.

all_objects; Statistics —————————————————————————————————————————————————————————————————————————————————————————— 72862 rows created. … 0 redo size … Statistics 72259 rows processed ————————————————————————————————————————— SQL> set autotrace off … 8546004 redo size … Code Listing 7: A real constraint with virtual columns 72259 rows processed SQL> alter table test_data A global temporary table typically signifi- 2 add ( 3 t_resource_address1_unq varchar2(50) cantly reduces the amount of redo gener- 4 generated always as ated, but it will not typically eliminate it. 5 (case when t_resource_type in (100000, 1000001, 1000002) then t_resource_address1 end) 6 ) Tricky Unique Constraint 7 / I have a data rule for a table that says a certain pair of columns must be unique Table altered.

if some other field is a certain value. SQL> alter table test_data Specifically, if a column t_resource_type value 2 add ( is in the set of values 100000, 1000001, 3 t_resource_hst_id_unq number(11) 4 generated always as and 1000002, the t_resource_address1 and 5 (case when t_resource_type in (100000, 1000001, 1000002) then the t_resource_hst_id values must be unique. t_resource_hst_id end) How can I construct this? 6 ) 7 / This is easy to accomplish via a function- based index or virtual columns (in Oracle Table altered. Database 11g and later only). I’ll demonstrate SQL> alter table test_data both. First, I’ll create your table: 2 add constraint address_hst_id_unique 3 unique (t_resource_address1_unq,t_resource_hst_id_unq); SQL> create table test_data Table altered. 2 (

oracle magazine July/august 2012

JA12_ASKTOM.indd 65 5/21/12 3:48 PM 66 ASK TOM

SQL> create unique index t_idx Because the null, null values are always Tom Kyte is a database on test_data ( considered unique, they will not appear in evangelist in Oracle’s 2 case when t_resource_type in the index—the index will index rows in the Server Technologies (100000, 1000001, 1000002) table only such that the resource type is division and has worked then t_resource_address1 in the specified set of values. You’ll have a for Oracle since 1993. He end, unique index on only some of the rows in is the author of Expert 3 case when t_resource_type in the table. Oracle Database Architecture (Apress, 2005, (100000, 1000001, 1000002) then With Oracle Database 11g and later, I 2010) and Effective Oracle by Design (Oracle t_resource_hst_id can use a real constraint by using virtual Press, 2003), among other books. end columns, as shown in Listing 7. 4 ); This approach adds two columns to the NEXT STEPS table, and these columns appear to have Index created. values only when the resource type is in the ASK Tom specified set of values—otherwise they are Tom Kyte answers your most difficult technology The two case statements will return either null. Because they are “real” columns in the questions. Highlights from that forum appear in this column. Null, Null – when the t_resource_type table, you can apply a traditional constraint asktom.oracle.com column value is not in the set of values to them. They consume no storage, because DOWNLOAD Oracle Database 11g 100000, 1000001, and 1000002 they are virtual columns, but you can do Release 2 or pretty much anything to them that you can bit.ly/epBiUG t_resource_address1, t_resource_hst_id – do to a “regular” column. In the end, the two LEARN more about SQL injection when the t_resource_type column is in that approaches are nearly equivalent, in that bit.ly/IgU3YQ bit.ly/K7aAKW set of values. they both create a function-based index. t

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 2012 ORACLE.COM/ORACLEMAGAZINE

JA12_ASKTOM.indd 66 5/21/12 3:49 PM in the field By mark C. clark 67

Testing Makes Perfect Successful application upgrade testing combines leadership, preparation, and the best people.

eople say “practice makes perfect,” but Some people best people are involved in the hands-on Pin the enterprise application and enter- testing process. Some people naturally make prise resource planning (ERP) world, a more naturally make better testers than others. These are the appropriate statement might be “testing people who can anticipate how the system makes perfect.” better testers may break or how someone may try to use it, A recent OAUG ResearchLine report1 than others. and they have an innate sense of the overall about enterprise application/ERP suite processes and functions of the software. upgrade strategies indicates that proper In addition to using correct testing pro- These team members will understand if testing is of great importance. The report, cesses, users should be educated and pre- a system as built or configured is actually based on the results of a research study pared to do negative testing. Negative testing meeting business requirements. Sometimes conducted with members of the Oracle helps to ensure that the system prevents or these people may be wearing multiple hats Applications Users Group (OAUG), mea- traps errors or properly unwinds transactions within the organization, or they may have sured how respondents perceive the that are being reversed or canceled. gained their special insight from working business opportunity and the process for With their big-picture vantage point, in a wide variety of roles within a business. moving to the latest release of an enterprise project leaders are in the best position to People with an audit background frequently application suite. The testing process was engage users, establish expectations and make great additions to a testing team. identified by a majority of respondents (63 objectives, and direct testing efforts. Unfortunately, due to their critical roles percent) as a key risk area, leading the list in in an organization, the best testers do not terms of ERP upgrade challenges. Be Prepared always have the time to dedicate to the While there are a number of diverse soft- In addition to leadership, preparation is key testing effort. In this case, they should be ware development methodologies, testing to a successful testing experience. Proper tapped to help design test cases and test is one of the most critical. Here are three key preparation includes training and educating scripts that capture their expertise so that ways to make your organization’s application the users on the appropriate way to go about others may apply this knowledge. upgrade testing experience as smooth and testing and how to log, report, and track More organizations should view testing as as “perfect” as possible. errors. Users should be instructed on how to an opportunity for feedback and refinement communicate perceived issues by including as well as user education. Too many teams Leadership Must Educate screen shots or other documentation with view testing as a necessary evil or something The first strategy for ensuring a smooth-to- the issue being logged. Those tasked with that must be overcome prior to go-live, and perfect testing experience starts with leader- issue resolution must understand why the they miss out on the benefits that a proper ship. The leadership team should educate test case failed so they can work on a proper testing effort can provide.  users on the overall testing process, the fix. The testing team should understand various types of testing, when each type who is responsible for tracking the issue and occurs, and how users are involved. Users are ensuring that the issue is fixed. Mark C. Clark is president of OAUG and has in the best position to determine if a system Additionally, testing teams should be pro- been an active member since 1992. As a senior is going to meet their requirements when it vided with proper test cases, test scripts, and partner at O2Works, Clark is currently engaged is turned over to them, and it is the leader- test data. A systematic effort that includes a with customers worldwide in their Oracle ship team’s responsibility to make sure users repeatable approach allows testing teams to E-Business Suite Release 12 and 12.1 efforts. know what is expected of them during the approach the job in the same way each time testing process. patching and upgrades occur. Next Steps For example, users involved in testing should not just run a process or report to Getting the Best Explore the survey see that it has been executed; they should After focused leadership is in place and nec- bit.ly/IBZr3o instead review the results and make sure the essary preparation is done, a third strategy JOIN OAUG oaug.org results are exactly what was expected. for successful testing is to make sure the

1 “ERP Upgrades: What’s Your Philosophy? 2012 OAUG Survey on Enterprise Application/ERP Suite Upgrade Strategies,” Unisphere Research, February 2012

oracle magazine July/august 2012

JA12_FIELD_CLARK.indd 67 5/21/12 4:03 PM 68 Analyst’s Corner by DAVID BAUM

The Best Defense Today’s database security tools protect your data at multiple levels.

racle Magazine spoke with Martin A layered security encrypt sensitive data so that they can work OKuppinger, founder and principal on the database without seeing things that analyst at KuppingerCole, about database approach protects they don’t need to see. security as the cornerstone of an end-to-end Oracle Magazine: How does a database fire- security architecture. each part of your wall differ from a network firewall? Oracle Magazine: Why is a multilevel technology stack. Kuppinger: Both of them are called firewalls, approach to security important? but they do different things. A network fire- Kuppinger: When you look at the well- wall guards the perimeter of the network, publicized breaches of IT security, in many notification penalties and you might end up while a database firewall works from within cases the attacker is an internal person making the headlines the next day. Three or to detect SQL injections and rogue transac- who had access to a database. A layered four years ago, you could lose a lot of data tions that shouldn’t be allowed. Place a security approach protects each part of your and it would be noted in some computer database firewall in front of the database technology stack, from the network to the magazines. Now you might find yourself on within your data center to analyze the SQL application, including the database. While the front page of the business news, which statements and prevent the execution of identity management technology authenti- can have huge ramifications on the enter- malicious programs or loss of data. cates people at the application level, if the prise, on shareholder value, and on your Oracle Magazine: What are the pros and data is still readable and in plain text, then reputation with customers. cons of database-level encryption—such as there are plenty of ways that a malicious Oracle Magazine: How do database security transparent data encryption—and full- intruder can access it. technologies help enterprises mitigate disk encryption? Oracle Magazine: What’s the difference these risks? Kuppinger: Important data should be between securing data in the cloud and Kuppinger: You need a multifaceted data- encrypted, partly to protect it from privileged securing data on premises? base security portfolio to fulfill regulatory users who have broad access to information. Kuppinger: Your security approach should compliance criteria. Auditability and trace- Transparent data encryption is applied to the differ depending on the type of clouds you’re ability are very important, as are labeling specific needs of a database environment, using. Running a private cloud in a well- data and segmenting it into different whereas full-disk encryption protects data defined data center at a specific location is dif- domains. Encryption and strong authentica- at rest on the disk but in no other situation. ferent from simply renting a virtual machine tion are also essential. Of course, even transparent data encryption in a public cloud. One of the issues is that you Organizations must look at the require- doesn’t protect data while somebody is using often don’t know where your data resides. You ments for their industry, region, and country. it. But it does protect some part of the com- rely on service-level agreements for security, They must identify risks and select a variety munication when the data is in motion.  which comes down to trusting the vendor. In of technologies to make sure that they have those instances, it’s important to protect your covered everything that pertains to them. David Baum ([email protected]) is data—generally using encryption. Oracle Magazine: DBAs, system administra- a freelance business writer based in Santa Oracle Magazine: What responsibilities do tors, and other technical personnel need Barbara, California. enterprises have to secure personally iden- access to database resources. How do orga- tifiable information [PII], and what are the nizations secure database information from Founded in 2004, KuppingerCole primary risks that they must address? their own administrators? (kuppingercole.com) is a leading analyst Kuppinger: There are two types of risk here: Kuppinger: Limit the actions of privileged company for identity-focused information monetary penalties and breach notifica- users. For starters, you can segment data security, in classical and cloud environments. tion. PII regulations differ from country to into domains and limit administrative access country. International organizations must to financial data and PII. HR data is often Next Steps meet the highest levels of security to ensure confidential as well. Privileged users are that they are fully compliant. As to the important, but they are also a big risk. Don’t READ about Oracle Database security oracle.com/us/products/database/security risks, if you lose data then you face breach give them access that they don’t need, and

July/August 2012 Oracle.com/oraclemagazine

JA12_AnalystCorner.indd 68 5/21/12 4:10 PM Unbeatable power protection now beats energy costs, too.

Only APC Smart-UPS delivers unsurpassed power protection and real energy savings. Today’s more sophisticated server and networking technologies require higher availability. That means you need more sophisticated power protection to keep your business up and running at all times. But that’s not all. In today’s Why Smart-UPS is a economy, your UPS must safeguard both your uptime and your bottom line. smarter solution Only APCTM by Schneider ElectricTM helps you meet both of these pressing needs. Specifically, the APC Smart-UPSTM family now boasts models with advanced management capabilities, including the ability to manage your Intuitive alphanumeric display energy in server rooms, retail stores, branch offices, network closets, and Get detailed UPS and power quality information at a glance – including other distributed environments. status, about, and diagnostic log menus in up to five languages. Intelligent UPS management software. PowerChuteTM Business Edition, which comes standard with Smart-UPS 5 kVA and below, enables energy usage and energy cost reporting so you can Configurable interface save energy and money by tracking energy usage and costs over time; CO2 Set up and control key UPS emissions monitoring to reduce environmental impact through increased parameters and functions using understanding; and risk assessment reporting so you can identify and the intuitive navigation keys. proactively manage threats to availability (e.g., aging batteries). On rack/tower convertible models, the display rotates 90 degrees Best-in-class UPS. for easy viewing. Our intelligent, interactive, energy-saving APC Smart-UPS represents the combination of more than 25 years of Legendary ReliabilityTM with the latest in UPS technology including an easy-to-read, interactive, alphanumeric Energy savings LCD display to keep you informed of important status, configuration, and A patent-pending “green” mode diagnostic information, a unique battery life expectancy predictor, and energy- achieves online efficiencies greater than 97 percent, reducing heat loss saving design features, like a patent-pending “green” mode. and utility costs. Now, more than ever, every cost matters and performance is critical. That’s why you should insist on the more intelligent, more intuitive APC Smart-UPS.

Download our FREE Server Room Efficiency Kit and enter to win one of five Smart-UPS units (SMX1000)! Visit www.apc.com/promo Key Code p675v Call 888-289-APCC x6410

©2012 Schneider Electric. All Rights Reserved. All trademarks are owned by Schneider Electric Industries SAS or its affiliated companies. email: [email protected] 132 Fairgrounds Road, West Kingston, RI 02892 USA • 998-8874_GMA-US

Oracle_0701_p675v_US.indd 1 05/17/2012 2:10:49 PM