Analyze, Illustrate, Fix and Run It Troubleshoot and Manage Your PL/SQL

Maintaining legacy applications, documenting old and unfamiliar code or digging into someone else‘s code? A difficult and time-consuming task. Is there a solution?

Yes! Conquest‘s ClearSQL for Oracle is the solution.

A very powerful and advanced PL/SQL analyzer. The perfect enterprise code review and quality control tool.

WORLD CLASS TOOLS FOR EVERYBODY’S BUDGET

Don't miss ... NEW ClearSQL 6.5 Buy One, Get One Analyzes 1000s of PL/SQL scripts with a single click. Oct. 1 - Dec. 31, 2012 Creates Flowcharts, Call Tree diagrams, CRUD matrices from PL/SQL to allow you to instantly understand code.

• quickly detects code errors, code review rule violations and other PL/SQL code anomalies • creates detailed Code Metrics reports from PL/SQL (McCab, Halstead, Maintainability Index, and more..) • documents PL/SQL creating clickable reports (HTML) • summarizes PL/SQL on a single page (status overview) • offers Command Line feature for batch analysis

ClearSQL • creates PSEUDOCODE from existing PL/SQL ClearDB Documenter • monitors code complexity trends during development SQLDetective cycles to ensure maintainability • imports Oracle forms and PL/SQL libraries v. 6 – 10 • ideal when implementing enterprise coding standards (e.g. code formatting, DB objects naming rules,...)

www.conquest-us.com

Untitled-4 1 10/25/12 1:22 AM NOVEMBER/DECEMBER 2012

Optimized Application Performance Oracle’s Exalogic Elastic Cloud Software enables a true IaaS environment / 23 Architects Matter Making sense of people who make sense of enterprise IT / 29 A Path to Leadership New ODTUG program grooms leaders for user group success / 30 Diagnose the Past Take the next step in diagnosing Oracle Database performance issues / 51 On External Table Queries, Data Consistency, and Nothing Our technologist queries the operating system, locks manually, and uses the right NULL / 63

Engineered to Educate, Explore, Engage 2012’s Oracle OpenWorld and JavaOne conferences brought APPS technologists to for a week of learning, networking, ON and looking forward ORACLE Built for Speed Oracle unveils new releases of Oracle Exadata Database Machine and Oracle Exalogic Elastic Cloud EXADATA CONSOLIDATE, CUT COSTS, AND SUCCEED WITH ORACLE EXADATA

ND12_Cover.indd 1 10/17/12 10:41 AM Reach new heights

SPARC64 X: Fujitsu’s latest SPARC processor carrying the inheritance from the world’s top-level supercomputer to provide unprecedented performance and scalability. Fujitsu, together with Oracle, ensures that SPARC systems interoperate well with next generations of Oracle Solaris, Oracle Database, and Oracle software products.

© Copyright 2012 Fujitsu Limited. Fujitsu, the Fujitsu logo are trademarks or registered trademarks of Fujitsu Limited in Japan and other countries. Other company, product and service names may be trademarks or registered trademarks of their respective owners. Reach new heights

SPARC64 X: Fujitsu’s latest SPARC processor carrying the inheritance from the world’s top-level supercomputer to provide unprecedented performance and scalability. Fujitsu, together with Oracle, ensures that SPARC systems interoperate well with next generations of Oracle Solaris, Oracle Database, and Oracle software products.

© Copyright 2012 Fujitsu Limited. Fujitsu, the Fujitsu logo are trademarks or registered trademarks of Fujitsu Limited in Japan and other countries. Other company, product and service names may be trademarks or registered trademarks of their respective owners. 2 FeatureD Content Volume XXVI - Issue 6 Contents

Apps on Oracle Exadata /36 When business growth means that your current business applications platform deployment can no longer support your business, consolidation is certainly worth consideration. By consolidating business applications with Oracle Exadata, organizations are simplifying their information technology; lowering costs; and improving system performance, scalability, and reliability. Find out how Praxair and Alliance Data are benefiting by running their applications on Oracle Exadata. —By David A. Kelly

Engineered to Educate, Explore, Engage /32 Built for Speed /22

Oracle OpenWorld, JavaOne, MySQL Connect, and At Oracle OpenWorld, several other events took San Francisco by storm, Oracle unveiled new September 29–October 5. This content-focused releases of Oracle week—opening with MySQL Connect on Saturday Exadata Database and closing with the final day of Oracle Customer Machine and Oracle Experience Summit @ OpenWorld the following Exalogic Elastic Cloud. Learn how these Friday—offered a wealth of learning and networking engineered systems deliver hardware and opportunities, with a little rock, blues, ska, and software engineered to work together and alt-country added in for good measure. Relive the in-memory, speed-of-thought compute conference—or see what you missed—and start power to private and public clouds. planning your trip to San Francisco next September. —By David Baum —By Karen Shamban

November/December 2012 Oracle.com/oraclemagazine

ND12_TOC.indd 2 10/17/12 10:09 AM Use your programmer's point of view...

WIN!

Win a tablet or choose a 50% discount on PL/SQL Developer! Use your logical skills to find the secret code, go to www.plsqldev.com/code and have a chance to win a new iPad or ASUS TF700! Challenge accepted? Real solutions for Oracle developers.

Closing date: January 1, 2013

13208 Adv nov/dec 2012.indd 1 31-08-12 14:53 Untitled-3 1 10/25/12 12:27 AM 4 DEPARTMENTS VOLUME XXVI - ISSUE 6

Up Front / 6

FROM THE EDITOR / 6 MASHUP / 8 Commitment to News, views, trends, the Cloud —Tom Haunert and tools

At Oracle / 11

EVENTS / 11 RESOURCES / 15 INTERVIEW / 23 Find out about upcoming Your guide to Oracle Optimized Application technology and industry Webcasts, podcasts, white Performance events. papers, and more Oracle’s Exalogic Elastic BRIEFS / 18 Cloud Software enables a true IaaS environment. The latest product news —Tom Haunert

Community / 26

PARTNER NEWS / 26 COMMUNITY ARCHITECT / 29 UP CLOSE / 30 PEER-TO-PEER / 31 BOOK BEAT / 26 BULLETIN / 28 Architects Matter A Path to Leadership Tech Destiny News, people, and Making sense of the New ODTUG program Wagner Bianchi, Emre happenings in Oracle people who make sense of grooms leaders for user Baransel, Jeff Jacobs Technology Network enterprise IT —Bob Rhubart group success. —Blair Campbell —Jeff Erickson

Technology / 41

ORACLE ADF / 41 PL/SQL 101 / 47 TUNING / 51 SQL 101 / 57 ASK TOM / 63 Master and Commander The Data Dictionary: Beginning Performance Selecting a Type That Is On External Table Queries, Implementing a reusable Make Views Work for You Tuning: Diagnose the Past Right for You Data Consistency, and command pattern template Part 10 in a series of articles Take the next step in Part 8 in a series on the Nothing strategy —Frank Nimphius on understanding and diagnosing Oracle Database basics of the relational Our technologist queries using PL/SQL performance issues. database and SQL the operating system, locks —Steven Feuerstein —Arup Nanda —Melanie Caffrey manually, and uses the right NULL. —Tom Kyte

Comment / 68

TIME CAPSULE / 68 Flashbacks: Culture. Industry. Oracle. Oracle Magazine. —Rich Schwerin

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_TOC.indd 4 10/17/12 10:10 AM 5

Editorial Publishing Editor in Chief Vice President Tom Haunert [email protected] Jeff Spicer [email protected] Senior Editor Publisher Caroline Kvitka [email protected] Jennifer Hamilton [email protected] +1.650.506.3794 Managing Editor Audience Development and Operations Director Jan Rogers [email protected] Karin Kinnear [email protected] +1.650.506.1985 Associate Editor Patty Waddington Advertising sales Contributing Editor and Writer Associate Publisher Blair Campbell Kyle Walkenhorst [email protected] +1.323.340.8585 Technology Advisor Northwest and Central U.S. Tom Kyte Tom Cometa [email protected] +1.510.339.2403 Contributors Southwest U.S. and LAD Marta Bright, Jeff Erickson, Fred Sandsmark, Rich Schwerin, Leslie Steere Shaun Mehr [email protected] +1.949.923.1660 Northeast U.S. and EMEA/APAC DESIGN Mark Makinney [email protected] +1.805.709.4745 Senior Creative Director Advertising Sales Assistant Francisco G Delgadillo Cindy Elhaj [email protected] +1.626.396.9440, x201 Senior Design Director Mailing-List Rentals Suemi Lam Contact your sales representative. Design Director Richard Merchán Resources Contributing Designers Oracle Products Jaime Ferrand, Nicholas Pavkovic +1.800.367.8674 (U.S./Canada) Production Designers Oracle Services Sheila Brennan, Kathy Cygnarowicz +1.888.283.0591 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, Subscription Information Ari Kaplan, Val Kavi, John King, Steve Lemme, Carol McGury, Sumit Sengupta, Subscriptions are complimentary for qualified individuals who complete the Jonathan Vincenzo, Dan Vlamis subscription card found in each issue or online at oracle.com/oraclemagazine. For change of address, mail in label with the new address to: Oracle Magazine, P.O. Box 1263, Skokie, IL 60076-8263.

Magazine Customer Service United States Postal Service Statement of Ownership, [email protected] Fax +1.847.763.9638 Phone +1.847.763.9635 Management, and Circulation. Privacy Oracle Magazine, ISSN 1065-3171, is published bimonthly (six issues Oracle Publishing allows sharing of its mailing list with selected third parties. each year) with a free subscription price by Oracle Corporation. The office If you prefer that your mailing address or e-mail address not be included in this of publication and the general business office are located at 500 Oracle program, contact Customer Service at [email protected]. Parkway, Redwood City, CA 94065. The publisher is Jeffrey Spicer; the Editor is Thomas Haunert; the Managing Editor is Jan Rogers; and the owner Copyright © 2012, Oracle and/or its affiliates. All Rights Reserved. No part of this publication is Oracle Corporation, all at the above address. Known stockholders owning may be reprinted or other­wise reproduced without permission from the editors. ORACLE MAGAZINE or holding 1 percent or more of the total amount of stock is Lawrence J. IS PROVIDED ON AN “AS IS” BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES, Ellison at the above address. There are no known Bondholders, Mortgagees, WHETHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM YOUR USE OF OR RELIANCE ON ANY INFORMATION PROVIDED or Other Security Holders Owning or Holding 1 Percent or More of Total HEREIN. The information is intended to outline our general product direction. It is intended for Amount of Bonds, Mortgages, or Other Securities. The Issue Date for the information purposes only, and may not be incorporated into any contract. It is not a commitment following data is September/October 2012. Average No. Copies Each Issue to deliver any material, code, or functionality, and should not be relied upon in making purchasing During Preceding 12 months: Total Number of Copies (Net press run): decisions. The development, release, and timing of any features or functionality described for 420,634; Paid/Requested Outside-County Mail Subscriptions stated on Oracle’s products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks Form 3541: 269,324; Sales Through Dealers and Carriers, Street Vendors, of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Counter Sales, and Other Non-USPS Paid Distribution: 110,862; Total Paid Oracle Magazine (ISSN 1065-3171) is published bimonthly with a free subscription price by: Oracle, and/or Requested Circulation: 380,186; Free Distribution by Mail: 3,750; 500 Oracle Parkway, MS OPL-3C, Redwood City, CA 94065-1600. Periodicals Postage Paid at Free Distribution Outside the Mail: 35,134; Total Free Distribution: 38,884; Redwood City, CA, and additional mailing offices. • POSTMASTER: Send address changes to: Oracle Total Distribution: 419,070; Copies Not Distributed: 1,564; Total: 420,634; Magazine, P.O. Box 1263, Skokie, IL 60076-8263. Percent Paid and/or Requested Circulation: 90.7%. No. Copies of Single Issue Published Nearest to Filing Date: Total Number of Copies (Net press run): Printed by Brown Printing 370,040; Paid/Requested Outside-County Mail Subscriptions Stated on Form 3541: 225,674; Sales Through Dealers and Carriers, Street Vendors, Counter Sales, and Other Non-USPS Paid Distribution: 103,459; Total paid and/or Requested Circulation: 329,133; Free Distribution by Mail: 3,721; Free Distribution Outside the Mail: 35,768; Total Free Distribution: 39,489; Total Distribution: 368,622; Copies not Distributed: 1,418; Total: 370,040; Percent Paid and/or Requested Circulation: 89.3%. This Statement of Ownership, Management, and Circulation was filed September 20, 2012 by Karin Kinnear, Director, Audience Development and Operations.

oracle magazine November/December 2012

ND12_TOC_R1.indd 5 10/23/12 1:27 PM 6 From The Editor

Commitment to the Cloud Cloud is the word at Oracle OpenWorld—and Oracle.

didn’t count the number of conversa- system; it features updated hardware and I tions I had or heard that included the uses the Exalogic Elastic Cloud Software 2.0 word, but I’m quite comfortable saying that release. (See “Built for Speed” on page 22 cloud was the word of the week at Oracle’s and “Optimized Application Performance” conferences and events in San Francisco, on page 23 for more information.) California, September 29 through October 5, Oracle also announced seven Oracle Cloud 2012. There were announcements focused (cloud.oracle.com) preview services, including explicitly on Oracle cloud technologies and Oracle Planning and Budgeting Cloud Service, solutions, but cloud was also a big part of Oracle Financial Reporting Cloud Service, every Oracle product, technology, and service Oracle Data and Insight Cloud Service, Oracle announcement and discussion. Social Sites Cloud Service, Oracle Developer Cloud Service, Oracle Storage Cloud Service, Cloud Checklist and Oracle Messaging Cloud Service. (See Oracle CEO Larry Ellison’s Sunday keynote “Oracle Expands Cloud Services Portfolio” on at Oracle OpenWorld 2012 was about page 20 for more information.) cloud computing, including the history of cloud computing going back to NetSuite in Cloud Challenges and Solutions 1998 and the beginnings of Oracle Fusion While gathering content for this issue of Applications development in 2004. Ellison Oracle Magazine, I ran across the following discussed public and private clouds, the phrase in descriptions of cloud computing levels of cloud services—software as a news at Oracle OpenWorld: “the varied and service (SaaS), platform as a service (PaaS), unpredictable workloads of cloud computing.” Next Steps and infrastructure as a service (IaaS)—and It looked like a problem statement, but there their key components, and Oracle’s latest was no solution with it—at least, not in the LEARN more about Oracle Cloud offerings in each of these service areas. first text I saw. cloud.oracle.com Ellison talked about Oracle technologies But when I located the phrase in the Oracle Oracle Exadata designed specifically for better cloud com- press release where it originated, it turns out oracle.com/exadata puting, from infrastructure and private cloud that the cloud problem statement had a very oracle.com/us/corporate/press/1855412 services to database multitenancy and engi- clear and specific solution: Oracle’s new Oracle Oracle Exalogic oracle.com/exalogic neered systems. He also unveiled the latest Exadata X3 engineered systems, the press Oracle engineered systems releases and release said, “. . . can store up to hundreds of Send Mail to the Editors discussed their infrastructure and platform terabytes of compressed user data in flash support for cloud computing. and RAM memory, virtually eliminating the Send your opinions about what you read in Oracle Oracle’s Exadata Database Machine X3-2 performance overhead of reads and writes to Magazine, and suggestions for possible technical and Exadata Database Machine X3-8 are the slow disk drives, making Exadata X3 systems articles, to [email protected]. You can latest Oracle Exadata engineered systems, the ideal database platforms for the varied and also follow our @oraclemagazine Twitter feed or join us on Facebook at bit.ly/orclmagfb. featuring increased flash memory—to unpredictable workloads of cloud computing.” Letters may be edited for length and clarity and 22 TB—and support for write I/Os in Exadata may be published in any medium. We consider Smart Flash Cache. Exalogic Elastic Cloud Tom Haunert, Editor in Chief any communications we receive publishable. X3-2 is the latest Oracle Exalogic engineered [email protected]

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

November/December 2012 Oracle.com/oraclemagazine

ND12_EdNote.indd 6 10/17/12 9:42 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.

oracle Business intelligence 11g Developers Guide Mark Rittman Deliver meaningful business information to users anytime, anywhere, on any device, with Oracle Business Intelligence 11g.

peoplesoft peopletools Data Management and upgrade Handbook Paula Dean, Jim J. Marion Maximize data integrity, maintain peak application performance, and keep your PeopleSoft environment up to date.

oracle e-Business suite financials Handbook, third edition Ben Prusinski, Gustavo Gonzalez Maintain an integrated, customer- focused financial computing framework that meets global business requirements while lowering total cost of ownership.

oracle solaris 11 system administration: the complete reference Michael Jang, Harry Foxwell Manage a highly scalable, cloud- based computing platform and deliver unmatched performance levels at every layer of your IT stack.

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

Untitled-3 1 10/25/12 12:37 AM 8 MashUp News. Views. Trends. Tools.

You’re not limited to the navigation apps that come with your phone. Hit the road with these alternatives. CoPilot MapQuest MotionX-GPS Drive Waze This app’s main This app puts This soup-to-nuts A “social mobile” feature is its ability points of interest navigation app app, Waze collects to chart a course on the main screen, shows your speed traffic, accident, without a data provides turn- limit, advises you speed trap, and connection. Plus, by-turn spoken which lane to take other info in real tap anywhere on directions, and at complicated time from its users the map to navigate updates traffic intersections, and and builds it into

NAVIGATION APPS NAVIGATION there. US$3.99 info every five connects to social dynamic maps. The to US$43.99. minutes. Free. media sites and your more users in your copilotlive.com mapquest.com address book. US$1. area, the better. “The impact and almost drive.motionx.com Free. waze.com magic ripple effect of a well-crafted and What’s better than recording video beautifully delivered of your latest adventures on the trail, three-minute elevator river, mountain—or in the confer- speech in today’s ence room? Streaming it live via 3G, 4G, and Wi-Fi with the changing and challenging Looxcie HD wearable camera. market cannot be denied.” Simply attach the small —Terri L. Sjodin, author of Small camera to a headband, hat, Message, Big Impact: The Elevator or helmet, wirelessly sync the Speech Effect (Portfolio/Penguin, 2012) camera with the Looxcie iOS or Android phone app, and you are ready to broadcast. Looxcie HD also lets you connect directly to Facebook through its companion apps. Applications LIVE include live blogging, teaching a workshop, collaborating with a team, and sharing your outdoor exploits. STREAM Looxcie HD can also do video capture and sharing with full 1,080p CLOUD CONFUSION MINICAM recording. US$299. looxcie.com About half of Americans surveyed are hazy on what cloud computing really is. In a survey of more than 1,000 adults, 51 percent of respondents said that stormy weather can interfere with cloud CLOUDS IN THE FORECAST computing. Source: Wakefield Research for Citrix, Of the more than 400 IT professionals responding to a bit.ly/PJnrGP recent survey, 51 percent have or are planning private clouds. Other key fi ndings: If you work with of those with private clouds describe their Data Transfer large media files 99% initiatives as successful on a Mac, you Dynamic Duo probably know of nonadopters believe private clouds could that external drives can create a bottleneck 45% deliver a compelling technical advantage due to low rpm and low data transfer speeds. Western Digital My Book VelociRaptor Duo of those starting private cloud projects expect solves this problem with an elegantly designed 38% to spend 21% or more of their IT budgets on external enclosure packed with two WD the initiative VelociRaptor 10,000 RPM drives and dual of respondents will cobble together individual Thunderbolt ports that move data at transfer 38% projects despite 31% citing a lack of standards rates of up to 10 Gb/sec in both directions. as a roadblock This allows data to travel both ways without compromising bandwidth. VelociRaptor can be of respondents starting private cloud projects will buy a preconfigured bundle set up as RAID 1 (mirroring for data protection), 16% or JBOD (“just a bunch of disks”) to use as two individual drives. US$899.99. bit.ly/PX1ILM Source: Information Week Reports, Private Cloud Vision vs. Reality, bit.ly/Rmi7rL CHEN I-HUA

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_MashUp.indd 8 10/1/12 2:51 PM dqt_oracle_jul12_full-revision2-OL.ai 1 8/8/2012 2:46:25 PM

C

M

Y

CM

MY

CY

CMY

K

Untitled-3 1 10/25/12 12:47 AM 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 Ottawa Canada Linux Users Conferences and sessions to help you stay Group Meeting November 1, Ottawa, Ontario, Canada on the cutting edge oclug.on.ca

UKOUG Application Express SIG Meeting November 6, London, England Oracle Day 2012 ukoug.org Through November 28 in various cities IOUG Virtualization SIG Symposium throughout Europe, the Middle East, and November 7–8, online North Africa. bit.ly/RKJX7S Learn to absorb disruptive technologies such as cloud, Suncoast Oracle Users Group Meetings mobile, social, and big data without toppling your infra- November 8 and December 6, Tampa, Florida structure. With insights from Oracle experts, live dem- soug.org/meetings.php onstrations of new products, customer success stories, Michigan Oracle Users Summit and opportunities to brainstorm new concepts and November 14, Livonia, Michigan tactics with your peers, Oracle Day provides contacts, mous.us ideas, and solutions that drive business value and OUG Scotland APEX SIG agility from your Oracle investments. Find the complete November 14, Linlithgow, Scotland list of cities and dates at oracle.com/oracleday. ukoug.org Dayton Dynamic Languages SIG Meetings Asia HEUG Conference 2012 Oracle Health Sciences User Group November 14 and December 12, Dayton, Ohio November 1–2, Hong Kong, China (OHSUG) Annual Conference dma.org/sigs.shtml#dynamic fbit.ly/Rh5uP1 November 4–7, Monte Carlo, Monaco Northern California Oracle Users Group At this new conference featuring Oracle solutions fbit.ly/NsHdL0 Fall Conference in higher education, participants see presenta- This conference features presentations on the November 15, Pleasanton, California nocoug.org tions by institutions and vendors, hear Oracle technical and functional aspects of Oracle Health strategists discuss Oracle product direction, Sciences applications for clinical, pharmaceu- OAUG Connection Point—Oracle network with colleagues, and explore complimen- tical, biotech, medical device, contract research, E-Business Suite Release 12.1/Oracle Fusion Coexistence tary products and services from key vendors. and support companies, along with focus groups November 15–16, San Diego, California covering Oracle Argus Safety, Oracle Clinical, bit.ly/ODmBy2 Sangam ’12 Oracle Remote Data Capture, cloud, SOA, data Calgary Oracle Users Group Meetings November 2–3, Bangalore, India mining, and metrics and reporting. November 15 and December 13, Calgary, faioug.org/sangam12.php Alberta, Canada Cohosted by All India Oracle Users Group, India OAUG Connection Point—EPM/BI coug.ab.ca Oracle Applications User Group, and the Chennai November 5–6, Orlando, Florida OUG Ireland BI and EPM SIG Meeting Java User Group, Sangam ’12 hosts more than fconnectionpoint.oaug.org/2012/orlando November 20, Dublin, Ireland 70 speakers from around the world leading more Oracle Applications Users Group (OAUG), Florida ukoug.org than 120 sessions. Conference tracks include OAUG, the OAUG Hyperion Special Interest Heartland Oracle Users Group database, development, Java, Oracle applica- Group (SIG), and Oracle Business Intelligence Conference and Training Days tions, and Linux. SIG present a two-day event at which Oracle November 28–29, Omaha, Nebraska heartlandoug.wordpress.com experts and partners provide information, appli- Insurance and Technology cation roadmaps, and practical solutions in more New Zealand Oracle Users Executive Summit than 35 educational sessions for accounting, Group Meeting December 5, Wellington, New Zealand November 4–7, Rancho Palos Verdes, finance, and internal audit teams. nzoug.org California finsurancetech.com/summit2012 Gartner Symposium/ITxpo NYOUG Special Winter General Meeting December 12, New York, New York Learn about strategies and technologies that November 5–8, Barcelona, Spain nyoug.org are transforming the insurance industry at this fbit.ly/OMOiml summit for senior-level executives. Technology This gathering of CIOs and senior IT executives St. Louis Oracle Users Group Meeting December 13, Chesterfield, Missouri topics include customer experience, big data, offers more than 350 analyst sessions, work- sloug.org

G etty I mages core systems, and the role and future of IT. shops, roundtables, and keynotes over four days.

oracle magazine November/December 2012

ND12_Events.indd 11 10/1/12 3:00 PM 12 Events

with Oracle Application Development Framework Mobile Client.

JayDay Munich December 3, Munich, Germany fjayday.de This new event features JavaOne Rock Stars, Oracle ACEs, and Java Champions presenting a full day of content for Java developers. Sessions on Web, desktop, performance, concurrency, tools, languages, and more are conducted in English and German.

Business Intelligence and data warehousing are hot topics at the TDWI World Conference in Orlando, Florida, November 11–16. MDM and Data Governance Summit Singapore 2012 With 10 role-based tracks and 6 industry tracks, ering business intelligence (BI) and data ware- December 4–5, Singapore the agenda targets specific job responsibilities housing topics, including BI essentials, business fbit.ly/T04LpJ and ways to adapt new ideas and strategies to analytics, data analysis and design, data asset This is Southeast Asia’s premier event focused individual industries. management, agile development, cloud com- on master data management (MDM), data puting, text analytics, virtualization, open source, governance and quality, and information man- QCon San Francisco 2012 Web 2.0, social media, and mobile BI. agement. The summit focuses on building a November 5–9, San Francisco, California business-driven MDM program and establishing fqconsf.com Devoxx an IT foundation to make MDM work. Content This practitioner-driven conference for devel- November 12–16, Antwerp, Belgium includes best practices and information about opment team leads, architects, and project fdevoxx.com/display/dv12/home leading IT organizations. managers includes two tutorial days followed This annual European Java gathering is histori- by three conference days covering 18 tracks, cally the world’s largest vendor-independent Cloud Computing World Forum including big data and analytics, continuous Java conference. It features two days of in-depth North America delivery, and the Java renaissance. university sessions, 30-minute tools-in-action December 6, New York, New York sessions focused on technical tools and APIs, fbit.ly/TBSNQx Cyber Security 2012 three-hour hands-on labs, three days of hour- This one-day executive-level conference on November 6, London, England long technical presentations, 15-minute quickie cloud computing and related topics features foraclepublicsector.co.uk/events sessions during lunch breaks, and informal content on security, mobility, content delivery Featuring all aspects of cybersecurity within the evening birds-of-a-feather gatherings. networks, applications, software as a service, vir- public sector, this conference offers the latest tualization, customer relationship management, strategies from Oracle and leading public sector Bulgarian Oracle User Group social, and communications. agencies and opportunities to discuss security Conference with professionals and Oracle experts. November 16–18, Pravets, Bulgaria Groovy and Grails eXchange 2012 fbgoug.org/en/events/details/88.html December 13–14, London, England Alliance Down Under Topics at this conference include database server fbit.ly/OtWWaK November 6–9, Gold Coast, Queensland, technology, database administration and tuning, This two-day conference features two dozen Australia application design and development, middleware, expert-led talks, along with discussion and fheug.org/p/cm/ld/fid=543 business intelligence, and content management. brainstorming sessions, all focused on learning Australian and New Zealand Higher Education and sharing ideas, tools, and practices for enter- User Group presents a program covering all DOAG 2012 Conference + Exhibition prise Web development with Groovy and Grails. aspects of Oracle’s PeopleSoft and other Oracle November 20–22, Nuremberg, Germany technologies in higher education, including special fbit.ly/NXpbfc sessions for executives and academic registrars. Approximately 400 technical lectures and Events locator displays by 60 companies are highlights of TDWI World Conference this 24th-annual gathering of Deutsche Oracle Oracle Events November 11–16, Orlando, Florida Anwendergruppe—also known as DOAG, the oracle.com/events mages fbit.ly/Tkwmzh German Oracle Users Group. New content this User Groups I bit.ly/pX7Yob etty

The conference features six days of courses cov- year includes developing mobile applications G

November/December 2012 Oracle.com/oraclemagazine

ND12_Events.indd 12 10/1/12 3:01 PM Isenberg MBA. Your Way.

Full-Time. Online. Blended. AACSB Accredited. Adapted to your lifestyle.

Contact our dedicated advising center: Tel. 413.545.5608 | www.isenberg.umass.edu/mba

Untitled-3 1 10/25/12 12:49 AM Partner Excellence! Congratulations20 201212 Specialized Event Partners Sponsor of the Year – Global Logo Capgemini

Full Color Reversed

Middleware Oracle on Oracle Applications

Industry Server & Storage Database

Specialized. Recognized. Preferred.

partner.oracle.com or call 1.800.323.SELL 1 Color

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.

Untitled-3 1 10/25/12 12:54 AM PUB NOTE: Please use center marks to align page. Print Ad Job No.: 213M_CRP_PrtnrsGlbl PRODUCTION NOTES READER LASER% RELEASED Headline: Partner Excellence! Date: 9/24/2012 Project: Master Print Ad 9/24 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 Resources 15

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

WEBCASTS Webcast Series: Accelerate Business- ORACLE UNIVERSITY “Data Integration Breakthroughs: Bridging Critical Database Deployments with Oracle Get Your Oracle Training On Demand—More the Gap in Big Data, Cloud, and Real-Time Optimized Solutions Courses Now Available Data Integration” fbit.ly/O9Pcso fbit.ly/RKlvn2 fbit.ly/PH3uAK Learn to safely consolidate your business-critical Get complete classroom training and access Get up to speed on big data, cloud integration, database environment and build a business case to hands-on labs from your desktop with the real-time analytics, and continuous availability. based on quantifiable cost savings with Oracle latest Training On Demand courses from Optimized Solutions. Oracle University. “Oracle Hardware Systems: The Extreme Performance Online Event” Webcast Series: Simplify and Speed RESOURCE CENTERS fbit.ly/Qch7X8 Infrastructure Deployments Oracle C-Central Learn how Oracle hardware systems deliver fbit.ly/TZUr0H fbit.ly/P9apXg extreme performance for competitive advantage. Learn about Oracle’s solutions with EMC Get information about industry trends, best prac- and Cisco that are based on Oracle VM and tices, and use cases for Oracle solutions through “Oracle Solaris 11 Online Forum” Oracle Linux. content developed specifically for CFOs and CIOs. fbit.ly/OWXoO3 John Fowler, executive vice president of VIDEOS Quantifying the Value of Application-Driven systems at Oracle, discusses what’s new with Get Faster Results with Oracle SPARC Virtualization Oracle Solaris 11. SuperCluster fbit.ly/SKzdUG fbit.ly/RjoNeI Access an Evaluator Group report about Oracle “Harness the Power of the New Release of Get expert information about how Oracle SPARC virtualization, along with other resources such as Oracle GoldenGate 11g” SuperCluster reduces the time and effort required demos, white papers, calculators, and downloads. fbit.ly/Sx0Gci to install, tune, and administer optimized mission- Discover how Oracle GoldenGate 11g delivers critical systems. E-BOOKS enhanced, continuous availability and real-time Simplify IT Through Hardware Technology data integration solutions in heterogeneous Reduce Risk with Oracle Advanced Refresh IT environments. Monitoring and Resolution fbit.ly/U032jO fbit.ly/QDVXqf Learn how to modernize your infrastructure and “Introducing Oracle Identity Management 11g Learn the unique features of Oracle’s 24/7 secure optimize your data center with the latest genera- Release 2” monitoring services and the value of proactive res- tion of hardware systems. fbit.ly/QaaUQI olutions delivered by advanced support engineers. See new features and technology in Oracle Reliable, Scalable, Secure: Oracle Solaris 11 Identity Management 11g Release 2 that expand Transplace Shares the Value of Oracle fbit.ly/NjhpAL the reach of comprehensive identity protection to Platinum Services Discover how upgrading to Oracle Solaris 11 cloud and mobile environments. fbit.ly/Q217XK running on Oracle’s new generation of SPARC Watch the CTO of Transplace describe the unique and x86 systems is helping to transform data 2012 Global Database Management Survey benefits of Oracle Platinum services. centers worldwide. Results: “Addressing Your Top Database Management Challenges” Overstock.com Achieves 100 Percent Oracle’s Sun Servers: The Backbone of the fbit.ly/SwUliF Uptime with Oracle Linux and Oracle VM Next-Generation Optimized Data Center In this CIO.com Webcast sponsored by Oracle, fbit.ly/NWLr7w fbit.ly/Rh2wOA get insights into top database management pain See how Overstock.com Web operations deliver Read about how to achieve new levels of data points, including the tasks that consume the most faster IT response time, 100 percent uptime, and center optimization using Oracle’s SPARC servers, DBA time and top challenges in deploying new improved customer experience, while reducing Sun x86 servers, Sun Netra carrier-grade servers, database services. hardware costs by 87 percent. and Sun blade servers.

oracle magazine November/december 2012

ND12_Resources.indd 15 10/1/12 3:18 PM 16 Resources

overHEARD CALCULATOR Updated Oracle VM vs. VMware vSphere “The SPARC SuperCluster was derived primarily because of Cost Calculator such a large SPARC install base. . . . They’ve invested a lot of fbit.ly/SxVHbs time in Oracle Solaris applications, mindset, and training. We The newly updated Oracle VM calculator now includes management costs for VMware vCenter. felt that delivering a SPARC SuperCluster was a way to con- tinue that SPARC ecosystem and Oracle Solaris ecosystem, BLOGS yet delivering the performance that we had seen in Oracle Implementing Oracle Analytic Solutions Exadata and Oracle Exalogic.” fblogs.oracle.com/robreynolds Read all about implementing successful —Gary Combs, Oracle Principal Product Manager, in Get Faster Results with Oracle SPARC SuperCluster analytics solutions. (bit.ly/RjoNeI) Oracle Enterprise Performance Oracle’s SPARC Systems: “User Interface Changes in Oracle Identity Management Blog What Customers Say Manager” fblogs.oracle.com/epm fbit.ly/Qvagb4 fbit.ly/NmhMdL Keep up with the latest key enterprise performance SPARC customers worldwide are minimizing costs Marc Boroditsky, vice president of product management market trends, recent events, and and maximizing competitive edge. Discover how. management at Oracle, discusses user interface other enterprise performance management news. changes to Oracle Identity Manager that improve Easily Unlock the Value of Big Data usability for business users and administrators. DEMOS fbit.ly/OtH3ig Oracle Linux Animated Overview Learn how to acquire, organize, integrate, and “Oracle Hyperion Planning and Oracle fbit.ly/R8JqXp analyze big data; benchmark your progress against Exalytics In-Memory Machine” Watch this three-minute animated overview and leading companies; and access white papers, fbit.ly/NPtola find out why Oracle Linux is the best Linux for analyst videos, and demos. Oracle product experts discuss the benefits enterprise computing. of running the new release of Oracle Hyperion Advanced Support: Maximize Availability Planning on Oracle Exalytics In-Memory and Performance Machine. web locator fbit.ly/PHq4cB Discover how Oracle Advanced Customer “Enhancing Enterprise Planning and Oracle Blog Center oracle.com/blogs Support Services delivers tailored, mission- Forecasting Through Predictive Modeling” Oracle Consulting critical support services. fbit.ly/MRmbnC oracle.com/consulting Hear about best practices in integrating predictive Oracle Events and Webcasts PODCASTS modeling into long-range planning, budgeting, and oracle.com/events “Understanding Big Data Analysis with the sales forecasting. Oracle Newsletters R Language” oracle.com/newsletters fbit.ly/NrjTar WHITE PAPERS Oracle Podcast Center oracle.com/podcasts Michael Kane from Yale University talks about big “SPARC Servers: An Effective Choice for Oracle University data and the R statistical programming language. Efficiency in the Data Center” oracle.com/education fbit.ly/LDWfdD Oracle on Facebook “Linux Security Explained” International Data Corporation analysts discuss facebook.com/oracle fbit.ly/PDm2EA how efficiency has become a top priority world- Oracle on Google+ Listen to James Morris, consulting member of the wide for CXOs, IT managers, and data center bit.ly/LdGiM0 Oracle engineering technical staff, discuss the managers with limited IT budgets and rising Oracle on LinkedIn linkedin.com/company/oracle work he is doing to enhance Linux security. operational costs. Oracle on Twitter twitter.com/oracle “SQL Server Migration Tool” “The Business Value of Proactive Oracle Support fbit.ly/PHx7lz Support Services” oracle.com/support Alfredo Kojima, senior software development fbit.ly/PHtAnc My Oracle Support manager at Oracle, talks about the new tool Read what International Data Corporation has myoraclesupport.com enabling easy migration from Microsoft SQL to say about the value of Oracle’s proactive My Oracle Support Communities communities.oracle.com Server to MySQL. support services.

November/december 2012 Oracle.com/oraclemagazine

ND12_Resources.indd 16 10/1/12 3:18 PM Only our IT physical infrastructure is as dynamic as your business needs.

“The ability to “APC by monitor everything “This solution Schneider Electric ™ from the Web ensures a single InRow cooling allows us to catch integrated power architecture... is our design small problems Brian R. York − Director and cooling Mike Mallett − Director of Wireless National Practice technical operations Andy Koostra before they become management standard going ” Insight Saint Luke’s Health System Systems Manager a big concern. system. forward.” Consolidated Utility District ”

Protect any IT equipment or deployment with our adaptable APC by Schneider Electric InfraStruxure solutions. Integrated InfraStruxure solutions include everything for your IT physical infrastructure deployment: backup power A solution for every IT configuration and power distribution, cooling, enclosures, and management Protect your IT system uptime easily where ever your IT is deployed with software. Adaptable solutions scale from the smallest IT spaces up to multi-megawatt data centers. APC™ by Schneider Electric™ InfraStruxure™ solutions. Our simple, adaptable, and manageable all-in-one physical infrastructure is designed as an easy-to-deploy system Mission-critical IT infrastructure to allow for flexible management, physical IT deployment, and by extension, system without the complexity uptime. > Simple Customers have adapted the solution to all IT configurations — from out-of-the- Solution guides and out-of-the-box installation make way network closets to server rooms to data centers. Power protection, cooling, deployment easy. rack systems, and remote management are part of the total architecture for highest > Manageable availability at all times. With our InfraStruxure solutions working to stave off Remote monitoring, management, and reporting simplify IT operations; energy management cuts costs. physical threats, you can focus on more pressing concerns such as network threats, > Adaptable IT hardware failure, and switch hang-ups. When you deploy our solution, it’s as if With standardized designs for all types of applications, our you’re getting another IT person to ensure that your IT space or data center will still solutions can be adapted to fi t any IT need at any time for be at your command when you need it. What’s more, our life cycle services enable business-minded fl exibility. optimal operations.

Business-wise, Future-driven.™

Make the most of your IT space! Download our Top 3 solution design guides today and enter to win an iPad® 2. Visit: www.apc.com/promo Key Code: u263v Call: 888-289-APCC x6459

©2012 Schneider Electric. All Rights Reserved. Schneider Electric, APC, InfraStruxure, InRow, and Business-wise, Future-driven are trademarks owned by Schneider Electric Industries SAS or its affiliated companies. All other trademarks are the property of their respective owners. • www.schneider-electric.com • 998-1154461_GMA_US_iPad2

Oracle_US_Nov1_u263v.indd 1 9/10/12 2:19 PM Untitled-3 1 10/25/12 12:57 AM 18 Product Resources

TUTORIALS Oracle GoldenGate 11g Release 2 Unveiled

Using Oracle XML DB to Optimize Oracle GoldenGate 11g Release 2, the performance, zero-downtime data migration, Performance and Manage latest version of Oracle’s comprehensive disaster recovery, and active-active database Structured XML Data real-time data integration solution, is now synchronization for continuous availability. This tutorial shows you how to store, index, and query XML data in Oracle XML available. Tightly integrated with Oracle “To succeed in today’s highly competitive Database (Oracle XML DB). You will learn technologies, the new release delivers global markets, organizations need to have about Oracle XML DB’s capabilities that performance enhancements, increased a holistic view of their data landscape,” says enable storage, indexing, querying, opti- support for business-critical and hetero- Brad Adelberg, vice president of development mized performance, and management of geneous systems, and expanded manage- at Oracle. “Oracle GoldenGate 11g Release 2 structured XML data. ment capabilities. enhances Oracle’s industry-leading data fbit.ly/SnQW4J A component of Oracle Fusion integration solution through improved perfor- Authenticating and Authorizing Middleware, Oracle GoldenGate 11g Release 2 mance, reliability, flexibility, and integration. Users in Java EE 6 Web Applications provides real-time data integration to This release minimizes downtime for our cus- Running on WebLogic Server 12c business-critical applications, enabling tomers’ critical systems and supports better This tutorial covers how to secure a Java improved business insight, query offloading decision-making across the enterprise.” EE 6 Web application with form-based to maximize online transaction processing bit.ly/Tf2x2o authentication and role-based authoriza- tion. You will learn how to create a login form with JavaServer Faces as the client Oracle Introduces Mobile Point-of-Service for Retailers to collect user and password data and how Oracle has unveiled Oracle Retail Mobile ating systems and devices, so retailers are not to authorize certain roles that access a Point-of-Service, a mobile extension to locked in to specific vendors. Servlet. The tutorial also shows you how to add users to Oracle WebLogic Server 12c Oracle Retail Point-of-Service that enables “Oracle Retail Mobile Point-of-Service and map them to the Web application roles store associates to assist customers and provides the flexibility to serve customers that will be used in the authentication and securely complete transactions from any- on their terms. By providing store associates authorization processes. where in the store using mobile devices. with a consistent transaction interface and fbit.ly/SEBOBr Fully integrated with Oracle Retail’s stores delivering actionable insights at any point Oracle Tuxedo 12c Release 1: solutions, which ensures consistent business of service, we help retailers level the playing Configuring Extended logic, Oracle Retail Mobile Point-of-Service field between store associates and digitally Authentication and Authorization has a scalable and enabled customers,” says Mike Webster, Learn how to configure Oracle Tuxedo’s flexible architec- senior vice president and general manager, extended authentication and authorization ture that allows any Oracle Retail. “Oracle Retail Mobile Point-of- feature. This feature allows Oracle Tuxedo combination of fixed Service provides an integrated and scalable applications to use the same centralized and mobile checkout architecture for retailers to create differenti- LDAP server for authentication that the rest points and supports ated customer interactions.” of the enterprise uses, while simultaneously multiple mobile oper- bit.ly/QSU9sN allowing Oracle Tuxedo to provide authori- zation for protected resources without the need to maintain duplicate identity data. Oracle Application Development Framework Essentials Unveiled fbit.ly/Q4xo35 Oracle has released Oracle Application various business services; and Oracle ADF ARTICLES Development Framework (Oracle ADF) Business Components, declaratively config- Essentials to bring Oracle ADF benefits to ured, reusable components that implement “How I Got Started with the Btrfs File System for Oracle Linux” the global developer community. Free to use, common design patterns. Read about the basic capabilities of the Oracle ADF Essentials is standards-based “Oracle ADF is already proven as the Btrfs file system in Oracle Linux, how to and deploys on GlassFish Server Open Source strategic framework used to build Oracle create a file system, and more. Edition, providing a way for developers to Fusion Applications,” says Chris Tonas, vice fbit.ly/LgrQCT adopt and extend Oracle ADF functionality president, Applications Development Tools to new environments. at Oracle. “With Oracle ADF Essentials, we’ve “How I Simplified Oracle Database 11g Installation on Oracle ADF Essentials includes Oracle combined key tooling from Oracle ADF, Oracle Linux 6” ADF Faces, a set of more than 150 advanced Oracle JDeveloper, and Oracle Enterprise Learn how the oracle-rdbms-server-11gR2- Web user interface (UI) components; Pack for Eclipse in a free offering that should preinstall RPM package can simplify Oracle Oracle ADF Controller, an extension of the be a great way for many of our customers Database 11g installation on Oracle Linux. JavaServer Faces controller layer that helps and partners to jump-start their develop- fbit.ly/UwUpLT build complete reusable process flows; ment efforts.”

Oracle ADF Binding, which connects UIs to bit.ly/SHQlew nin g G roe Lin dy

November/December 2012 Oracle.com/oraclemagazine

ND12_briefs.indd 18 10/16/12 12:53 PM BRIEFS 19

Oracle Extends Commitment to R for Big Data Analytics Oracle Announces Oracle

Oracle is offering enhanced support for the R TimesTen In-Memory Database in addi- Solaris 11.1 statistical programming language, increasing tion to Oracle Database, and integration of The latest Oracle Solaris release, Oracle the accessibility of big data analytics within hardware-specific math libraries for faster Solaris 11.1, delivers more than 300 new per- the enterprise. Oracle’s open source distri- performance. formance and feature enhancements. bution of R is available “Big data analytics is a top priority for our Oracle Solaris 11.1 features database with Oracle Big Data customers, and the R statistical program- technology enhancements that deliver the Appliance and can also ming language is a key tool for performing best performance, availability, and I/O be downloaded now. these analytics,” says Andrew Mendelsohn, throughput of any UNIX platform used to run The enhanced senior vice president, Oracle Database Server Oracle Database. These include improving support includes new Technologies. “With this announcement, lock latency for Oracle Real Application platform ports of R we continue to enhance and expand our Clusters, resizing Oracle Database system for Oracle Solaris and industry-leading support for R across the global area (without a reboot), and observing AIX in addition to Oracle Database, Oracle TimesTen In-Memory and understanding database I/O bottlenecks Linux and Windows, Database, and Hadoop platforms.” using Oracle Solaris DTrace. connectivity to Oracle oss.oracle.com/ORD New cloud infrastructure features add to Oracle Solaris 11’s highly efficient built-in Oracle Launches Two Java Embedded Products virtualization capabilities across system, network, and storage resources and include Addressing the strong demand for Java in ponents with their existing Java skill sets. support for the open standard Federated File the embedded market, Oracle has unveiled Oracle Java Embedded Suite 7.0 is now avail- System and expanded support for software- Oracle Java ME Embedded 3.2, a complete able for Linux on x86 and Linux on ARM. An defined networks. client Java runtime optimized for micro- evaluation implementation is available for “Oracle Solaris 11 is the best UNIX oper- computers and other resource-constrained download from Oracle Technology Network. ating system to run Oracle applications, devices, and Oracle Java Embedded Suite 7.0, “The rapid growth in the ‘internet of deploy mission-critical cloud infrastruc- the first Java-based middleware stack for things’ is driving demand for open and cross- ture, and protect customer investments,” embedded systems. industry platforms that can help decrease says John Fowler, executive vice president, With Oracle Java ME Embedded 3.2, appli- time to market and deliver increased capa- Systems at Oracle. “The Oracle Solaris engi- cations for small embedded devices are no bilities in embedded devices, while retaining neering team has worked closely with the longer tied to a single hardware platform. In tight control on development, production, Oracle Database engineering team to deliver addition, Oracle Java ME Embedded 3.2 meets and support costs,” says Nandini Ramani, unique value that customers can only get the unique requirements of small embedded, vice president of engineering, Java Client from an Oracle solution.” low-power devices, including on-the-fly and Mobile Platforms at Oracle. “Java’s bit.ly/OOy0gx application downloads and updates, remote uniquely flexible architecture supports these operation, and the ability to add new capabili- requirements through a highly secure virtual Oracle Buys SelectMinds ties without affecting existing functions. machine designed to support remote appli- Oracle Java Embedded Suite 7.0 helps cations updates and downloads. Oracle has agreed to acquire SelectMinds, a organizations achieve faster time to market bit.ly/PPx1HD cloud-based talent management company. by leveraging proven middleware com- bit.ly/UzFQwT SelectMinds applications help hiring man- agers use social connections to manage and Oracle Unveils Oracle Fusion Tap for the iPad market job referrals. “Recruiting candidates through employee Oracle has introduced Oracle Fusion Tap, a Oracle delivers mobile and cloud innovations referrals is widely acknowledged as the most native iPad application that runs off cloud- that fundamentally improve productivity effective method to find talent through based enterprise applications and across and how we work,” says Chris Leone, senior trusted contacts,” says Thomas Kurian, Oracle Cloud Application Services to improve vice president, Applications Development at executive vice president of product develop- productivity for mobile users by providing Oracle. “With Oracle Fusion Tap, users will ment at Oracle. “By adding SelectMinds to access to key functionalities to keep business have an all-in-one, Oracle’s Talent Management Cloud, Oracle moving. Automatically personalized to each easily extensible app can help customers with a complete talent user, it enables secure access to day-to-day that puts mission- management solution, enabling stream- management of the user’s workforce and critical data and col- lined recruiting practices, more quality sales force automation. league connection at referrals, faster employee on-boarding, and “The mobile workforce is a business reality, their fingertips.” better performance.”

LINDY GROENING LINDY and Oracle Fusion Tap is an example of how bit.ly/SMAeMP oracle.com/selectminds

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_briefs.indd 19 10/16/12 12:53 PM 20 BRIEFS

Oracle Expands Cloud Services Portfolio Oracle Unveils Platform for Social

Oracle has unveiled seven Oracle Cloud ronment that supports the complete develop- Oracle has launched preview services that augment its compre- ment lifecycle; Oracle Storage Cloud Service, Oracle’s social rela- hensive cloud portfolio. These include Oracle which allows businesses to store and manage tionship management Planning and Budgeting Cloud Service, which digital content in the cloud; and Oracle solution, an integrated streamlines financial planning, budgeting, Messaging Cloud Service, which enables data enterprise service that and forecasting processes; Oracle Financial communications between applications inside enables companies to Reporting Cloud Service, which enables the and outside of the Oracle Cloud. listen, engage, create, creation and delivery of highly formatted, “Cloud is a strategic business at Oracle,” market, and analyze interactions across boardroom-quality management reporting; says Abhay Parasnis, senior vice president multiple social platforms in real time. The Oracle Data and Insight Cloud Service, which of product development at Oracle. “The solution is integrated with Oracle’s enter- aggregates insightful and intelligent data breadth of opportunities available with the prise applications, including Oracle Fusion from enterprise, social, and external sources; Oracle Cloud already exceeds anything else Marketing, Oracle Fusion Sales Catalog, Oracle Social Sites Cloud Service, which available in the industry, and with the intro- and Oracle ATG Web Commerce, allowing enables brands to quickly expose sites to their duction of these new services, Oracle con- organizations to use social capabilities to customers; Oracle Developer Cloud Service, tinues to innovate, shape the market, and transform their corporate business processes which simplifies collaborative software devel- define the future of cloud-based services.” and systems. It is also integrated with Oracle opment by providing a standards-based envi- cloud.oracle.com Platform Services, including Oracle Java Cloud Service and Oracle Database Cloud Service, Enhanced Analytics for Oracle Exalytics In-Memory Machine enabling marketing teams to integrate social technology with their custom Web pages, Oracle has released new enhanced analytics to make deci- landing pages, and marketing tools. software optimized for Oracle Exalytics sions faster in the Oracle’s social relationship management In-Memory Machine that enables customers context of rapidly solution includes Oracle Social Network to view and analyze data at the speed of shifting business Cloud Service, which provides a secure col- business. New capabilities enhance organi- conditions while broadening user adoption of laboration platform; Oracle Social Marketing zational ability to quickly access and leverage business intelligence through the introduc- Cloud Service, which enables marketers to data assets in real time, from information tion of interactive visualization capabilities centrally create, publish, moderate, manage, discovery to visual and mobile analytics, that make every user an analyst,” says Balaji measure, and report across multiple social through enterprise planning and reporting. Yelamanchili, senior vice president, Oracle campaigns and platforms; Oracle Social In addition, Oracle Endeca Information Analytics and Performance Management Engagement and Monitoring Cloud Service, Discovery is now certified with Oracle Products. “The latest software enhance- which enables organizations to analyze Exalytics, allowing business users to easily ments and certifications further increase the social media interactions while also empow- explore diverse and unstructured informa- extreme performance and value of Oracle ering customer service and sales teams tion to find answers to questions that cannot Exalytics—allowing users of all skill sets to to effectively engage with customers and be easily answered by more-traditional, gain the actionable intelligence they need to prospects; Oracle Social Sites Cloud Service, quantitative business intelligence. make better, more informed decisions.” which provides a rich editing experience “Oracle Exalytics enables organizations bit.ly/R7vEIO that end users can leverage to dynamically develop and launch social sites; and Oracle New Commercial Extensions for MySQL Enterprise Edition Data and Insight Cloud Service, which provides information and insights about Oracle has unveiled new commercial exten- capabilities to dynamically enable and common business entities. sions for MySQL Enterprise Edition. Available disable audit streams, implement policies “By fundamentally changing the way orga- at no additional cost as part of MySQL that log all or selected login or query-based nizations connect with their different stake- Enterprise Edition and MySQL Cluster Carrier activities, and automatically rotate audit log holders, social is changing the rules of busi- Grade Edition, the new commercial exten- files based on size. ness,” says Thomas Kurian, executive vice sions deliver advanced-security and high- “MySQL customers want to reduce the president of product development at Oracle. availability options. risk, cost, and time to deploy and manage “With Oracle’s social relationship manage- One of the new extensions, MySQL business-critical applications,” says Tomas ment solution, we are empowering our cus- Enterprise Audit, provides an out-of-the- Ulin, vice president, MySQL Engineering at tomers to embrace this change by integrating box, easy-to-use auditing and compliance Oracle. “Our new security and high- the tools required to listen, engage, create, solution that helps organizations conform availability commercial extensions specifi- market, and analyze social interactions into to industry best practices and satisfy regula- cally address those needs.” existing applications and services.”

tory requirements. Other extensions provide mysql.com/products/enterprise cloud.oracle.com GROENING LINDY

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_briefs.indd 20 10/16/12 12:54 PM BRIEFS 21

Oracle Optimized Solution for Oracle E-Business Suite Unveiled Oracle Retail Data Model

Oracle has launched a new hardware mance with mission-critical availability Upgrades Analytics offering, Oracle Optimized Solution for and disaster recovery for Oracle E-Business Oracle has updated Oracle Retail Data Oracle E-Business Suite. Based on Oracle’s Suite environments, while reducing risk Model, its standards-based, enterprise- SPARC SuperCluster T4-4, Oracle Solaris, and enabling significant savings in TCO,” class data warehouse for retailers. The latest and Oracle VM Server for SPARC, Oracle says Ganesh Ramamurthy, vice president of enhancements deliver advanced analytics Optimized Solution for Oracle E-Business engineering at Oracle. “Built on the SPARC for unique retail formats including consumer Suite can deliver significant cost savings SuperCluster, our newest solution takes goods, wholesale and private label, multi- versus both new and existing hardware advantage of Oracle hardware and software channel, franchise control, and quick-serve infrastructure. engineered together to deliver the high restaurants and fine dining. “Oracle Optimized Solution for Oracle performance and availability needed for It has also been optimized for Oracle E-Business Suite delivers high-volume batch business-critical applications.” Database, Oracle Exadata Database and online transaction processing perfor- bit.ly/SYt18L Machine, and Oracle Big Data Appliance to deliver extreme scalability and performance. Oracle VM VirtualBox 4.2 Now Available “The enhancements to Oracle Retail Data Model provide deeper and broader insight Oracle VM VirtualBox 4.2, the new release of and Oracle Solaris platforms, users can install for a wider range of retailers,” says Mike Oracle’s open source virtualization software, Oracle VM VirtualBox 4.2 on their preferred Webster, senior vice president and general delivers a smarter user interface; advanced host platforms and run a huge variety of guest manager, Oracle Retail. “By taking advantage networking capabilities; and Windows 8, operating systems in virtual machines,” says of its new capabilities, retailers will have Mac OS X 10.8, and Oracle Linux 6.3 support. Wim Coekaerts, senior vice president, Linux unparalleled access to information that is “As the only free, open source virtualization and virtual engineering at Oracle. relevant, timely, and actionable.” software that supports Windows, Mac, Linux, bit.ly/R7mZGd bit.ly/PPzH8f

Your support brings hope.

Recent tornadoes have destroyed many communities and left many families in need.

You can help.

Your donation to the American Red Cross can help provide a hot meal, comforting shelter and hope when it is needed most.

Visit redcross.org or text REDCROSS to 90999 to give $10

Text REDCROSS to 90999 to make a $10 donation to the Red Cross. Charges will appear on your wireless bill, or be deducted from your prepaid balance. Msg & Data rates may apply. Reply STOP to 90999 to STOP. Reply HELP to 90999 for HELP. Full terms and privacy policy: redcross.org/m

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_briefs.indd 21 10/16/12 12:54 PM 22 NEWS By David Baum

Built for Speed Oracle unveils new releases of Oracle Exadata Database Machine and Oracle Exalogic Elastic Cloud.

ausing for waves of applause in the system for running business applications, P packed keynote hall on the first evening of offers similar boosts in functionality and Oracle OpenWorld, Oracle CEO Larry Ellison performance, thanks in part to the eight- announced a new generation of engineered core Intel Xeon E5-2600 series of proces- systems anchored by Oracle Exadata X3. sors, which are resident in the new Oracle “If you thought the old Exadata systems Exadata and Oracle Exalogic systems. The were fast, you ain’t seen nothing yet,” he said. new Exalogic platform builds on the recent One of the major performance drivers in release of Oracle’s Exalogic Elastic Cloud the Exadata Database Machine X3-2 and Software 2.0 (see “Optimized Application Exadata Database Machine X3-8 is their Performance,” page 23) to provide extreme mass memory system, which permits these performance, reliability, and scalability for engineered systems to store hundreds of Java, Oracle Fusion Middleware, Oracle terabytes of compressed user data in flash Applications, rehosted CICS/IMS TP, and and RAM memory, virtually eliminating the other business applications. performance overhead of reads and writes to Oracle Exadata and Oracle Exalogic are key disk drives. The Exadata flash components are components of Oracle’s new infrastructure- part of a memory hierarchy that includes 4 TB as-a-service cloud offering, which Ellison of dynamic random-access memory (DRAM) Oracle CEO Larry Ellison announced during the same keynote for Exadata Database Machine X3-8, 22 TB of presentation. flash cache, and 500 TB of disk storage. support simply by upgrading their Exadata “What we’re offering is OS, VM [virtual Intelligent storage optimization in Oracle Storage Server Software. “When you push machine], compute services, and storage Exadata Smart Flash Cache automatically the button and upgrade your Exadata soft- services on the fastest, most reliable, keeps all active data in flash memory and ware, you will suddenly speed up write I/Os most secure machines in the world—our RAM, while keeping less-active data on low- by someplace between a factor of 10 and a engineered systems, Exadata, Exalogic, cost disks. Exadata Smart Flash Cache now factor of 20,” Ellison estimated. SuperClusters, and Exalytics—all net- also sends write I/Os to flash in addition to With the Oracle Exadata X3, speed is worked together with a modern InfiniBand read I/Os, accelerating write performance easy. “Everything’s faster with Exadata X3, network,” Ellison concluded. “The reason by 20 times. and they consume less power,” Ellison said. we’re making these systems faster is to “As we move more and more of our “We now can do a million writes per second improve not just their peak performance, databases onto Exadata machines, those in a single rack of Exadata. You would need but to improve their cost performance. databases aren’t going to go onto disk 10,000 disk drives for that kind of write You can save a lot of money by using these drives,” he predicted. “They’re going to go capacity, or 100 racks compared to a single engineered systems, Oracle Exadata and into flash memory where the information Exadata rack.” Oracle Exalogic.”  is available instantaneously, where you can In addition to previously available Oracle ask a question and get an answer at the Exadata full-rack, half-rack, and quarter-rack David Baum is a freelance technology writer speed of thought, where the new genera- configurations, the new Oracle Exadata X3 based in Santa Barbara, California. tion of clouds delivers answers faster than eighth-rack configuration provides an entry you ever imagined was possible because of point for smaller workloads, including testing, Next Steps Oracle Exadata X3, the world’s fastest development, and disaster recovery systems. computer for business.” LEARN more about os

Faster Performance, Same Cost Oracle Exadata i d upgrade advantage Also announced at Oracle OpenWorld, oracle.com/exadata

Oracle Exalogic ann Stu

Organizations using Oracle Exadata X2 can Exalogic Elastic Cloud X3-2, the second m oracle.com/exalogic

also take advantage of the new write I/O hardware generation of Oracle’s engineered Hart

November/December 2012 Oracle.com/oraclemagazine

ND12_news_exadata.indd 22 10/17/12 10:29 AM Interview by Tom Haunert 23

Optimized Application Performance Oracle’s Exalogic Elastic Cloud Software runs applications in isolation, provides traffic metering, and delivers self-service-based infrastructure as a service.

ollowing the recent release of Oracle’s “We enable 5 to 10 times improvements that you see us FExalogic Elastic Cloud Software 2.0, Tom talk about for Oracle WebLogic Server, Oracle Haunert, editor in chief of Oracle Magazine, customers to Tuxedo, Oracle Coherence, and Oracle SOA sat down with Mohamad Afshar, vice Suite, as well as our applications such as president of product management at Oracle, have a true IaaS Oracle E-Business Suite, Oracle ATG applica- to talk about Oracle Exalogic Elastic Cloud, environment.” tions, and more. the new software release, and what’s next for Oracle Magazine: How does Oracle Exalogic Oracle Exalogic. The following is an excerpt provide optimized support for Java? from that interview. Download the full technologies spanning InfiniBand switches, Afshar: Oracle has a significant investment podcast at oracle.com/magcasts. gateways, host channel adapters, firmware, in Java and the Java community and is com- Oracle Magazine: What is the history of Oracle device drivers, operating system extensions, mitted to ensure ever-greater adoption of Java. Exalogic, what does it do, and how does it inte- and software libraries. Exabus provides an Hence we looked at how we could improve grate with other Oracle engineered systems? interoperability layer that enables any appli- response times and throughput for Java appli- Afshar: Larry Ellison launched Oracle Exalogic cation that runs on Oracle Linux on x86 to cations by leveraging the Exabus technology Elastic Cloud at Oracle OpenWorld in 2010. run on top of it with no code changes and within the Java Virtual Machine [JVM], Oracle The vision for the product was to deliver a with significantly improved performance and WebLogic Server, and Oracle Coherence. This complete infrastructure to data centers for throughput. For Oracle middleware and appli- engineering effort involved delivering capa- running their middleware and packaged cations we also built native integration with bilities such as JDBC over SDP [Sockets Direct applications. Oracle’s engineered system for Exabus to enable breakthrough performance Protocol] and RDMA [Remote Direct Memory the database tier, Oracle Exadata, was already and throughput—and that helps deliver the Access]–backed state replication. available, and the idea behind Exalogic was to Oracle Magazine: Oracle recently announced deliver a machine that would work in tandem Exalogic Elastic Cloud Software 2.0. What with Oracle Exadata to run applications and is the background behind this release, and midtier workloads. Effectively, the combina- what are the key features? tion of the two products becomes the foun- Afshar: Many of our customers have been dation for the modern data center on which running multiple Oracle applications on applications are consolidated. Oracle Exalogic—Oracle E-Business Suite, Oracle Magazine: Other Oracle engineered Siebel, Oracle ATG, and PeopleSoft, as well systems are optimized to run specific as Oracle Fusion Middleware—and they’ve installed Oracle software, but Oracle Exalogic typically been isolating applications by Elastic Cloud is optimized for the installed running one application per compute node. Oracle software and a variety of Oracle and For example, a customer running an Exalogic other applications. How is this possible? quarter rack system could dedicate two Afshar: When we started looking at building Exalogic compute nodes for Oracle ATG, two Oracle Exalogic, we looked at where the compute nodes for Oracle E-Business Suite, bottlenecks are in the midtier and the appli- and then two to four compute nodes for inte- cation tier, and we noticed that the primary gration and Oracle WebCenter components. bottleneck that hinders performance and With Exalogic Elastic Cloud Software 2.0,

throughput tends to be in the network. So we Mohamad Afshar, Vice President of Product we’ve delivered a number of capabilities that

Bo b Adler built Exabus technology, which encompasses Management, Oracle enable customers to run more applications

oracle magazine November/December 2012

ND12_Interview.indd 23 10/2/12 11:27 AM 24 Interview

on Exalogic by delivering application capable of doing everything from basic load Oracle Magazine: What’s next for Oracle isolation through virtualization. We built balancing to complex traffic shaping, traffic Exalogic? Exabus integration into the virtualization metering, and security enforcement. Afshar: We are committed to taking the layer in Exalogic Elastic Cloud Software 2.0 Oracle Magazine: How does Exalogic Elastic latest industry-standard hardware and fully to enable near native (nonvirtualized) Cloud Software 2.0 fit into Oracle’s cloud testing it within the engineered system envi- application performance, and incorporated applications and Java strategies? ronments, certifying it, and delivering it to cloud management capabilities around Afshar: If you look at Oracle Cloud, Oracle customers. And that’s exactly what we are that virtualized environment based on an has announced application services such as doing with the introduction of the Exalogic X3 infrastructure-as-a-service (IaaS) model. As Oracle Sales and Marketing Cloud Service, product series, which brings Intel’s Sandy part of this we also delivered a self-service Oracle Human Capital Management Cloud Bridge chip set to the Exalogic platform, user interface that provides full IaaS self- Service, and Oracle Social Network Cloud delivering ever-better density, performance, service capabilities for cloud users and cloud Service, in addition to Oracle Database and compute power.  administrators. With Exalogic Elastic Cloud Cloud Service and Oracle Java Cloud Service. Software 2.0, we enable customers to have Specifically in the context of Java, Oracle Java Next Steps a true IaaS environment where they can Cloud Service runs on Oracle Exalogic, and deploy a self-service model or provision for so we can deliver 100 percent portability LEARN more about different users within groups, and enable between customers’ systems and Oracle Oracle Exalogic Elastic Cloud those users to go in and spin up environ- Cloud. As far as Oracle’s Java strategy is oracle.com/exalogic ments and start running applications. concerned, you can expect to see continued Oracle’s Exalogic Elastic Cloud Software 2.0 oracle.com/us/corporate/press/1715394 Oracle Traffic Director is another important investment in optimizing Java applications on part of Exalogic Elastic Cloud Software 2.0. It Oracle Exalogic across the JVM, the virtualiza- LISTEN to the podcast oracle.com/magcasts is an integrated application delivery controller tion layer, networking, and storage.

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.

For more information on Oracle QLogic-branded HBAs, 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.

November/December 2012 Oracle.com/oraclemagazine

ND12_Interview.indd 24 10/2/12 11:28 AM #1 Middleware

#1 in Application Servers

#1 in Service-Oriented Architecture

#1 in Identity & Access Management

#1 in Enterprise Performance Management

Oracle Middleware Trusted by 100,000 Customers Worldwide

oracle.com/goto/middleware or call 1.800.ORACLE.1

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.

Untitled-4 1 10/25/12 1:03 AM

PUB NOTE: Please use center marks to align page. Print Ad Job No.: 411M_CRP_No1Mdw PRODUCTION NOTES READER LASER% RELEASED Headline: Still #1 Middleware Date: 05/26/2011 Project: Master Print Ad 5/26 Type: Magazine 01 2011 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 26 Book Beat

Oracle 11g Anti-Hacker’s Cookbook ment, testing and debugging, security, and Partners Achieve Oracle Database By Adrian Neagu getting the most out of SQL and PL/SQL. It is filled with best practices on how to best Appliance Specialization Packt use Oracle Application Express. Both new packtpub.com Two members of Oracle PartnerNetwork and experienced application developers will (OPN) have achieved OPN Specialized status benefit from Oracle APEX Best Practices. This book covers the for Oracle Database Appliance. most-important security Effective MySQL: Replication Cintra Software & Services, a Global measures as well as tips Techniques in Depth and tricks that can be used Platinum Partner and the OPN Specialized for better Oracle Database 11g security. The By Ronald Bradford and Global Partner of the Year for Oracle Database Chris Schneider author uses real-world scenarios to show you in 2011, has created a blueprinted delivery how to secure the Oracle Database server Oracle Press model for Oracle Database Appliance to fully from different perspectives and against oraclepressbooks.com different attack scenarios. Almost every leverage the appliance’s strengths. Cintra chapter has a possible threats section, which Effective MySQL: has completed hundreds of successful Oracle Replication Techniques describes the major dangers that can be Database implementations; its database confronted. The initial chapters cover how to in Depth describes what defend your operating system, network, data, is needed to understand and implement infrastructure services include design, imple- and users. The defense scenarios are linked MySQL replication to build scalable solu- mentation, and ongoing remote support of and designed to prevent these attacks. The tions. This book includes detailed syntax Oracle Database architectures. This marks examples to demonstrate the features, later chapters cover Oracle Database Vault, Cintra’s ninth specialization. Oracle Virtual Private Database, Oracle Label options, and limitations of native MySQL Security, and Oracle Audit Vault. The author replication. It provides an evaluation of new also demonstrates how to perform a security replication features and additional third- assessment against the operating system party product implementations, and helps and the database. you to ensure that your MySQL environment can support the various high-availability Oracle Business Intelligence 11g needs of your business. This guide helps you Developers Guide to master the strengths and limitations of By Mark Rittman native asynchronous replication in a MySQL topology and identify the important features Oracle Press to improve replication for growing business Mythics, an Oracle Platinum Partner, oraclepressbooks.com requirements. You will also learn how to rec- Oracle Product GSA Schedule Holder, and ognize the key business factors to determine This Oracle Press guide OPN Specialized Consulting Partner, has your optimal high-availability needs and gain explains how to build demonstrated success in selling, deploying, an understanding of the benefits of using business intelligence (BI) MySQL replication for failover scenarios. and managing Oracle Database Appliance applications using Oracle in both public sector and commercial envi- Business Intelligence 11g. It covers how to Oracle SOA Suite 11g Administrator’s ronments. An OPN member since 2000, execute effective queries, build accurate Handbook models, use scorecards and key performance Mythics provides Oracle licensing, hardware, By Ahmed Aboulnaga and indicators, create dynamic reports, set up training, and premier consulting services dashboards, and publish to smartphones and Arun Pareek across the Oracle product portfolio, and wireless devices. The author also describes Packt how to integrate BI applications with Oracle packtpub.com was the first partner to achieve specializa- Fusion Middleware security, Oracle WebLogic tion on Oracle Exadata Database Machine. Server, and Web services. Aimed at devel- This book provides Among its thousands of customers are the opers creating BI solutions using Oracle’s detailed explanations of U.S. Departments of Defense and Homeland platform, this book also covers Oracle the core administrative Exalytics In-Memory Machine, a hardware and management activities associated with Security, federal civilian agencies, intelli- appliance that combines Oracle Business Oracle SOA Suite. It includes information gence agencies, state and local governments, Intelligence and Oracle TimesTen In-Memory for end-to-end administration of Oracle and healthcare and commercial organiza- Database, for “speed of thought” analytics. SOA Suite 11g and also delves into advanced topics such as silent installs, cloning, tions worldwide. Oracle APEX Best Practices backup and recovery, and high-availability To achieve Oracle Database Appliance By Alex Nuijten, Iloon Ellen- installations. The book begins with man- Specialized status, Cintra and Mythics met aging composite applications, deploy- Wolff, and Learco Brizzi stringent requirements based on the needs ments, and lifecycles, and then moves on Packt to monitoring instances, service engines, and priorities of the customer and partner packtpub.com Oracle WebLogic Server, and composite community. Those requirements measured applications. Toward the end, the authors Oracle APEX Best Practices the companies’ technical competency and take you through identifying faults and guides you through the business results. Specialization gives Cintra exceptions, troubleshooting approaches, development of real-world and securing various components. The and Mythics access to exclusive tools and applications and gives you a broader view of book explains core concepts while providing resources to help them market and sell Oracle Application Express to help you maxi- real-world implementation specifics. mize its capabilities. The book covers setting Oracle Database Appliance. up an Oracle Application Express environ- Look for other Oracle books at bit.ly/NjG3KM. cintra.com mythics.com

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_partner.indd 26 10/1/12 3:31 PM PARTNER NEWS 27

Higher One CASHNet Achieves Validated Integration with Oracle’s RxLogix Achieves Oracle Argus PeopleSoft Campus Solutions Safety Specialization Higher One Holdings (Higher One), an Oracle mobile-friendly, met stringent requirements RxLogix, an Oracle Gold Partner, has Gold Partner, has achieved Oracle Validated based on customer needs and priorities to achieved OPN Specialized status for Oracle Integration of its CASHNet payment pro- achieve Oracle Validated Integration. Argus Safety, Oracle’s integrated platform of cessing suite 2012.2 with Oracle’s PeopleSoft Higher One offers solutions and services end-to-end pharmacovigilance solutions for Campus Solutions 9.0. With this integration, to help college busi- regulatory compliance and comprehensive colleges and universities—as well as stu- ness offices manage product stewardship. dents and their parents—can use CASHNet operations and provide RxLogix was recognized for its safety, to process any payment, anytime, anywhere, enhanced service to risk management, and regulatory global and be assured that transactions occur in students. practices in implementing Oracle Argus real time. Higher One CASHNet, which is higherone.com Safety at major life sciences organizations. Specialization also acknowledges the com- Kewill Flagship Achieves Validated Integration with Oracle’s pany’s ability to complement those practices with value-added strategic software solu- JD Edwards EnterpriseOne tions. RxLogix, with a global staff of more Oracle Gold Partner Kewill, a provider of JD Edwards EnterpriseOne 9.0 to 9.1 for than 70 employees, has completed more shipping solutions for global trade and Flagship users. than 50 implementations of Oracle Argus logistics, has achieved Oracle Validated Kewill Flagship is a multicarrier shipping Safety from its offices in the United States, Integration of Kewill Flagship with Oracle’s management system for moderate and high- Europe, and Japan. JD Edwards EnterpriseOne 9.0 and 9.1. By volume shipping operations and complex rxlogix.com achieving validated integration with two ver- distribution environments. It is available in sions of JD Edwards EnterpriseOne, Kewill on-premises and hosted models. Peloton Tests Oracle Exalytics, has enabled an easy upgrade path from kewill.com Launches Oracle Exalytics Practice Leeyo Software and SKG are Oracle Ready Oracle Platinum Partner Peloton, a U.S.- Two Oracle partners have achieved Oracle Oracle Gold Partner SKG S.A. has achieved based professional services firm specializing Ready status across multiple product lines Oracle Database Ready, Oracle WebLogic in analytics and enterprise performance through Oracle PartnerNetwork and the Ready, Oracle Solaris Ready, Oracle Linux management, has installed Oracle Exalytics Oracle Exastack Ready program. Ready, and Oracle VM Ready status for SKG in its data center and tested the in-memory Leeyo Software, a provider of software eSAMBO 1.0. This achievement demon- analytics platform on the roll-up of an for revenue recognition automation and strates that eSAMBO 1.0 is fully tested and Oracle Hyperion Planning application, using management, has achieved Oracle Database supported on Oracle Database 11g Release 2, actual financial performance data for a Ready, Oracle WebLogic Ready, and Oracle Oracle WebLogic Server, Oracle Solaris 11, multibillion-dollar company with multiple Linux Ready status for RevPro 2.0. This Oracle Linux, and Oracle VM 3.0. business units. The process, which usually achievement demonstrates that Oracle Gold eSAMBO is a modern, centralized retail takes more than five hours to complete, Partner Leeyo’s RevPro 2.0 is fully tested and chain management system. It manages was finished in less than two hours—a 274 supported on Oracle Database 11g Release 2, heterogeneous, sophisticated retail chains percent reduction in processing time com- Oracle WebLogic Server, and Oracle Linux. from a central system instance. All data can pared to the baseline solution (a Microsoft RevPro automates and manages every be managed from the system owner’s central Hyper-V virtualized server running release process in an organization’s revenue cycle. It level, system owner’s chain stores, fran- 11.1.2.1 of Oracle’s enterprise performance integrates with the quote-to-cash processes chisee subchain level, and franchisee stores. management products on Windows 2008 of any enterprise resource planning system, Oracle Database Ready, Oracle WebLogic R2 SP1 64 bit, with 4 virtual processors and eliminating time-consuming and error- Ready, Oracle Solaris Ready, Oracle Linux 4 GB of RAM; details at bit.ly/OFpx9z). prone manual systems. RevPro can simplify Ready, and Oracle VM Ready are part of the Peloton has launched an Oracle Exalytics revenue and cost-of-goods-sold manage- Oracle Exastack Ready program, which rec- program that supports organizations with ment, monitor revenue-related activities in ognizes partners for developing, testing, and complex analytical processing needs— real time, and accelerate tuning their applications on the latest com- ranging from early-stage evaluation through period-end close and ponent products of Oracle Exadata Database implementation. Peloton serves organiza- financial reporting Machine and Oracle Exalogic Elastic Cloud tions in the aerospace and defense, financial, cycles. RevPro can be engineered systems. healthcare, high technology, life sciences, deployed on premises or leeyo.com manufacturing, and not-for-profit sectors.

I-HUA CHEN I-HUA in the cloud. skg.pl/english/skg_products.aspx pelotongroup.com

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_partner.indd 27 10/1/12 3:32 PM 28 Community Bulletin News, People, and Happenings in Oracle Technology Network

PODCAST Oracle Solaris “The Role of the Cloud Architect” 11 Services What does cloud mean to IT architects? Cloud computing continues to drive the evolution of IT architecture, and IT architects who want to Administration remain relevant need to up their game. In this Oracle Technology Network Does taming ArchBeat podcast, cloud architects Ron Batra and Dr. James Baty discuss the behavior what architects need to do to take their talents into the cloud. bit.ly/Socws4 of your operat- ing systems services manu- ally make you want to run for the hills? Help is here. The Service Management Facility feature, introduced in Oracle Solaris 10 and extended in Oracle Solaris 11, provides the discipline those unruly services need. In his two-article series, Oracle Solaris Principal Product Manager Glynn Foster helps you get the most out of the Service Management Facility. First, in “Introducing the Basics of the Service Management Facility in Oracle Solaris 11,” Foster explains what the Service Management Facility does and how to perform Sangam Brings Oracle and Java Users Together basic services administration with it, including how to use four specific How are Oracle database, middleware, and applications users and Java developers commands to get information about collaborating in your community? In Bangalore, India, they are gathering under one and manage your system services. roof at the All India Oracle Users Group’s (AIOUG) fourth annual Sangam conference, Then, in “Advanced Administration November 2–3, 2012. Oracle ACE Director and AIOUG President Murali Vallath with the Service Management organized the event, which is cohosted by the India Oracle Applications Users Group Facility in Oracle Solaris 11,” he describes how to use some of the and JUG (Java user group) Chennai. The largest independent Oracle user event in more advanced features—including India, Sangam features more than 70 speakers from all over the world, provides service bundles, which you can use to 120-plus sessions, and attracts more than 600 delegates. sangam12.info deliver custom configuration across systems. bit.ly/Q80KN7 Virtual Developer Day Have you started looking at how Oracle Fusion will affect JVM LANGUAGE your own development projects? Jumpstart your educa- tion in Oracle Fusion development with this on-demand SUMMIT 2012 Virtual Developer Day that covers Oracle Application Are you a language designer, compiler Development Framework (Oracle ADF), Oracle WebCenter Portal, Oracle Business Process Management, writer, tool builder, runtime engineer, or Oracle Business Intelligence, and more. Tracks include VM architect? Did you miss the 2012 Introduction to Fusion Development and What’s New in JVM Language Summit? The 2012 JVM Fusion Development. Session topics range from Oracle Language Summit was held at Oracle’s Business Intelligence and Oracle ADF integration to Santa Clara, California, campus July 30– a comparison of Oracle ADF to Oracle Forms, Oracle August 1. If you missed it, or maybe you Application Express, and Microsoft .NET. Hands-on lab documentation that shows you how to develop rich Web were there and want to revisit it, videos applications with Oracle ADF and Oracle WebCenter and presentations are available at

Portal is also available. bit.ly/TtdcKp bit.ly/Or8AAR FONTAINE DUKE ILLUSTRATION/DAVE IMAGES; DINODIA PHOTOS/GETTY

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_Community.indd 28 10/1/12 3:45 PM Architect By Bob Rhubart 29

Architects Matter Making sense of the people who make sense of enterprise IT

hy do architects matter? Oracle “Architecture connection and interdependencies between WEnterprise Architect Eric Stephens sug- disparate systems is another key value gests that you ask yourself this question the matters because it proposition for architects, and that value is next time you take the elevator to the Oracle increasing in the evolving IT landscape. offices on the 45th floor of the Willis Tower in optimizes the use of “When software could work in silos, Chicago, Illinois (or any other skyscraper, for resources in order to architects weren’t overly useful,” says that matter). If you had to take the stairs to Derek Sharpe, director of the Oracle Fusion get to those offices, who would you blame? achieve the most- Middleware A-Team (that’s A for architec- “You get the picture,” he says. “Architecture important qualities ture). But times have changed. “In today’s is essential for any necessarily complex struc- world, business users expect their systems to ture, be it a building or an enterprise.” in each IT system.” communicate with each other, share infor- Complexity in enterprise IT is unavoid- –Manuel Ricca, IT Architect mation, and be highly available.” able—to a point. “You need a role to manage A good architect knows how the pieces out the unnecessary complexity and prevent fit together and can turn that informa- architectural entropy from taking hold,” he says. “The business should recognize the tion into a cohesive strategy that spans a Stephens says. “I’ve seen a number of com- architect as an enabler.” company’s IT infrastructure and forms the panies with little to no architectural presence, Development teams need to see the design basis for a reliable platform that and it shows. The duplication of IT assets, as architect in a similarly positive light. “The satisfies IT and business stakeholders. “But well as inefficient and often ossifying integra- architect is also the guide, coach, and spar- most importantly,” Sharpe says, “the tion between systems, leads to the business’s ring partner for the development team, and architect is management’s technical com- inability to respond to change.” perhaps the administrators as well,” Jellema municator, someone who can articulate to Stephens’ colleague Pat Shepherd, also an says. “The architect will instruct and monitor both the development teams and the busi- Oracle enterprise architect, shares a similar the development team in how they design ness what is necessary to meet current and opinion. “Enterprise architects matter and implement the software artifacts and future requirements.” because history has demonstrated that how they make use of the various tiers of To put it another way, if the elevators project-based IT development does not lead underlying infrastructure.” don’t work, nothing works.  to reuse, consolidation, or any of the econo- That focus on efficient, intelligent use mies of scale that come from enterprise of resources is key to defining the archi- Bob Rhubart architecture,” he says. “Enterprise architec- tect’s value. (bob.rhubart@oracle ture is the only real hope an organization has “Architecture matters because it optimizes .com) is manager of the for delivering IT as a strategic asset.” the use of resources in order to achieve the architect community That awesome responsibility filters down- most-important qualities in each IT system,“ on Oracle Technology ward from the enterprise level to the level of says Manuel Ricca, an IT architect with a large Network, the host of the the solution or IT architect. European financial institution. Ricca points Oracle Technology Network ArchBeat podcast “Architects provide the counterweight out that stakeholders in security, operations, series, and the author of the ArchBeat blog to the business,” says Oracle ACE Director and finance and even the CEO may not see (blogs.oracle.com/archbeat). Lucas Jellema, CTO at AMIS Services. It’s a beyond their respective concerns. It’s the matter of achieving balance between the architect’s job to relieve them of their tunnel Next Steps interests of business and IT stakeholders. vision. “The architect is responsible for getting According to Jellema, the IT architect’s focus agreement on the relative priorities of those is on preparing the IT environment to meet different concerns, and for designing the LISTEN to ArchBeat podcasts bit.ly/9X6j2T key business demands. “Therefore the busi- system structures that allow the organization GET more architect information ness should not regard architects as oppo- to achieve the desired qualities,” says Ricca. oracle.com/technetwork/architect nents, the frustrators of new developments,” The ability to see and understand the inter-

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

oracle magazine November/December 2012

ND12_architect.indd 29 10/1/12 3:57 PM 30 Up Close By Jeff Erickson

A Path to Leadership New ODTUG program grooms leaders for user group success.

onty Latiolais’ first attempts to get leadership skills, communication skills, Minvolved with his Oracle user group ethics training, and mentoring skills.” came up dry. Latiolais is the president of Another benefit to employers, says Oracle Development Tools User Group Latiolais, is connections. “My company is (ODTUG) but recalls a time when his gaining visibility in the IT community because submissions to the user group’s events were of my involvement in ODTUG,” he says. rejected and his bid for a committee seat With 25,000 members worldwide and flopped. “The user group meant a lot to me, growing, ODTUG is the model of a suc- and I wanted to get more involved,” he says. cessful user group. The group has opened “But I couldn’t find a way to get over the up to new and acquired Oracle technologies, hurdle.” Now that he’s president, he wants and blends an ethic of service with hard- to give enthusiastic ODTUG members a more nosed technical content delivery. “ODTUG’s direct path to leadership. In June 2012 he success thus far has been the result of out- announced the ODTUG Leadership Program standing leaders,” says Latiolais. He credits to do just that. former president Mike Riley and former The six-month program will run January executive director Kathleen McCasland with through June 2013, culminating at ODTUG’s leaving him a strong community to lead. Kscope13 conference in New Orleans, ODTUG President Monty Latiolais “The real challenge is to continue what these Louisiana, June 23–27. It will cover a range outstanding leaders have done up to this of leadership topics including effective com- people I considered rock stars at the time and point,” he says. munication, mentoring, ethics, goal setting, found that they were very willing to engage Latiolais believes the emphasis on service and accountability. Training will consist me and encouraged me to get involved.” is a key to the group’s success. “ODTUG is of a series of classes and conference calls Thus began Latiolais’ journey to leadership. all about giving back,” he says. The ODTUG with the current executive committee. The He was appointed to ODTUG’s conference Leadership Program will be, Latiolais hopes, program is limited to a small group of par- committee in 2009 and then campaigned another way to serve the Oracle commu- ticipants, because each one will be assigned unsuccessfully for the ODTUG board of direc- nity. “We give employers an employee with an ODTUG board member as a mentor and tors. He ran again the following year and suc- new skills and confidence,” he says. “For will receive a complimentary pass to ODTUG ceeded. In 2011 he was elected to the execu- members with a sincere desire to give back Kscope13 upon graduation. tive committee as vice president. At ODTUG to the community, we provide a path from The program is designed to give ODTUG Kscope12 he was elevated to president. “It’s the audience to the podium.”  a new group of trained leaders, and gives gratifying to have a goal and work your way participants visibility when it comes to filling up and achieve that goal,” says Latiolais. Jeff Erickson committee positions and other leadership “Professionally it’s done wonders for me in (jeffrey.x.erickson@ opportunities, says Latiolais. “This is a way the workplace.” oracle.com) is a senior for members to, in a sense, raise their hands Latiolais attributes promotions and editor with Oracle and say, ‘Pick me, pick me!’” he says. new leadership positions at work to skills Publishing. Latiolais has been saying, “Pick me!” since he gained from his ODTUG experience. He 2008, when he made the decision to pursue wants to give a new crop of leaders the same speaking and leadership roles in the user opportunity. “If ODTUG can better equip Next Steps group. “I started out as an audience member a member to become a leader in his or her who put speakers on a pedestal,” Latiolais workplace, that’s real value,” says Latiolais. LEARN more about ODTUG says. “Later I learned that they are just people “The employer benefits because they have odtug.com well o who know something about the technology someone who is better equipped and more WATCH the interview l S. H l S.

oracle.com/oramag/upclose u

that they want to share. I approached the confident. They now have a person with Pa

November/December 2012 Oracle.com/oraclemagazine

ND12_UpClose.indd 30 10/1/12 4:09 PM Peer-To-Peer by Blair Campbell 31

Tech Destiny The power of MySQL, life choices, and staying engaged with Oracle Database

Wagner Bianchi Emre Baransel Jeff Jacobs

Company: WBConsulting, an IT consulting firm Company: Turkcell, a communications and Company: PayPal, a global online payment Job title/description: Senior principal technology company company consultant, running all processes involving Job title/description: Oracle DBA, responsible Job title/description: Senior data architect, MySQL technologies for managing the standby databases in Turkcell’s modeling, designing, and troubleshooting site Location: Belo Horizonte, Brazil IT environment databases Oracle credentials: Oracle Certified Associate Location: Ankara, Turkey Location: San Jose, California (MySQL 5, MySQL 5.1, MySQL 5.5), Oracle Oracle credentials: Oracle Certified Length of time using Oracle products: Certified Professional (MySQL 5 Developer, Professional (Oracle Database 10g), with seven More than 20 years MySQL 5 Database Administrator), and Oracle years of experience using Oracle products Certified Expert (MySQL 5.1 Cluster Database Administrator), with nine years of experience What’s your favorite tool on the job? Quest using Oracle products How did you get started in IT? When I was 14, Software’s Toad for Oracle is still one of I passed the very competitive entrance exam my favorite tools, and I also find reports What are your favorite tools on the for my high school, and my dad decided to generated by the Automatic Workload job? MySQL Enterprise Backup, MySQL give me a reward. He asked me if I wanted a Repository feature of Oracle Enterprise Workbench, and the Enterprise Monitor computer or a pair of skis—I guess I made Manager incredibly useful. Most of my feature of MySQL Enterprise Edition. Those my life’s choice when I chose the computer. performance work is after the fact, and it tools have made it possible to have all MySQL How are you using social media in your work most often involves correcting application areas under control with no necessity to these days? I generally use it to keep myself issues. Automatic Workload Repository access mysqld through the command line. up to date and share valuable information reports provide the necessary data to identify What technologies have most changed about Oracle technologies. I mostly use the cause of performance issues. your life? MySQL and Linux. MySQL was Twitter to get and share Oracle-related What technology has most changed your my passport to many of the companies I’ve information, but I do use Facebook and life? Definitely Oracle Database. It has not worked with. The software gave me great LinkedIn for information sharing inside our only provided me a technology that I enjoy perspective and opened my mind to many local Oracle user group, TROUG [Turkish and find constantly engaging but has also other things about database servers. It led Oracle User Group, troug.org]. There are also given me a wide variety of opportunities to me to start studying Linux, which showed some personal Oracle blogs, OTN forums, engage in user group activities, conferences, me how to monitor services and configure and Oracle mail groups that I follow. presentations, and writing. I am honored them for greater performance. What would you like to see Oracle, as a to serve on the board of directors of the How are you using MySQL and cloud company, do more of? I’d like to see Oracle Independent Oracle Users Group Exadata computing? Some time ago we developed a with products in end-user technology. special interest group, and privileged system in which MySQL was running in the Oracle is a company that always changes the to have served on the ODTUG board of cloud to support our company systems. This standards and achieves the best. It would be directors for 15 years. was an important advance, and it has held great to use Oracle smartphones or Oracle What’s your go-to Oracle reference book? an important place in our architecture plans. computers with Oracle operating systems. My favorite authors are Tom Kyte, Jonathan MySQL is easy to use, easy to configure, and What is your favorite thing to do outside of Lewis, Richard Niemiec, and Steven easy to drive into the cloud. There is a great work? I enjoy exercising and spending time Feuerstein. I still prefer real books that I can opportunity for MySQL to dominate this field. with my family. mark, flag, and read in an easy chair. 

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

oracle magazine November/december 2012

ND12_peer.indd 31 10/1/12 4:22 PM Oracle CEO Larry Ellison Oracle President Safra Catz discussed Oracle’s shared views on business comprehensive cloud strategy and vision at offerings in one of two the Executive Edge featured keynotes. @ OpenWorld event.

More than 50,000 attendees participated in seven events Oracle President Mark Hurd appeared live from across Oracle’s unprecedented Oracle OpenWorld on CNBC’s Closing Bell with week of conferences. host Maria Bartiromo.

November/December 2012 Oracle.com/oraclemagazine

ND12_ConferenceWrapUp_R1.indd 32 10/23/12 4:27 PM 33 By Karen Shamban

rom September 29 through October 5, 2012, Oracle’s week of ENGINEERED TO Fconferences in San Francisco, California, brought together a wide range of attendees interested and invested in Oracle technologies, announcements, and expertise. In addition to the long-standing flagship conferences Oracle OpenWorld and JavaOne, new this year were conferences focused on customer experience (Oracle Customer Educate, Experience Summit @ OpenWorld), partners (Oracle PartnerNetwork Exchange @ OpenWorld), MySQL (MySQL Connect), C-level and line- of-business executives (the Executive Edge @ OpenWorld), and Java embedded technology (Java Embedded @ JavaOne). Explore, With this diverse content offering, the numbers were impressive. More than 50,000 people from 144 countries attended. More than 3,500 speakers conducted presentations and workshops over seven days. More than 700 exhibits and demos from Oracle and its part- Engage ners filled four exhibition halls. Of course, not everyone could attend 2012’s Oracle OpenWorld and JavaOne in person, but between live-streaming and on-demand video, there were more than 1 million views on oracle.com and YouTube (youtube conferences brought technologists to .com/oracle), virtually increasing attendance by 20 times. Press and customers—including attendees from 100 percent of

t u dios San Francisco for a week of learning, the Fortune 500—were eager to hear the latest announcements networking, and looking forward. from Oracle, and Oracle did not disappoint. Significant technology ma nn S H a rt

The thousands of conference sessions required the use of all of San Francisco’s , plus the conference space of 10 hotels, and numerous other venues.

oracle magazine November/December 2012

ND12_ConferenceWrapUp.indd 33 10/16/12 2:57 PM 34

announcements included Oracle Exadata X3, a lightning-fast database in-memory machine; Oracle Solaris 11.1, which is optimized for cloud com- puting deployments; Oracle’s social relationship management solutions, designed to take advantage of big data to help create improved experiences for customers; and expanded Oracle Cloud services. Oracle conferences are known for creating unique opportunities for networking and community building, and this year was no exception. Not only did tens of thousands attend the renowned Oracle Appreciation Event on Treasure Island featuring Pearl Jam and , but the Oracle OpenWorld Musical Festival—new this year—brought 30 performers (including Grammy winners Joss Stone and Macy Gray) to multiple venues for five nights of rock, blues, ska, and alt-country. Other notable happenings included a conversation with Moneyball author Michael Lewis—and the conferences captured national attention at very close range when the set of CNBC’s Closing Bell moved to Moscone Center for two days, where host Maria Bartiromo conducted live interviews with Oracle CEO Larry Ellison and Oracle President Mark Hurd. From the opening keynote and Welcome Reception to the final It’s a Wrap! celebration, there was much to see, do, and learn at Oracle’s week of conferences. Mark your calendar: next year’s events run September 22 Oracle introduced its through 26.  next-generation Oracle Exadata X3 systems. Karen Shamban is a senior director of communications and editorial at Oracle and has run dozens of events during her corporate career.

Attendees flocked to four exhibition halls, which featured more than 700 exhibits and Oracle demos.

November/December 2012 Oracle.com/oraclemagazine

ND12_ConferenceWrapUp_R1.indd 34 10/23/12 4:31 PM Oracle tented two streets—Howard and Taylor—to accommodate attendee 35 meals, meetups, and lounging.

Java creator James Gosling made a surprise appearance at the JavaOne community keynote to talk about Liquid Robotics’ Wave Glider.

Networking is always an attraction at the conferences, and attendees had numerous formal and informal opportunities, such as the Oracle OpenWorld Welcome Reception, throughout the week to do just that.

Oracle Executive Vice President Joss Stone was one of 30 performers Thomas Kurian’s keynote focused at the debut Oracle OpenWorld Music on how Oracle’s cloud platform Festival, which gave attendees the chance and application services are to get their groove on after sessions. transforming business.

oracle magazine November/December 2012

ND12_ConferenceWrapUp_R1.indd 35 10/23/12 4:31 PM ND12_AppsOnExadata.indd 36 10/15/12 3:27 PM 37

BY DAVID A. KELLY

CONSOLIDATE BUSINESS APPLICATIONS, LOWER IT COSTS, BOOST PERFORMANCE, AND SUCCEED WITH ORACLE EXADATA. Consolidation may not be the first word that comes to mind when you think of strategies for managing business growth, but when business growth means that your current business applications platform can no longer support your business, consolidation is certainly worth consideration. Rather than adding separate hardware and soft- ware—configuring, testing, reconfiguring, retesting, and reconfiguring and retesting again to update a business applications platform—organizations are transforming their business technology as they are transforming their businesses. By consolidating business applications with Oracle Exadata, they are simplifying their information technology; lowering costs; and improving system performance, scal- ability, and reliability as part of that transformation.

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_AppsOnExadata.indd 37 10/15/12 3:27 PM 38

Industrial Transformation is supported by four Oracle Exadata machines: two Exadata Database Praxair is one company that’s deriving extreme value from the com- Machine X2-8 Full Racks for production and disaster recovery, an bination of Oracle Applications and Oracle Exadata. Exadata Database Machine X2-2 Half Rack for development, and an With more than 26,000 employees in 50 countries, the Fortune Exadata Database Machine X2-2 Quarter Rack for testing. All of the 300 company, located in Danbury, Connecticut, is one of the largest company’s global environments are being deployed on those four industrial gases companies in the world and the largest in North and racks of Oracle Exadata. South America. The company has grown from about US$7.5 billion in “We’ve had a pretty aggressive data center consolidation strategy 2005 to US$11 billion in 2011. over the past couple of years,” says Praxair CIO Marc Franciosa. “But Key factors in Praxair’s growth have been its use of shared services the transition to JD Edwards [EnterpriseOne] running on Oracle and the global replication of best practices. The organization has stan- Exadata has definitely saved us significant time and money.” dardized on a globally consistent Oracle’s JD Edwards EnterpriseOne Deploying Oracle Applications on Oracle Exadata has also changed enterprise resource planning (ERP) platform supported by an Oracle the way that Praxair does business. With its previous system, scaling Exadata technology stack running in its global data center. out or up required more infrastructure, with a high-speed switching Although the company has different business units around the fabric, and more systems engineering as the system grew. world, it has deployed a standardized JD Edwards EnterpriseOne “Our Oracle Exadata deployment has removed this added configuration across them. Previously, Praxair had deployed an older burden,” says Franciosa. “With Oracle Exadata, we can spend our JD Edwards EnterpriseOne footprint, set largely on top of a Microsoft time understanding the business processes and on parts of the solu- technology stack. Now, the JD Edwards EnterpriseOne ERP platform tion where we need to integrate other systems.” In addition to its transactional systems, Praxair is consolidating its data warehouse on Oracle Exalytics and Oracle Exadata. “With Oracle Exadata, we can “There are definitely inherent benefits to bringing our trans- spend our time understanding actional systems and data warehouse systems together on Oracle Exalytics and Oracle Exadata,” says Franciosa. “Having real-time and the business processes.” near-real-time access to every type of operational report we need —Marc Franciosa, CIO, Praxair enables us to efficiently drive production, distribution, and route planning processes.” A few years ago, when Franciosa looked around Praxair’s IT environment, he saw an IT group that was supporting every country with its own set of servers and applications. “We had no way to scale our IT environment to meet the types of business changes we wanted to make,” says Franciosa. “Even if we moved everything into a global data center, we would have ended up with a lot of capacity that was significantly underutilized.” At full deployment, Franciosa expects to have about 13,000 employees using the JD Edwards EnterpriseOne and Oracle

snapshot Praxair praxair.com Location: Danbury, Connecticut Industry: Industrial gases Size: US$11 billion in 2011 Oracle products: JD Edwards EnterpriseOne applications, Oracle Hyperion Financial g es Management, Oracle Hyperion Planning, Oracle E-Business Suite process manufacturing applications, Oracle Product Information Management, Oracle Business Intelligence As part of an aggressive data center consolidation strategy, Praxair’s transition to JD Edwards EnterpriseOne solutions, Oracle Exadata, Oracle Database

running on Oracle Exadata saved both time and money, says Marc Franciosa, CIO at Praxair. I ma Lane/Getty Christopher

November/December 2012 Oracle.com/oraclemagazine

ND12_AppsOnExadata_R1.indd 38 10/23/12 1:41 PM 39

snapshot Alliance Data alliancedata.com Location: Plano, Texas Industry: Loyalty marketing solutions, consulting, and programs Size: US$3 billion in 2011 Oracle products: PeopleSoft financials and human resources applications, Oracle E-Business Suite, Oracle Essbase, Oracle Enterprise Manager, Oracle Real Application Clusters, Oracle Exadata, Oracle WebCenter, Oracle Data Warehouse, Oracle Database

Exadata system, with an additional 6,000 to 10,000 using it indirectly. For example, the drivers in the company’s trucks are con- nected through onboard computers that interface indirectly into the JD Edwards EnterpriseOne environment so Praxair can calculate things such as the cost of the sale and the cost of the trip. As drivers scan cylinders at customer sites, the data goes into a tracking system and then straight into Running Oracle Applications on Oracle Exadata enables Alliance Data to deliver additional IT capacity and keep JD Edwards EnterpriseOne. “Almost every up with increased application needs, says Collin Harrison, vice president of finance and IT at Alliance Data. Praxair employee will touch these systems at some point,” notes Franciosa. “Running applications on Oracle Praxair made the transition in steps. Initially, it simply moved a lot of its legacy environments to a more complete Oracle technology Exadata saves us significant stack. But Praxair didn’t focus just on migration: the company made business transformation the goal. “The real opportunity for us as we productivity costs.” move to a global environment and deploy the shared services around —Collin Harrison, Vice President of Finance and IT, Alliance Data the world is that ability to enable some pretty big business transfor- mations, which will give us even more benefits,” says Franciosa. ships with their best customers. Praxair was an early adopter of Oracle Exadata, and its deployment Alliance Data’s corporate IT department runs an enterprise has been successful. “I don’t think we would have done anything dif- stack of applications that are used at the company’s corporate ferently, because so far we’ve had a very smooth experience,” he says. office as well as by many of its 9,000 associates across North America, at Alliance Data Retail Services, Epsilon, and LoyaltyOne. Adventures in Growth The applications stack is based on Oracle solutions that include Keeping up with growth is a big part of the business transformation Oracle’s PeopleSoft financials and human resources applications process, and it has been a big part of business and technology at as well as Oracle Hyperion Planning for forecasting, budgets, and Alliance Data. models; Oracle WebCenter for the corporate portal; and Oracle Data “As our company continues in high-growth mode, we have to Warehouse and Oracle Business Intelligence analytics solutions. make sure we can deliver additional IT capacity and keep up with In 2011, Alliance Data chose to upgrade its existing servers to increased application needs,” says Collin Harrison, vice president of support the company’s growth—nearly 23 percent over the last finance and IT at Alliance Data. “Running our Oracle Applications on three years. The company’s IT team investigated several alterna- Oracle Exadata enables us to do that. The platform is tried and true, tives, including combinations of distributed systems. However, thoroughly tested, and stable.” analysis showed that under traditional approaches, Alliance Data’s Based in Plano, Texas, Alliance Data is a US$3 billion business- data center footprint would continue to grow too rapidly, resulting in to-business company. It operates three independent, high-growth, higher overhead as well as upfront capital expenditures. high-performance Fortune 1000–size companies—Alliance Data Instead, Alliance Data decided to support its applications with Retail Services, Epsilon, and LoyaltyOne—that specialize in loyalty Oracle Exadata. By running its Oracle Applications with Oracle marketing solutions. Across each of the businesses, Alliance Data’s Exadata, the corporate IT team found they could dramatically reduce

Paul S. Howell S. Paul services enable its clients to create deeper and longer-term relation- the amount of hardware they would have to deploy. The solution also

oracle magazine November/December 2012

ND12_AppsOnExadata.indd 39 10/15/12 3:28 PM 40

“When we scope out a new project using applications running with Oracle Exadata, we’re already three to four weeks ahead of where we used to be with our old approach.” —Collin Harrison, Vice President of Finance and IT, Alliance Data

increased flexibility and reliability, while reducing the data center saves us significant productivity costs,” says Harrison. “Our devel- footprint. The company soon migrated its PeopleSoft and Oracle opment refreshes can be ready over a lunch hour now, instead of WebCenter systems to Oracle Exadata. taking overnight.” “Our time to uptime with our first Oracle Exadata Database Machine But that’s not all. “Just the simple fact that everything runs faster was substantially quicker than we had planned because so much of allows us to schedule more intelligently—based on business needs, the solution was pre-engineered and preconfigured,” says Harrison. not on IT limitations,” says Harrison. For example, the company “We had an Oracle database up and running in a very short period of previously had to balance scheduling some operations to avoid time—compared to weeks of time with other solutions—and we could the company’s month-end close process or other periods where immediately get to the process of installing our applications on it.” workload exceeded normal capacity. By running Oracle Applications Ultimately, Alliance Data consolidated seven database servers onto with Oracle Exadata, Alliance Data now is able to schedule system two Oracle Exadata quarter racks, one for development and one for updates and new application rollouts based on business need. production. Many of the company’s employees took notice. “Things Running applications at Alliance Data with Oracle Exadata, Harrison that used to have a little bit of a delay are now much faster,” Harrison has also noticed other benefits. “Things are not only running faster, says. “For the first few weeks, we received a surprising amount of user but they’re breaking down less. That means less troubleshooting time, feedback, all noting how fast the system was responding.” fewer all-hands-on-deck incidents, and more stability.” Harrison also appreciates Oracle Exadata’s ability to stay ahead Just as important, with applications running with Oracle Exadata, of the company’s continued growth. And while increased speed, Alliance Data’s corporate developers and other IT teams can remain reduced complexity, and a solid growth path are compelling benefits focused on their strategic goals, such as adding new capabilities to from Alliance Data’s move to Oracle Exadata, the company is also support the company’s continued growth, and providing the highest excited about greater efficiencies as a result of running its applica- levels of service and support. tions on Oracle Exadata. “When we scope out a new project using applications running For example, the move to Oracle Exadata delivered increased with Oracle Exadata, we’re already three to four weeks ahead developer efficiency that reduces the time it takes to deploy updates of where we used to be with our old approach,” says Harrison. and new applications. “Running applications on Oracle Exadata “Previously, new applications required new hardware, which typically took three to four weeks to requisition, configure, deploy, and test.” Oracle Exadata in the Cloud Enabling business transformation requires an agile IT infrastruc- ture—one in which an organization’s hardware and software work For many organizations, a good tion,” says Guru Shashikumar, place to start consolidating and director of product management together to enable rapid business change. Alliance Data has achieved creating a highly scalable Oracle for Oracle Cloud Services at Oracle. that with its combination of Oracle Applications and Oracle Exadata. Exadata–based global IT environ- For Shashikumar, consolidating “One of the big benefits we’ve seen from running Oracle ment is with Oracle Managed systems isn’t just about removing Cloud Services. things. It’s also about enabling Applications with Oracle Exadata is that it’s much closer to plug- Oracle Managed Cloud new opportunities. “The ultimate and-play,” says Harrison. “The Oracle hardware and software are Services offers comprehensive benefit of Oracle Managed Cloud engineered to work better together, especially when it comes to end-to-end services across appli- Services for Oracle Applications cations and technology including a and Oracle Exadata is to acceler- running PeopleSoft and many other Oracle Applications with broad range of preconfigured, pre- ate business transformation and Oracle Exadata.”  integrated, and pretested certified maximize the value of the trans- configurations of Oracle products, formation with faster uptake of David A. Kelly (davidakelly.com) is a business, technology, and travel making it easier to deploy and the latest Oracle technologies and manage Oracle technologies such lower, more predictable costs,” writer who lives in West Newton, Massachusetts. as Oracle Applications and says Shashikumar. “Oracle Exadata Oracle Exadata. enables organizations to consoli- Next Steps “If an organization wants to date legacy systems and rational- deploy Oracle E-Business Suite ize a legacy infrastructure into a or Oracle’s PeopleSoft on Oracle very high-performing engineered LEARN more about Exadata, Oracle Managed Cloud system, with integrated hardware Oracle Exadata Services provide an integrated and software designed to deliver oracle.com/exadata ‘apps-to-disk’ management optimal performance for online bit.ly/VG2lj1 framework for deployment in the transaction processing and data Oracle Cloud cloud or at the customer’s loca- warehousing applications.” cloud.oracle.com

November/December 2012 Oracle.com/oraclemagazine

ND12_AppsOnExadata.indd 40 10/15/12 3:29 PM Java Developer ORACLE ADF BY FRANK NIMPHIUS 41

ORACLE APPLICATION DEVELOPMENT FRAMEWORK AND ORACLE JDEVELOPER Master and Commander Implement a reusable command pattern template strategy using contextual events for unlimited parent-to-region interaction.

n Oracle Application Development Oracle ADF Regions, page templates, and the In Oracle ADF, the invoker object is A Framework (Oracle ADF) region is an Oracle ADF binding layer. replaced by contextual events. They take a aspect of the Oracle ADF Controller that exe- payload (command object) defined by the cutes bounded task flows in defined layout THE PROBLEM STATEMENT client and broadcast it as an event to regis- areas within a view, page, or page fragment, The use case for this article is comparable to tered listeners (receiver). The event receiver without forcing a refresh of the entire view. a universal remote control that, independent does not execute commands directly; Think portlets and you have the right idea. of the receiving device, always issues the instead, it further dispatches the execution There are many ways to establish commu- same set of commands. to a managed bean loosely coupled with nication between a view and a bounded task Using this analogy, the receiving device in the current view. For example, in Figure 1, flow exposed in an Oracle ADF Region. These Oracle ADF is the current view displayed in Action 1 and Action 2 are managed beans Oracle ADF Region interaction strategies an Oracle ADF Region. The remote control in whose roles are to interpret incoming action include contextual events, data exchange via this scenario is a toolbar or menu bar, in the requests and to execute the appropriate input parameters, managed bean injection, parent view, that sends commands into the methods for the view. shared Oracle ADF data control, and many Oracle ADF Region to process in the context of Figure 1 shows a simplified architecture others. Developers should choose an interac- the current view. The commands passed from of the command pattern, as implemented tion strategy that best suits the use case they the parent view to the region continue working with Oracle ADF. In this architecture, the want to implement. even when the current view changes due to buttons in the parent view represent the One common Oracle ADF Region use users navigating within the task flows. The command pattern client. When a button case that frequently appears on the Oracle interpretation of a given command, however, is pressed, it creates a payload object Technology Network Oracle JDeveloper may be different; it is up to each receiving (command object) that includes the name forum is a global toolbar or menu bar within region to react properly to the signals from of the action to invoke in the context of the a parent view. The goal is to have the global the parent view. view displayed in the region, along with toolbar perform actions, such as data itera- optional additional information developers tion, create/update/delete operations, or A COMMAND PATTERN SOLUTION may want to provide to the receiving end. context-sensitive help display, on the view The command pattern is a well-known The event receiver in the Oracle ADF Region displayed in a separate region. design pattern in object-oriented program- is a data control method that is referenced This article will show how to implement ming that uses a command object to encap- in the PageDef file (binding container defi- this use case by borrowing the idea of the sulate all the information needed to invoke nition) of each view. command pattern from object-oriented pro- methods on other objects. The command The solution in Figure 1 retains task flow gramming. A command pattern implemen- pattern describes three acting parts: a client encapsulation and does not expose objects tation, deployed as an Oracle ADF library, is that creates the command object, including located within the task flow to the outside provided for you to use within your custom information about the actions to invoke on a consumer. One change to the command development projects. target object; an invoker that dispatches the pattern in object-oriented programming is command defined in the command object; that the Oracle ADF Region container allows AN ADVANCED TOPIC and a receiver that represents the target developers to check for commands supported Unlike previous Oracle Magazine articles, object on which the command is executed. by the current view to let them disable or hide which were more suitable for beginners, With slight variations applied to the command buttons accordingly. this article covers an advanced topic in invoker and receiver, the command pattern Oracle ADF task flow communication. It’s defined for object-oriented programming THE COMMAND PATTERN assumed that you have an understanding of can be used with Oracle ADF and task flows IMPLEMENTATION core Oracle ADF technology concepts such to implement the Oracle ADF Region interac- The code sample for this article (at bit.ly/

I-HUA CHEN I-HUA as bounded task flows, task flow templates, tion use case covered in this article. OHuJLe) is packaged by implementing the

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_ADF.indd 41 10/15/12 1:16 PM 42 Oracle ADF

command pattern design for Oracle ADF Parent View Region interaction in a separate Oracle Oracle ADF Region JDeveloper workspace. This code is deployed Payload Action 1 Action 2 (Task Flow) into an Oracle ADF library and can be used in the sample application provided as well as in View 1 Action Handler your own custom applications. Payload Payload (Receiver) Figure 2 provides an overview of the command pattern implementation. Both Invoker sides of the command pattern implementa- (contextual event) Event Receiver Event tion, the client (producer) and the receiver, and Dispatcher View 2 are developed as page templates. Each page Payload Action Handler (Receiver) template has its own Oracle ADF binding file (PageDef) defined. The PageDef file of the producer page template contains the Payload contextual event metadata that defines the event name, the action type to listen for, and a reference to the location of the Figure 1: Technical implementation outline payload object. The PageDef file associated with the Command Pattern Template (Oracle ADF Library) receiver page template contains the event handler definition and a mapping that binds Action Producer Action Receiver the producer event name with it. A lifecycle Producer Page Receiver Page Task Flow configuration in the form of an Oracle ADF Template Template Template Region Controller is used to let the calling side (producer) know the action commands PageDef PageDef Internal supported by the current view (receiver). Input Parameter (Contextual Event (Contextual Event Managed Bean Implementation A task flow template is provided for Producer) Receiver) Classes any implementing receiver task flow to consume. The task flow template ensures Public API Region Public API (Producer) Controller (Receiver) that the required managed beans and input parameters are configured on the receiving task flow and exposed to the Oracle ADF application developer. Parent View Bounded The public APIs exposed to the applica- Task Flow tion developer by the task flow command pattern template consist of two page tem- Figure 2: Task flow command pattern template architecture plates, a task flow template, and a set of abstract classes for the developer to extend. of implementation classes containing logic sample application, you need the studio With the provided sample implementa- to invoke, dispatch, and handle the defined edition of Oracle JDeveloper 11g Release 2 tion, the assumption is that the view action contextual events. Following the Oracle ADF (11.1.2.2.0), available as a free download handlers shown in Figure 1 are implemented framework naming convention, these classes on Oracle Technology Network. You also as JavaServer Faces (JSF) managed beans are stored in a package structure starting need an Oracle database instance with an in backing bean scope within the bounded with “internal.” Application developers don’t unlocked HR schema. task flow. need to know about these classes and should The sample application contains two The name of the managed bean should not have any need to use them. folders: be the same as the view activity, along with • CommandStrategyTemplates contains a prefix of tfcp, which stands for task flow Getting Started the task flow command pattern template command pattern. So if the view activity Before exploring how the task flow source code. The command pattern name is DepartmentsView, then the asso- command pattern solution works, you template is deployed to an Oracle ADF ciated backing bean name configured in should first download the command library, TaskFlowCommandStrategyLib.jar, the task flow configuration file should be pattern sample application at bit.ly/OHuJLe which is referenced in the OraMagSample tfcpDepartmentsView. and unzip the o62adf-1841823.zip file to a sample application ViewController A third pillar in this architecture is a set local folder on your computer. To open the project properties.

November/December 2012 Oracle.com/oraclemagazine

ND12_ADF.indd 42 10/15/12 1:17 PM Oracle ADF 43

the database connection information developers nest page templates. As a result, to work with your database configura- an Oracle ADF Faces view built based on a tion. Test the changes and then click functional template can contain additional OK to close the Connection Properties page templates to improve look and feel. dialog box. In the OraMagSample application, the As another preliminary task, start the ParentView.jspx page uses a nested template Oracle WebLogic Server instance integrated reference to the default Oracle three-column with Oracle JDeveloper. To start the Oracle template. WebLogic Server, select Run -> Start Server Also shown in Figure 4, the ParentView Instance (IntegratedWebLogicServer). .jspx template uses two managed beans in If this is the first time you’ve run the viewScope that are configured in the adfc- integrated Oracle WebLogic Server, a Create config.xml file located in the Web Context Default Domain dialog box will open. Create ->public_html->WEB-INF folder. a password for the default Oracle WebLogic The SupportedToolbarActions bean is Server domain, and select an address from passed as an input parameter value to the those listed for Listen Address. For example, bounded task flow, also shown in Figure 4. choose localhost rather than leaving the The bounded task flow uses this bean refer- address empty. ence to call back into the parent view. In Click OK to save the change and create and the sample application, the callback is used configure the default domain for Oracle ADF. to change the button bar disabled state Figure 3: Sample application ViewController project depending on the view currently displayed in Sample Application Overview the bounded task flow. You need to open this folder only if you are With the OraMagSample workspace open, Let’s have a detailed look at each of the interested in the task flow command pattern expand the ViewController node to see a two beans: implementation, or if you want to modify the project view similar to what is shown in • ParentViewBean contains action methods library to suit your needs. The source code is Figure 3. referenced from the ActionListener prop- well documented, using Java comments. Figure 4 shows the architecture of the erty of the toolbar buttons. Each time a • OraMagSample holds a sample appli- sample application, with the task flow user clicks a button, a referenced method is cation that implements the task flow command pattern template library parts invoked on ParentViewBean. command pattern template. We will use colored in green. ParentViewBean extends the this application to further explain how The sample application contains a ActionProducer class of the task flow to use the template in custom projects. single JSF document, ParentView.jspx, command pattern template library and The sample application uses a copy of the that is based on the event-producer- can raise contextual events via calls to TaskFlowCommandStrategyLib.jar file in template.jspx page template defined in the invokeTaskFlowAction. Information its Lib folder and does not depend on the TaskFlowCommandStrategyLib.jar library. passed with the contextual event include CommandStrategyTemplates folder. In Oracle ADF, views that are based on a the method name to invoke on the current To run the sample application, you also template not only adopt the template layout display view in the bounded task flow, need to change the database connection to definition but also maintain a reference to a discriminator for the event receiver to point to your HR database schema: the template Oracle ADF binding file (if the decide whether or not to respond to the 1. Launch Oracle JDeveloper 11g Release 2. template has its own Oracle ADF binding). request, and an optional payload object to Select File -> Open, and then navi- The event-producer-template.jspx file, pass extra information if needed. gate to the directory containing the upon which the ParentView.jspx document is • SupportedToolbarActions allows the unpacked sample application. based, has a PageDef file defined and config- parent view to show a button as disabled if 2. Open the OraMagSample folder, select ured as a contextual event producer. Because a method is not supported by the current the OraMagSample.jws file, and click the ParentView.jspx document maintains view in the task flow. Open. The workspace opens in Oracle a reference to the template binding, it can To enable this functionality, the Oracle JDeveloper. broadcast contextual events as indicated in ADF Region tag (af:region) in the ParentView 3. Select View -> Database -> Figure 4. .jspx page has its RegionNavigationListener Database Navigator, and expand the The event-producer-template.jspx file property configured to reference a method in OraMagSample node to display the does not contain layout definitions; it only ParentViewBean. hrconn node. helps to automate the registration of views as The region navigation listener receives 4. Right-click the hrconn node, and select a contextual event producer. Luckily, Oracle a notification each time the view displayed Properties from the context menu. Edit JDeveloper 11g Release 2 lets application in the bounded task flow changes. This

oracle magazine November/December 2012

ND12_ADF.indd 43 10/15/12 1:18 PM 44 Oracle ADF

notification is used to refresh the button bar by disabling a button if its action is not sup- ParentView.jspx Oracle ADF Region ported by the new view. (Bounded Task Flow) View 1 View 2 Producer Page The command receiver in the sample Template application consists of a bounded task flow that is created from the library command- PageDef Contextual Event Receiver Page Receiver Page (Contextual Event Template Template receiver-flow-template.xml, as well as Producer) views that are built based on the event- PageDef PageDef (Contextual Event (Contextual Event receiver-template.jspx page template in the Receiver) Receiver) ParentView TaskFlowCommandStrategyLib.jar. bean Similar to event-producer-template.jspx View Action View Action Handler Handler for the parent view, event-receiver-template Supported Task Flow ToolbarActions Input Parameter .jspx automatically configures the views in bean the bounded task flow for contextual events. debugMode Backing Bean Backing Bean (optional) (optional) This time, however, the views are configured Parent View discriminator PageDef.xml as contextual event receivers, as shown in supportedActions Figure 4. The departments-employees-flow.xml bounded task flow definition located in the Figure 4: Sample application architecture Web Content -> WEB-INF folder defines two managed beans used as view action handlers • DepartmentsBacking. This is a backing the binding editor, click the Source tab at the to receive contextual event notification, as bean referenced from the showHelp bottom to switch to the source view. well as two backing beans used to access and method in tfcpDepartmentsView to launch launch a dialog box contained in the view. a help dialog box. Running the Sample Let’s look at two representative beans in When dragging a bounded task flow To run the sample, right-click the ParentView more depth: built on the command-receiver-flow- .jspx file in the Application Navigator and • tfcpDepartmentsView is the view action template.xml task flow template to a page, select Run from the context menu. handler (as shown in Figure 1) for the three input parameter values must be The application opens in a browser DepartmentsView activity in the bounded provided. showing a global button bar and an edit task flow. • debugMode. When set to true, this param- form for the HR Departments table. The Following the naming convention used eter prints debug messages at runtime. button bar resides in the ParentView.jspx by the task flow command pattern template, • discriminator. Contextual events are broad- file, while the edit form is defined in the the managed bean filename has a prefix of cast to all listening binding containers. To DepartmentsView.jsff page fragment in the tfcp. When the contextual event handler use the library with multiple regions on a bounded task flow (Oracle ADF Region). Note receives a contextual event, it identifies the page, a discriminator key can be configured that the departments edit form does not view action handler on which to invoke the as a task flow input. A receiver will ignore implement query functionality. As a result, invokeAction method using the name of the contextual events if the discriminator the Execute Query button is disabled, as current viewId and the tfcp prefix. string defined on the region configuration shown in Figure 5. The invokeAction method in a view does not match the discriminator string Clicking any of the buttons in the button action handler bean interprets the passed with the producer event. bar issues a contextual event that is broad- contextual event payload and calls • supportedActions. This parameter points to cast to the view in the bounded task flow. the method that handles the request. the managed bean in the parent view that The contextual event handler checks the View action handler beans extend contains the list of commands supported discriminator value passed with the event DepEmpBaseCommands, an abstract by the views in the bounded task flow. request. If the value matches the value class that contains method signatures To see this configuration defined for the configured in the task flow, it invokes the for the global methods supported ParentView.jspx file in the sample applica- command on the view action handler. by the application. In addition, the tion, expand the Application Sources node To navigate to the employees form, click DepEmpBaseCommands class provides in the ViewController project and navigate to the Navigate to Employees button. Upon access to the current displayed view binding the ParentViewPageDef.xml file located in the task flow navigation, the region naviga- container. With contextual events, devel- oramag.novdec.twelve.sample.view pageDefs tion listener on the af:region tag is invoked opers cannot use the currentBindingsEntry package. To open the page definition file, for the parent view to refresh the button method on the BindingContext object to right-click the ParentViewPageDef.xml file bar with the capabilities of the employee gain this access. and select Open from the context menu. In view. As a result, the Execute Query button

November/December 2012 Oracle.com/oraclemagazine

ND12_ADF.indd 44 10/15/12 1:18 PM ORACLE ADF 45

hidden from the application developer. In addition, this article has shown how to adopt the command design pattern from object-oriented programming for use within an Oracle ADF development environment. t

Frank Nimphius is a senior principal product manager for Oracle JDeveloper and Oracle ADF. He is a coauthor of Oracle Fusion Developer Guide: Building Rich Internet Applications with Oracle ADF Business Components and Oracle Figure 5: Runtime view of sample application ADF Faces (McGraw-Hill, 2010).

becomes enabled. As you would expect interaction by providing an implementation NEXT STEPS from a command pattern implementation, that can be reused in many projects. LEARN more about Oracle ADF the same set of buttons now operate on the The task flow command pattern tem- oracle.com/adf employees view. plate library contains page templates, a DOWNLOAD task flow template, and a public API that Oracle JDeveloper 11g SUMMARY simplifies the configuration of this solution bit.ly/LRlg7k This article outlines a solution for a frequently in custom projects. The contextual event the sample application for this article bit.ly/OHuJLe asked-about use case in Oracle ADF Region implementation detail in the template is

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_ADF.indd 45 10/15/12 1:19 PM Connect legacy technologies affordably with the complete set of data integration tools from Altova®

Experience how the Altova MissionKit®, the integrated suite of XML, data mapping, and database tools, can help you leverage existing technology and business software investments while integrating modern technologies – without breaking your budget.

The Altova MissionKit includes NEW in Version 2012: multiple intelligent tools for data integration: • Streaming reading/writing ® of files for large-scale MapForce – Graphical data mapping, ETL applications transformation, & conversion tool • Sorting of data mapping • Drag-and-drop data conversion with instant results transformation & code gen • New data processing functions • Support for mapping XML, DBs, EDI, • JDBC drivers (in addition Excel®, XBRL, flat files & Web services to ADO and ODBC) ® • New, native Java APIs XMLSpy – XML editor and Web services tool • XML editor with strong database integration • Web services tool, JSON <> XML converter DatabaseSpy® – multi-database query, design & comparison tool • Support for all major relational databases and translation between DB types • SQL editor, graphical database design & content editor

Download a 30 day free trial!

Try before you buy with a free, fully functional trial from www.altova.com

Scan to learn more about data integration with the MissionKit.

Untitled-4 1 10/25/12 1:09 AM Database Application Developer | PL/SQL PL/SQL 101 By Steven Feuerstein 47

Oracle Database The Data Dictionary: Make Views Work for You Part 10 in a series of articles on understanding and using PL/SQL

f you’re reading this article, there’s a really Most data dictionary views come in three The following query returns all the objects I good chance that you write PL/SQL code. versions: defined in my schema: Lots of it. Which means that you also will at 1. The USER view: information about data- least occasionally need to analyze that code, base objects owned by the schema to SELECT * FROM user_objects answering questions such as which you are connected • On which database objects does my 2. The ALL view: information about data- This query returns all the objects that are program depend? base objects to which the currently con- defined in my schema or for which I have • Which of my packages contain calls to a nected schema has access been granted the privilege to use those subprogram in another package or a refer- 3. The DBA view: unrestricted information objects in some way: ence to a global variable? about all the database objects in a data- • Do any of my subprograms contain param- base instance (non-DBA schemas usually SELECT * FROM all_objects eters whose datatypes should not be used? have no authority to query DBA views) • Are all of my subprograms compiled with a Let’s look at an example. Suppose I Finally, the following query returns a list sufficiently high level of optimization? want to obtain a list of the objects—tables, of all the objects defined in the database You can, of course, always use the search views, packages, and so on—defined in the instance—if I have the authority to select feature of your editor or integrated develop- database. from the view: ment environment to look through multiple database objects and files to find specific USER_ARGUMENTS The arguments (parameters) in all the procedures and functions in your schema. chunks of text. But that won’t be enough to USER_DEPENDENCIES The dependencies to and from objects you own. This view is used mostly by Oracle answer all of the above questions and many Database to invalidate the status of database objects when an object on which they depend changes. more you will encounter. Don’t despair! One of the most lovely USER_ERRORS The current set of compilation errors for all stored objects (including triggers) you own. This view is accessed by the SHOW ERRORS SQL*Plus command. You can, however, aspects of writing PL/SQL code and compiling write your own queries against it as well. that code into the database is that Oracle USER_IDENTIFIERS Introduced in Oracle Database 11g and populated by the PL/Scope compiler utility. Once Database offers a set of views—known collec- populated, this view provides you with information about all the identifiers—program names, variables, and so on—in your code base. tively as the data dictionary—that enable you USER_OBJECT_SIZE The size of the objects you own. Actually, this view shows you the source, parsed, and to use the SQL and PL/SQL languages to get compile sizes for your code. Although it is used mainly by the compiler and runtime answers to just about any question you have engine, you can use it to identify the large programs in your environment. about your code. Table 1 offers a high-level USER_OBJECTS The objects you own. You can, for instance, use this view to see if an object is marked overview of the data dictionary views most INVALID, find all the packages that have EMP in their names, and so on. often used to manage PL/SQL code. USER_PLSQL_OBJECT_SETTINGS Information about the characteristics—such as the optimization level and debug settings—of a PL/SQL object that can be modified through the ALTER and SET DDL This article explores many of the views commands. in the table, describing the most useful USER_PROCEDURES Information about stored programs, such as the AUTHID setting, whether the program columns in the views and offering examples was defined as DETERMINISTIC, and so on. of how you can put those views to use. USER_SOURCE The text source code for all objects you own (in Oracle9i Database and above, including database triggers and Java source). This is a very handy view, because you can run all sorts of analyses of the source code against it with SQL and, in particular, Oracle Text. Data Dictionary Fundamentals USER_STORED_SETTINGS PL/SQL compiler flags. Use this view to discover which programs have been compiled via The data dictionary consists of numerous native compilation. tables and views created by the database USER_TRIGGERS and The database triggers you own (including the source code and a description of the instance. User schemas generally have no USER_TRIGGER_COLS triggering event) and any columns identified with the triggers, respectively. You can write privileges on these tables; Oracle Database programs against USER_TRIGGERS to enable or disable triggers for a particular table. grants only SELECT access on the views. Table 1: Useful views for PL/SQL programmers

oracle magazine November/December 2012

ND12_PLSQL101.indd 47 10/1/12 4:38 PM 48 PL/SQL 101

SELECT * FROM dba_objects Display and Search Source Code settings of stored PL/SQL objects. Key All the program unit source code you’ve com- columns are Usually the only difference between the piled into the database is accessible through • PLSQL_OPTIMIZE_LEVEL: Optimization USER view and the ALL view is that the latter the USER_SOURCE view, whose columns are level that was used to compile the object contains one extra column, OWNER, that • NAME: Name of the object • PLSQL_CODE_TYPE: Compilation mode for shows which schema owns the object. • TYPE: Type of the object (ranging from the object The remainder of this article provides PL/SQL program units to Java source and • PLSQL_DEBUG: Whether or not the object examples based on the USER view. trigger source) was compiled for debugging • LINE: Number of the line of the source code • PLSQL_WARNINGS: Compiler warning set- Display Information About • TEXT: Text of the source code tings that were used to compile the object Stored Objects You can write queries against USER_ • NLS_LENGTH_SEMANTICS: NLS length The USER_OBJECTS view contains a row for SOURCE to semantics that were used to compile every database object owned by your schema. • Find all the program units that call a par- the object The most commonly used columns are ticular subprogram of a package Here are some examples of queries • OBJECT_NAME: Name of the object • Verify that coding standards are being against USER_PLSQL_OBJECT_SETTINGS. • OBJECT_TYPE: Type of the object, such as followed • Find all the program units that are not PACKAGE, FUNCTION, or TRIGGER • Find all occurrences of a literal value that taking sufficient advantage of compile time • STATUS: Status of the object—VALID or needs to be changed optimization in Oracle Database: INVALID Here is an example: I need to change • LAST_DDL_TIME: Time stamp indicating the parameter list and code of a procedure SELECT name the last time this object was changed named CALC_TOTALS in the SALES_MGR FROM user_plsql_object_settings Here are some examples of queries package. I’d like to find out where this pro- WHERE plsql_optimize_level < 2 against USER_OBJECTS. cedure is called, outside of the SALES_MGR • Show the names of all tables in my schema: package itself. An optimization level of 0 means no optimization at all. An optimization level of SELECT object_name SELECT name, line, text 1 means a minimal amount of optimization. FROM user_objects FROM user_source Neither of these levels should be seen in a WHERE object_type = 'TABLE' WHERE UPPER (text) production environment. ORDER BY object_name LIKE '%SALES_MGR.CALC_TOTALS%' • Identify all programs for which compile ORDER BY name, line time warnings (which provide feedback on Show the names of all objects whose the quality of your code) are disabled: status is invalid: Of course, this query will also find com- ments that contain this string, and there SELECT name, plsql_warnings SELECT object_type, object_name could be invocations of CALC_TOTALS that FROM user_plsql_object_settings FROM user_objects are not found, such as WHERE plsql_warnings LIKE '%DISABLE%'; WHERE status = 'INVALID' ORDER BY object_type, object_name SALES_MGR. Detailed Information About CALC_TOTALS Procedures and Functions The status of a program unit (PL/SQL The USER_PROCEDURES view provides package, procedure, or function) is set to Assuming, however, that you don’t write information about all functions and proce- INVALID if a database object on which it or format your code to break up subprogram dures, both schema-level and those defined depends is changed. That program unit must calls like that, the query will do a pretty good within packages, in your schema. Columns of then be recompiled (which Oracle Database job of identifying the places in your code you this view are will often do automatically the next time you need to review. • AUTHID: Shows whether a procedure try to use that program unit). And for an Oracle Database 11g instance, or a function is defined as an invoker • Show all objects that have been you could use the PL/Scope feature. See the rights (CURRENT_USER) or definer rights changed today: “A Better USER_SOURCE” sidebar­ in the (DEFINER) program unit online version of this article at bit.ly/SamK9l • DETERMINISTIC: Set to YES if the function SELECT object_type, object_name, for more information. is defined to be deterministic, which theo- last_ddl_time retically means that the value returned by FROM user_objects Compiler Settings of Stored Code the function is determined completely by WHERE last_ddl_time >= TRUNC (SYSDATE) The USER_PLSQL_OBJECT_SETTINGS the function’s argument values ORDER BY object_type, object_name view provides information about compiler • PIPELINED: Set to YES if the function is

November/December 2012 Oracle.com/oraclemagazine

ND12_PLSQL101.indd 48 10/1/12 4:39 PM PL/SQL 101 49

defined as a pipelined function, which • TRIGGER_BODY: The code executed when END LOOP; means that it can be executed in parallel as the trigger fires END; part of a parallel query Here are some examples of queries • OVERLOAD: Set to a positive number if this against USER_TRIGGERS. Note that the USER_TRIGGER_COLS view subprogram is overloaded, which means • Find all disabled triggers: keeps track of the columns that are refer- that there are at least two subprograms enced inside a trigger body. with this name in the same package SELECT * Here are some examples of queries FROM user_triggers Object Dependency Analysis against USER_PROCEDURES. WHERE status = 'DISABLED' The USER_DEPENDENCIES view describes • Find all the procedures and functions that the dependencies between the procedures, will run under invoker rights (the privileges • Find all row-level triggers defined on the packages, functions, package bodies, and of the invoker of the program are used at EMPLOYEES table: triggers accessible to the current user. You runtime to resolve references to database can use it to perform impact analysis on your objects such as tables): SELECT * code, as in: How many programs will need to FROM user_triggers be changed if I change this table? SELECT object_name WHERE table_name = 'EMPLOYEES' Key columns in this view are , procedure_name AND trigger_type LIKE '%EACH ROW' • NAME: Name of the object FROM user_procedures • TYPE: Type of the object WHERE authid = 'CURRENT_USER' • Find all triggers that fire when an UPDATE • REFERENCED_OWNER: Owner of the refer- ORDER BY object_name, procedure_name operation is performed: enced object • REFERENCED_NAME: Name of the refer- • Show all the functions declared to be SELECT * enced object deterministic: FROM user_triggers • REFERENCED_TYPE: Type of the refer- WHERE triggering_event LIKE '%UPDATE%' enced object SELECT object_name Here are some examples of queries , procedure_name One limitation in the USER_TRIGGERS against USER_DEPENDENCIES. FROM user_procedures view is that the TRIGGER_BODY column type • Find all the objects that depend on (refer- WHERE deterministic = 'YES' is LONG, which means that it cannot be used ence) the EMPLOYEES table: ORDER BY object_name, procedure_name in a SQL comparison. Suppose, for example, that I want to find SELECT type, name Analyze and Modify Trigger State all the triggers whose trigger body contains FROM user_dependencies If you work with database triggers, USER_ the string “emp”. The following query, WHERE referenced_name = 'EMPLOYEES' TRIGGERS, which contains a row for each unfortunately, fails and produces an ORA- ORDER BY type, name trigger defined in your schema, will come in 00932 error: handy. Key columns are • Find all the objects in the current schema • TRIGGER_NAME: The name of the trigger SELECT * on which the ORDER_MGR package • TRIGGER_TYPE: A string that shows if this FROM user_triggers depends: is a BEFORE or AFTER trigger and whether WHERE trigger_body LIKE '%emp%' it is a row- or statement-level trigger (in a SELECT referenced_type trigger that is fired before an INSERT state- So if you do want to search the contents of , referenced_name ment, for example, the value of this column trigger bodies, you will need to use PL/SQL, FROM user_dependencies is BEFORE STATEMENT) in a block like this: WHERE name = 'ORDER_MGR' • TRIGGERING_EVENT: The type of SQL AND referenced_owner = USER operation—such as INSERT, INSERT OR BEGIN ORDER BY referenced_type, UPDATE, DELETE OR UPDATE—that will FOR rec IN (SELECT * referenced_name cause the trigger to fire FROM user_triggers) • TABLE_NAME: The name of the table on LOOP A best practice that I, and others, strongly which the trigger is defined IF rec.trigger_body LIKE '%emp%' recommend is to avoid repeating SQL • STATUS: The status of the trigger— THEN statements by “hiding” those statements ENABLED or DISABLED DBMS_OUTPUT.put_line ( inside a procedure or a function. Let’s look • WHEN_CLAUSE: An optional clause you 'Found in ' || rec.trigger_ at an example and then at how the USER_ can use to avoid unnecessary execution of name); DEPENDENCIES view can help us identify the trigger body END IF; violations of this best practice.

oracle magazine November/December 2012

ND12_PLSQL101.indd 49 10/1/12 4:39 PM 50 PL/SQL 101

Code Listing 1: Find functions that have an OUT or an IN OUT argument referenced_owner, referenced_name

1 SELECT ua.object_name, FROM user_dependencies 2 ua.package_name, WHERE TYPE IN 3 ua.argument_name, ('PACKAGE', 4 ua.in_out 5 FROM (SELECT * 'PACKAGE BODY', 6 FROM user_arguments 'PROCEDURE', 7 WHERE position = 0) funcs, 'FUNCTION', 8 user_arguments ua 9 WHERE ua.in_out IN ('OUT', 'IN OUT') 'TRIGGER', 10 AND ua.position > 0 'TYPE') 11 AND ua.data_level = 0 AND referenced_type = 'TABLE' 12 AND funcs.object_name = ua.object_name 13 AND funcs.package_name = ua.package_name AND name NOT LIKE '%\_API' ESCAPE '\' 14 AND ( funcs.overload = ua.overload ORDER BY name 15 OR (funcs.overload IS NULL , referenced_owner 16 AND ua.overload IS NULL)) , referenced_name Lines Description 5–7 I use an inline view in the FROM clause to identify all those rows in USER_ARGUMENTS that are RETURN clauses The online version of this article includes (and therefore identify functions). information on the USER_ARGUMENTS 9–11 I look for OUT or IN OUT arguments that are not in RETURN clauses and are not “nested” information, such as fields view and its columns as well as this issue’s of a record argument. 12–16 I use this rather lengthy join condition between the inline view (abbreviated as “funcs”) and USER_ARGUMENTS. PL/SQL Challenge question. The object names and package names must match, and the overload value must be the same or both must be NULL. The overload column is not NULL if the package has two or more subprograms with the same name. It’s a Gold Mine in There This article merely scratches the surface It is very common in PL/SQL code to find function named LAST_NAME, the above of the application information that can be many queries that retrieve a single row for procedure can be changed to mined from the data dictionary views in a primary key. Here’s a PL/SQL example Oracle Database. PL/SQL editors such as with a query that uses the standard Oracle PROCEDURE process_employee ( Oracle SQL Developer provide user inter- Database EMPLOYEES table: employee_id_in IN INTEGER) faces to many of these views, making it IS easier to browse their contents.  PROCEDURE process_employee ( l_name VARCHAR2 (100); employee_id_in IN INTEGER) BEGIN Steven Feuerstein IS l_name := (steven.feuerstein@ l_name VARCHAR2 (100); employees_api. quest.com) is Quest BEGIN last_name (employee_id_in); Software’s PL/SQL SELECT last_name END; evangelist. He has INTO l_name published 10 books on FROM employees Now if I ever need to change the query Oracle PL/SQL (O’Reilly Media) and is an Oracle WHERE employee_id = employee_id_in; for any reason (such as to take advantage of ACE Director. More information is available at END; Oracle Database 11g’s function result cache stevenfeuerstein.com. feature), I’ll be able to make the change in Instead of writing this query each time, one place, rather than having to find all occur- Next Steps I suggest writing a function once that con- rences of the query in my application code. tains this query and returns the desired So suppose my development team has DOWNLOAD Oracle Database 11g value. Then you can call the function as added this best practice to its coding stan- bit.ly/fherki needed. Assuming that I have created a dards: the only PL/SQL program units that TEST your PL/SQL knowledge package named EMPLOYEES_API with a should contain SQL statements are packages plsqlchallenge.com that end with the suffix _API. READ Answer to Last Issue’s Challenge PL/SQL 101, Parts 1–9 I can then write a query against USER_ bit.ly/omagplsql DEPENDENCIES that identifies all program The PL/SQL Challenge question in last issue’s online-only article content “Bulk Processing with BULK COLLECT and units that violate this rule: bit.ly/SamK9l FORALL” article asked, “Which of these blocks READ more about will uppercase the last names of all employees SELECT name, the data dictionary in the table?” Choices b, c, and d are correct. bit.ly/OR14hA TYPE,

November/December 2012 Oracle.com/oraclemagazine

ND12_PLSQL101.indd 50 10/1/12 4:40 PM DBA | Performance TUNING BY ARUP NANDA 51

ORACLE DATABASE 11g Beginning Performance Tuning: Diagnose the Past Take the next step in diagnosing Oracle Database performance issues.

n “Beginning Performance Tuning,” in the • TIME_WAITED: the total length of time SID of the ARUP session as follows: I July/August 2012 issue of Oracle Magazine, the session had to wait for that event, I demonstrated the basics of diagnosing per- recorded in cs (centiseconds [hundredths select sid from v$session formance issues in Oracle Database. In this of a second]) where username = 'ARUP'; article, I will show how to take performance • AVERAGE_WAIT: the average length of time tuning to the next level—identifying patterns (also in cs) the session waited for that event SID and measuring resource utilization. As was • MAX_WAIT: the maximum length of time ————— the case with the previous article, you can (in cs) the session waited for that event 37 create this article’s examples by executing Let’s examine the usage of the view with the setup script—setup.sql—in the online an example. Make sure you have set up the Now display the session events of SID 37 version of this article, at bit.ly/U8ml8P. example as described in the online version of by executing the script in Listing 1. Because this article. Connect to the Oracle Database the V$SESSION_EVENT columns report time HISTORICAL WAITS instance as ARUP, and execute the test1.sql in centiseconds, I have multiplied them by Recall from “Beginning Performance Tuning” script, available in the online version. (Note 10 to show them in milliseconds (ms), a that you can identify why a session is slow by that the script will take some time to com- unit of measure that is a bit more familiar. looking at what event it is waiting for right plete). While that script is running, connect Study the output carefully—it shows the now in the V$SESSION view. This technique as SYS from a different session and find the various events the session waited for earlier, is effective when you are able to peek into the view while the issue is occurring, but what Code Listing 1: History of wait events in a specific session if a user reports that there was an increase in the response time of a session but it is back to normal now? Because the issue is no set lines 120 trimspool on col event head "Waited for" format a30 longer present, the session may appear to be col total_waits head "Total|Waits" format 999,999 working productively with the STATE column col tw_ms head "Waited|for (ms)" format 999,999.99 value of WAITED KNOWN TIME. What’s col aw_ms head "Average|Wait (ms)" format 999,999.99 col mw_ms head "Max|Wait (ms)" format 999,999.99 worse, the current wait event shown in the select event, total_waits, time_waited*10 tw_ms, V$SESSION view may be something unre- average_wait*10 aw_ms, max_wait*10 mw_ms lated to what the user encountered earlier. from v$session_event where sid = 37 To diagnose this issue, you need to know all / the different events the session had to wait Total Waited Average Max for—not just what it is waiting for now. How Waited for Waits for (ms) Wait (ms) Wait (ms) ———————————————————————————————————————————— ———————————— ————————————————— ———————————————— ————————————————— difficult is it to get that information? Disk file operations I/O 8 .00 .10 .00 Fortunately, it’s quite trivial. There is KSV master wait 2 350.00 173.20 340.00 another view—V$SESSION_EVENT—that os thread startup 1 20.00 19.30 20.00 db file sequential read 5 160.00 32.10 70.00 shows the details of all the wait events the direct path read 1,521 51,010.00 33.50 120.00 session has ever waited for. Here are the direct path read temp 463,035 513,810.00 1.10 120.00 important columns in that view: direct path write temp 20 370.00 18.70 50.00 resmgr:cpu quantum 21 520.00 24.60 110.00 • SID: the session ID utl_file I/O 8 .00 .00 .00 • EVENT: the name of the wait event experi- SQL*Net message to client 20 .00 .00 .00 enced by the session SQL*Net message from client 20 9,620.00 481.20 9,619.00 • TOTAL_WAITS: the total number of times kfk: async disk IO 904,818 3,050.00 .00 .00 events in waitclass Other 35 20.00 .70 20.00

I-HUA CHEN I-HUA the session had to wait for that wait event

ORACLE MAGAZINE NOVEMBER/DECEMBER 2012

ND12_TUNING.indd 51 10/1/12 4:55 PM 52 Tuning

not what it is experiencing now. You can see Code Listing 2: Output of the top command that the session has waited for one event in

particular: “kfk: async disk IO.” The session top - 10:56:49 up 18 days, 18:48, 4 users, load average: 1.02, 0.92, 0.48 has waited 904,818 times for this event, but Tasks: 180 total, 2 running, 178 sleeping, 0 stopped, 0 zombie Cpu(s): 49.8%us, 0.5%sy, 0.0%ni, 49.2%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st it has waited for a total of only 3,050 ms. Mem: 1815256k total, 1771772k used, 43484k free, 66120k buffers The average wait shows zero, but it is simply Swap: 2031608k total, 734380k used, 1297228k free, 747740k cached because the average wait was so short that PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND it couldn’t be shown within the two digits 5946 oracle 25 0 706m 177m 159m R 100 10.0 9:20.26 oracle after the decimal point. So although the total 6104 oracle 15 0 2324 1060 800 R 1 0.1 0:00.12 top number of waits for this event was high, it 31446 oracle 15 0 688m 135m 129m S 0 7.7 0:08.24 oracle added only 3,050 ms to the overall time of … output truncated … the session—an insignificant number. You can thus rule this wait event out as a cause of delay for the session. Considering the single incidence of a large Let’s see how to use this information with In this case, you should focus your atten- wait, this event should not be a general a performance problem example. tion on the event that caused the session cause of concern. On the other hand, had you to wait for the maximum time. From the seen a maximum time close to the average CPU Spike output in Listing 1, you can see that session time, you could surmise that all occurrences Suppose you’ve heard from several users that 37 (SID = 37) waited 513,810 ms, or more had to wait about the same amount of time. the performance is terrible across the board. than 8.5 minutes, for the “direct path read In such a case, reducing the time for this Further, the UNIX system administrator has temp” event. Every time the session waited event would likely apply uniformly to all reported that both CPU and memory con- for this event, it waited 1.1 ms on average, so occurrences and consequently reduce the sumption are very high on the server and most if you can reduce the time for this event, you overall elapsed time. of the consumption is by Oracle Database– can reduce the overall time for the session. Although the V$SESSION_EVENT view owned processes. Sound familiar? From my Looking at the session event history enables shows what the session waited for earlier, experience, it’s the second-most-common you to identify the biggest contributors it doesn’t show when. That information performance issue in Oracle Database to the delay in the session, whether they is visible in another view—V$ACTIVE_ systems. You can reproduce this problem by are currently affecting the session or have SESSION_HISTORY (part of the extra-cost running the test1.sql script, available in this already affected it. Oracle Diagnostics Pack)—which is beyond article’s example scripts, as user ARUP. Did you notice the column for the the scope of this article. To diagnose this resource issue, review maximum time waited: “Max Wait (ms)”? the top resource-consuming processes Why is that information useful? You see, the Statistics by issuing the top command at the UNIX average wait time does not tell the whole Although wait events are great for helping command prompt. Listing 2 shows the story. Consider the “SQL*Net message from with understanding the speed bumps the output of the top command. client” event in the output in Listing 1. The sessions experience, they do not show In the output in Listing 2, you can see session waited 20 times with an average wait another important attribute of sessions: that the process with ID 5946 consumes the time of 481 ms for that event. Does that mean the use of resources such as CPU, I/O, most CPU (100 percent) and memory (10 that the session waited for approximately and memory. A resource-hogging session percent) and therefore should be the focus 481 ms at each of the 20 occurrences or that deprives other sessions of the same of your attention. To find out more about the the session waited a very short time for most resources, thus causing performance issues. process, enter the following command at the of the event instances and a very long time for When the root of the problem is that the UNIX prompt: one event? The latter will skew the average to session is consuming too much CPU, you a high value but will indicate an isolated issue should look at resource consumption— $ ps -aef|grep 5946 rather than a persistent one—the two possi- not the events waited for—by a session. bilities lead to very different conclusions. Fortunately, finding that information is oracle 5946 5945 63 10:59 ? The “Max Wait (ms)” column shows the quite simple: it’s visible in a view named 00:01:52 oracleD112D2 maximum time the session had to wait V$SESSTAT, which has three columns: (DESCRIPTION=(LOCAL=YES) for one occurrence of this event. The value • SID: the session ID (ADDRESS=(PROTOCOL=beq))) here is 9,619 ms, and because the total • STATISTIC#: the ID of the statistic being wait time was 9,620 ms, it appears that the captured (You can get the name of the The output shows the entire description of session waited 9,619 ms on one occasion, statistic from the NAME column in another the process, which is clearly an Oracle “server leaving a 1 ms combined total for the other view—V$STATNAME—by using this ID.) process”—a process that is created by Oracle 19 occasions—a very small wait each time. • VALUE: the value of the statistic Database when a session is established—

November/december 2012 Oracle.com/oraclemagazine

ND12_TUNING.indd 52 10/1/12 4:56 PM Tuning 53

and that the process has been running for 1 Code Listing 3: All session statistics minute and 52 seconds. The next question,

then, is which Oracle Database session this select name, value process was created for. For that, you should from v$sesstat s, v$statname n where sid = 37 look into another view—V$PROCESS—where and n.statistic# = s.statistic# the SPID column shows the server process ID. order by value desc However, this view does not show the session / information, so you need to join this view NAME VALUE with the familiar V$SESSION view, as follows: ————————————————————————————————————————————————————————— ——————————————— table scan rows gotten 1.0236E+10 session logical reads 25898547 select sid consistent gets 25898543 from v$session s, v$process p table scan blocks gotten 25325165 where p.spid = 5946 session pga memory max 21250020 session pga memory 21250020 and s.paddr = p.addr; session uga memory max 20156552 session uga memory 20156552 SID bytes sent via SQL*Net to client 878760 recursive calls 576848 ——— opened cursors cumulative 143367 37 parse count (total) 143292 parse count (hard) 143118 table scans (short tables) 143086 Once you know the SID, you can get every- sql area evicted 141996 thing you need to know about the session— DB time 70007 the user who established the session, CPU used by this session 69724 the machine it came from, the operating … output truncated … system user, the SQL it is executing, and so on—from the V$SESSION view. This script for getting the information was described tion was recent or if the session has been performing a multiple-table Cartesian join, in Listing 5 in “Beginning Performance chewing it up since the beginning. This is which is bound to consume a lot of CPU. At Tuning,” in the July/August 2012 issue of where the V$SESSTAT view comes in very this point, you may decide to kill the session Oracle Magazine. To find the SQL being run handy—it shows the resource consump- to stop the high CPU consumption, or you by session 37, use this query: tion (CPU in this case) by a specific session. may decide to let it run for now and fix the To find out the CPU used by session 37, you SQL later to avoid the Cartesian product. select sql_fulltext would use the following query: from v$sql l, v$session s All Statistics where s.sid = 37 select s.value Let’s revisit the current problem by checking and l.sql_id = s.sql_id; from v$sesstat s, v$statname n the CPU consumption once again with this: where s.sid = 37 Here is the output: and n.statistic# = s.statistic# select s.valuez and n.name = 'CPU used by this session'; from v$sesstat s, v$statname n select max(test1.owner) where s.sid = 37 from test1, test2, test2, test2, VALUE and n.statistic# = s.statistic# test2, test2, test2, test2, ————— and n.name = 'CPU used by this session'; test2, test2, test2, test2, 47379 test2, test2, test2, test2, VALUE test2, test2, test2, test2, The output shows the number of CPU ————— test2, test2, test2, test2; “ticks” that have been consumed by this 69724 session since it started. Considering that This SQL is performing multiple Cartesian this session has been running for about two Now the result—the CPU used—is 69,724. joins, so it’s no wonder it’s consuming so minutes, the CPU consumption is pretty Note that this number is larger than the much CPU and memory. high, so it is likely that this session has been number the last time I checked CPU usage Now that you have found the culprit, consuming CPU all the time. Again, checking (47,379). This is because the statistic value should you just go ahead and kill the session the session’s other details, such as the SQL increases over time. The first time I checked to release the CPU consumption? Not so fast. it is executing, makes it fairly easy to under- CPU usage, I surmised that the multitable First, you need to know if the CPU consump- stand why this is the case: the session is Cartesian product was to blame for that

oracle magazine November/december 2012

ND12_TUNING.indd 53 10/1/12 4:57 PM 54 Tuning

CPU consumption—but can I prove it? The both the rapid switching of redo logs and which is used to determine the data traffic answer is a resounding “Yes, I can, using the creation rate and number of archived from the client other statistics.” logs. This may cause an increase in overall These are just a few of the 604 such sta- Listing 3 shows the query for gathering all I/O on file systems (or Oracle Automatic tistics available in the V$SESSTAT view. It is the statistics for session 37. In the output, Storage Management disk groups), causing not possible to describe each one of them, note the “table scan rows gotten” statistic a systemwide performance issue. To alle- but I hope you get the general idea of how value: 1.0236E+10—about 10 billion rows! viate this type of issue, you need to locate to use statistics to see the various resources This is indeed a very high number of rows to the session or sessions that caused the used by a session and focus on performance be accessed by one session in two minutes. generation of high amounts of redo, but issues. (Note that there is another view— The value for the “consistent gets” sta- looking at OS metrics will not provide any V$SYSSTAT—that shows the statistics of the tistic is 25,898,543—about 25.9 million insights into the offending session. In entire instance.) blocks read from the buffer cache. The high this case, you need to look at the sessions number of buffer gets takes up a consider- responsible for most of the load: the ses- Conclusion able amount of CPU. sions generating maximum redo. Again, In this article, you learned about two very Another cause of CPU consumption is the this information is available quite easily in important sources of performance tuning parsing of SQL statements. In the output the same V$SESSTAT view. The following information in Oracle Database: (1) the in Listing 3, note the “parse count (total)” query shows the sessions generating the history of wait events experienced by ses- statistic, a very high number at 143,292. In most redo: sions—visible in V$SESSION_EVENT, and plain English, it means that the session had (2) the resource consumption by session— to parse—not just execute—SQL statements select sid, value visible in V$SESSTAT. From the history, you that many times in about two minutes, which from v$sesstat s, v$statname n can find out why a session has waited in the is quite unusual. Examine the SQL state- where n.statistic# = s.statistic# past and for how long—very useful informa- ment executed by the session (shown in the and n.name = 'redo size' tion for diagnosing performance issues when script test2.sql script in the example setup order by value desc; they are no longer present. The resource in the online version of this article). You can statistics show the consumption of various see that it creates distinct literal SQL state- SID VALUE resources such as CPU, memory, and redo by ments. Each literal SQL statement needs ———— ———————— a specific session—very useful for focusing to be parsed, which is something you have 13 11982752 on resource-hogging sessions. Using these confirmed by looking at the parse count. 10 3372240 two views and scripts mentioned in this Therefore, you surmise from the Listing 3 17 964912 article, you can resolve many performance output that there are two causes of high 26 571324 issues encountered in Oracle Database CPU usage for this session: a high number of … output truncated … instances. Happy tuning!  buffer gets and a high number of parses. In Listing 3, also note two other sets of It’s clear from the output that SID 13 pro- Arup Nanda (arup@ statistics: “session pga memory max” and duced most of the redo, followed by SID 10, proligence.com) has been “session uga memory max,” which indicate and so on. an Oracle DBA since 1993, the total memory consumed by the session. The online version of this article at bit.ly/ handling all aspects of The very high numbers explain the high U8ml8P describes how to find the SQL state- database administration, memory consumption by the Oracle server ment that is generating the redo, provides a from performance process that you noticed in the output of replacement SQL statement, and tests that tuning to security and disaster recovery. He was the operating system top command earlier. new statement for redo generation. Oracle Magazine’s DBA of the Year in 2003 and If you want to reduce the CPU and memory Enterprise Architect of the Year in 2012. consumption of the server, you need to make Other Statistics sure the session consumes fewer of these I’ve shown you how to use the redo size, Next Steps resources, by appropriately modifying the session pga memory max, and CPU statistics SQL statement it issues. used by a session. Here are some other useful READ statistics visible in the V$SESSTAT view: online-only article content bit.ly/U8ml8P redo spike • physical reads: the number of database “Beginning Performance Tuning” Occasionally you may have a performance blocks retrieved from disk bit.ly/SdU9j8 issue that will not appear as clearly at the • db block changes: the number of database LEARN more about performance tuning OS level as CPU and memory consumption. blocks changed in the session Oracle Database 2 Day + Performance Tuning One such case is redo generation by the • bytes sent via SQL*Net to client: the bytes Guide 11g Release 2 (11.2) bit.ly/O0xhbH database instance, which, in turn, increases received from the client over the network,

November/december 2012 Oracle.com/oraclemagazine

ND12_TUNING.indd 54 10/1/12 4:57 PM Exadata Replaces IBM Again

Giant European Retailer Moves Databases from IBM Power to Exadata

IBM Building Smarter Planets

Oracle Building Faster Computers

For more details oracle.com/EuroRetailer

Full rack Exadata V2 (64 cores, 576 GB memory) running Oracle 11g with SAS high performance storage replaced an IBM Power 595 server (48 CPUs, 168 GB memory) running Oracle 10g with HP XP24000 storage. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Untitled-4 1 10/25/12 1:12 AM

PUB NOTE: Please use center marks to align page. Print Ad Job No.: 213M_EXD_EuroRTLvsIBM PRODUCTION NOTES READER LASER% RELEASED Headline: Exadata Replaces IBM Again Date: 09/12/2012 Project: Master Print Ad 9/12 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 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 Database Application Developer and DBA SQL 101 By Melanie Caffrey 57

Oracle Database Selecting a Type That Is Right for You Part 8 in a series on the basics of the relational database and SQL

art 7 in this series, “From Floor to Last Two Digits of Current Year Two-Digit Year Specified in Query Century Referred To Ceiling and Other Functional Cases” P Between 00 and 49 Between 00 and 49 Current (Oracle Magazine, September/October Between 00 and 49 Between 50 and 99 Previous 2012), introduced common SQL number Between 50 and 99 Between 00 and 49 Next functions and showed how your queries Between 50 and 99 Between 50 and 99 Current can use them to modify the appearance of Table 1: Relationship among current year, two-digit year specified, and the century referred to as a result numeric result set data. It also introduced SQL substitution functions and showed Code Listing 1: Display date data in the Oracle Database default date format how you can use them to manipulate result set data to convey more-meaningful results. Similarly, you can use SQL date SQL> set feedback on SQL> select first_name, last_name, hire_date functions and datatype conversion func- 2 from employee tions to manipulate data so that it displays 3 order by hire_date desc, last_name, first_name; differently from how it is stored in the FIRST_NAME LAST_NAME HIRE_DATE database. This article introduces you to ———————————————————————————————————————————— ———————————————————————————————————————————— ————————————— some of the more commonly used SQL date Theresa Wong 27-FEB-10 functions, along with some useful datatype Thomas Jeffrey 27-FEB-10 mark leblanc 06-MAR-09 conversion functions. michael peterson 03-NOV-08 To try out the examples in this series, Roger Friedli 16-MAY-07 you need access to an Oracle Database Betsy James 16-MAY-07 Matthew Michaels 16-MAY-07 instance. If necessary, download and install Donald Newton 24-SEP-06 an Oracle Database edition for your oper- Frances Newton 14-SEP-05 ating system from bit.ly/fherki. I recom- Emily Eckhardt 07-JUL-04

mend installing Oracle Database, Express 10 rows selected. Edition 11g Release 2. If you install the Oracle Database soft- Code Listing 2: Display date data in a different format by using TO_CHAR with a format mask ware, choose the installation option that enables you to create and configure a data- base. A new database, including sample user SQL> select first_name, last_name, TO_CHAR(hire_date, 'YYYY-MM-DD') hire_date 2 from employee accounts and their associated schemas, will 3 order by hire_date desc, last_name, first_name; be created for you. (Note that SQL_101 is the user account to use for the examples in this FIRST_NAME LAST_NAME HIRE_DATE ———————————————————————————————————————————— ———————————————————————————————————————————— ——————————————— series; it’s also the schema in which you’ll Thomas Jeffrey 2010-02-27 create database tables and other objects.) Theresa Wong 2010-02-27 When the installation process prompts you mark leblanc 2009-03-06 michael peterson 2008-11-03 to specify schema passwords, enter and Roger Friedli 2007-05-16 confirm passwords for SYS and SYSTEM and Betsy James 2007-05-16 make a note of them. Matthew Michaels 2007-05-16 Donald Newton 2006-09-24 Finally—whether you installed the Frances Newton 2005-09-14 database software from scratch or have Emily Eckhardt 2004-07-07 access to an existing Oracle Database 10 rows selected. instance—download, unzip, and execute

oracle magazine November/december 2012

ND12_SQL_101.indd 57 10/2/12 11:46 AM 58 SQL 101

the SQL script available at bit.ly/OzGgwj to Code Listing 3: Default date format mask is used when optional parameter is not provided create the tables for the SQL_101 schema

that is required for this article’s examples. SQL> select first_name, last_name, TO_CHAR(hire_date) hire_date_formatted (View the script in a text editor for execution 2 from employee 3 order by hire_date_formatted desc, last_name, first_name; instructions.) Some of the examples also

use the DUAL table. Recall that DUAL is an FIRST_NAME LAST_NAME HIRE_DATE Oracle system table owned by the SYS user, ———————————————————————————————————————————— ———————————————————————————————————————————— ————————————— Thomas Jeffrey 27-FEB-10 not the SQL_101 schema. DUAL contains Theresa Wong 27-FEB-10 no meaningful data itself, but it is useful to Donald Newton 24-SEP-06 query it as a way to experiment with func- Roger Friedli 16-MAY-07 Betsy James 16-MAY-07 tions that work on literals. Matthew Michaels 16-MAY-07 Frances Newton 14-SEP-05 The Perfect Format for Your Date Emily Eckhardt 07-JUL-04 mark leblanc 06-MAR-09 The DATE datatype is stored in Oracle michael peterson 03-NOV-08 Database in an internal format that consists of both date and time infor- 10 rows selected. mation: the century, year, month, day, hour, minute, and second. For input and Code Listing 4: Use the TO_DATE conversion function in a WHERE clause output of dates, every Oracle Database

instance has a default date format model SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY') hire_date (also called a mask) that is set by the 2 from employee NLS_DATE_FORMAT initialization param- 3 where hire_date > TO_DATE('01-JAN-2008', 'DD-MON-YYYY') 4 order by hire_date desc, last_name, first_name; eter. (Initialization parameters determine the default settings for Oracle Database FIRST_NAME LAST_NAME HIRE_DATE instances. Users who have appropriate per- ———————————————————————————————————————————— ———————————————————————————————————————————— ———————————————— Thomas Jeffrey 27-FEB-2010 missions can change some of these param- Theresa Wong 27-FEB-2010 eters on a per-database, per-instance, or mark leblanc 06-MAR-2009 per-session basis.) When you first query michael peterson 03-NOV-2008

the data stored in a table column with a 4 rows selected. DATE datatype, Oracle Database displays it with a format mask of either DD-MON- Code Listing 5: Error when the format mask does not match the provided string literal YYYY or DD-MON-RR, depending on which is set as the default. The RR format mask, which represents SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY') hire_date 2 from employee a two-digit year, was introduced to deal 3 where hire_date > TO_DATE('01-JAN-2008', 'MM/DD/RR') with end-of-century issues such as the Y2K 4 order by hire_date desc, last_name, first_name; problem. With RR, a two-digit year can refer where hire_date > TO_DATE('01-JAN-2008', 'MM/DD/RR') * to a year in the previous, current, or next ERROR at line 3: century—depending on the current year and ORA-01858: a non-numeric character was found where a numeric was expected the two-digit year specified in the query. Table 1 shows the relationship between Code Listing 6: Implicit date conversion (not recommended) returns a result set the current year, the range of two-digit year combinations, and the corresponding SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY') hire_date century referred to as a result. 2 from employee For example, the last two digits of the 3 where hire_date > '01-JAN-2008' current year (2012) are 12, which falls 4 order by hire_date desc, last_name, first_name;

between 00 and 49. A SQL query issued FIRST_NAME LAST_NAME HIRE_DATE during 2012 that specifies an RR year value ———————————————————————————————————————————— ———————————————————————————————————————————— ———————————————— of 15, therefore, refers to the year ending in Thomas Jeffrey 27-FEB-2010 Theresa Wong 27-FEB-2010 15 (2015) in the current century (the twenty- mark leblanc 06-MAR-2009 first), because 15 is between 0 and 49. A michael peterson 03-NOV-2008 query issued in 2012 that specifies an RR 4 rows selected. year value of 98 refers to the year ending in

November/december 2012 Oracle.com/oraclemagazine

ND12_SQL_101.indd 58 10/2/12 11:47 AM SQL 101 59

98 (1998) in the previous century (the twen- Code Listing 7: Attempted implicit date conversion fails tieth), because 98 is between 50 and 99.

The query in Listing 1 uses the SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY') hire_date EMPLOYEE table in the sample schema for 2 from employee 3 where hire_date > '01/01/2008' this article. The query displays employees 4 order by hire_date desc, last_name, first_name; sorted from most recent to least recent date where hire_date > '01/01/2008' of hire. As you can see, the hire date data * ERROR at line 3: is displayed in DD-MON-RR format. For ORA-01843: not a valid month example, it shows that Roger Friedli was hired on 16-MAY-07. To change the way this data is displayed, you use the TO_CHAR Code Listing 8: Find the default date format for your current session conversion function in conjunction with a format model of your choosing. (You had a SQL> select sys_context ('USERENV', 'NLS_DATE_FORMAT') brief introduction to TO_CHAR­ in the last 2 from dual;

installment, where you saw that it can be SYS_CONTEXT('USERENV','NLS_DATE_FORMAT') used to convert a number to a text string.) —————————————————————————————————————————————————————————————————————————————————————————————————————————— The query in Listing 2 modifies the way DD-MON-RR

the date data from Listing 1 is displayed. 1 row selected. To convert data of DATE datatype to a spe- cific date format model, TO_CHAR takes Code Listing 9: Display the time component of a value with a DATE datatype one required parameter and one optional parameter. The required parameter is data of DATE datatype from a column, expression, SQL> set lines 32000 SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY HH:MI:SS') or literal. The optional parameter is a textual hire_date format-mask representation of the date to 2 from employee be displayed. In Listing 2, the default format 3 order by hire_date desc, last_name, first_name;

mask of DD-MON-RR is changed to display FIRST_NAME LAST_NAME HIRE_DATE as YYYY-MM-DD. —————————————————————————————————————— —————————————————————————————————————— —————————————————————————————— Listing 3 demonstrates that the second Thomas Jeffrey 27-FEB-2010 12:00:00 Theresa Wong 27-FEB-2010 09:02:45 parameter for TO_CHAR is optional. If it is Donald Newton 24-SEP-2006 12:00:00 left off, the format mask of the date data Roger Friedli 16-MAY-2007 12:00:00 returned will simply be the default format Betsy James 16-MAY-2007 12:00:00 Matthew Michaels 16-MAY-2007 12:00:00 mask. Note also that the datatype of the Frances Newton 14-SEP-2005 12:00:00 date returned is VARCHAR2. The output Emily Eckhardt 07-JUL-2004 12:00:00 from Listing 3 is sorted by HIRE_DATE in mark leblanc 06-MAR-2009 12:00:00 michael peterson 03-NOV-2008 12:00:00 descending order, but in character, not date, descending order. So, be aware that when 10 rows selected. you apply the TO_CHAR conversion function, your data is returned as character strings; you should plan and sort accordingly. that the TO_DATE conversion function can and explicitly specify an appropriate format be used in WHERE clauses as well as SELECT mask. This way, your statement can be Dates with Strings Attached lists. The TO_DATE function is applied to the interpreted independently of any database, Just as you can convert a date to a string, string literal 01-JAN-2008, with a format instance, or session default date settings. you can convert a string literal to a date. The mask that helps the database interpret the Oracle Database will perform implicit date resulting expression can be compared with supplied literal as a date. conversion where it can, if (and only if) the any other column’s data of DATE datatype When you provide a format mask to the literal is already in the default date format. or another date expression. You perform the TO_DATE function, the mask you choose However, I do not recommend that you allow conversion by applying the TO_DATE con- must be the same as the one used in the it to do so, because your code will be more version function to a text string, as shown string literal you supply. If the two do not fragile and less likely to perform well long- in Listing 4. The query in Listing 4 not only agree, you will receive an error message term. Listing 6 shows a query that relies on returns all employees whose HIRE_DATE similar to the one shown in Listing 5. When the default date format in Oracle Database value is found to be greater than the date you convert a text literal, it is good practice and its ability to perform implicit date con- value 01-JAN-2008; it also demonstrates to use the TO_DATE conversion function version on a string literal. Compare the result

oracle magazine November/december 2012

ND12_SQL_101.indd 59 10/2/12 11:48 AM 60 SQL 101

in Listing 6 with that in Listing 7, which also with the values in the HIRE_DATE column of always use the TO_DATE function on date attempts to perform an implicit date conver- the EMPLOYEE table. string literals. One way to find out which sion. The query in Listing 7 fails because the Because the default date format can be default date format your current session is database cannot interpret the date format changed, it is best not to allow your queries to using is to execute the query shown in mask of the literal value being compared rely on an expected default format. Instead, Listing 8. The SYS_CONTEXT function can be used by any session (and, therefore, any user) Code Listing 10: WHERE clause using TO_DATE might not capture all possible values to see current session attributes.

SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY HH:MI:SS') Taking Time with Your Dates hire_date Recall that the Oracle DATE datatype 2 from employee 3 where hire_date = TO_DATE('27-FEB-2010', 'DD-MON-YYYY') includes a time component. You can either 4 order by last_name, first_name; ignore the time component, as the exam- ples in this article have done so far, or you FIRST_NAME LAST_NAME HIRE_DATE —————————————————————————————————————— —————————————————————————————————————— —————————————————————————————— can include it for display or comparison pur- Thomas Jeffrey 27-FEB-2010 12:00:00 poses. Listing 9 shows a query that includes the time component from each HIRE_DATE 1 row selected. value for every employee listed in the EMPLOYEE table. Note that all the employee Code Listing 11: Truncate the time from a DATE value to return all records for a particular day records except the one for Theresa Wong show a time value of 12:00:00. If you do not SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY HH:MI:SS') include a time when inserting a value into hire_date a column with a DATE datatype, the time 2 from employee 3 where TRUNC(hire_date) = TO_DATE('27-FEB-2010', 'DD-MON-YYYY') will default to midnight (12:00:00 a.m. 4 order by last_name, first_name; or 00:00:00 military time). To display or compare a date value in military time, use FIRST_NAME LAST_NAME HIRE_DATE —————————————————————————————————————— —————————————————————————————————————— —————————————————————————————— the HH24 format mask instead of HH. Thomas Jeffrey 27-FEB-2010 12:00:00 Unless you know the exact time of the Theresa Wong 27-FEB-2010 09:02:45 date values on which you’d like to filter—or

2 rows selected. unless all the time portions for your date values are already set to midnight—using date values in your WHERE clauses can Code Listing 12: Date range that returns records for a particular day produce unexpected results. Consider the query in Listing 10. You know from the SQL> select first_name, last_name, TO_CHAR(hire_date, 'DD-MON-YYYY HH:MI:SS') results in the previous listings that two hire_date 2 from employee employees were hired on February 27, 2010, 3 where hire_date >= TO_DATE('27-FEB-2010', 'DD-MON-YYYY') yet only one is returned in Listing 10’s 4 and hire_date < TO_DATE('28-FEB-2010', 'DD-MON-YYYY') result set. The reason is that the TO_DATE 5 order by last_name, first_name; function in the WHERE clause does not FIRST_NAME LAST_NAME HIRE_DATE specify an exact time, so Oracle Database —————————————————————————————————————— —————————————————————————————————————— —————————————————————————————— assumes that the time is midnight and Thomas Jeffrey 27-FEB-2010 12:00:00 Theresa Wong 27-FEB-2010 09:02:45 returns only those records that contain the specified date value and midnight as the 2 rows selected. time component.

Code Listing 13: The SYSDATE function Cutting Your Date Short When you would like to be able to filter on

SQL> select SYSDATE, TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') sysdate_with_time a certain date but do not want to have to 2 from dual; include each individual time component, you can use a couple of different methods. SYSDATE SYSDATE_WITH_TIME ————————————— —————————————————————————————— One method is to include the TRUNC func- 08-AUG-12 08-AUG-2012 14:25:08 tion (introduced in the previous installment in this series). It, like the TO_CHAR func- 1 row selected. tion, works not only on numbers but also on

November/december 2012 Oracle.com/oraclemagazine

ND12_SQL_101.indd 60 10/2/12 11:48 AM SQL 101 61

date values. The TRUNC function helps cut into a date only value to be compared with a table column has the effect of ensuring off the time portion of a date if no optional the corresponding date only value returned that an index on the column might never be format parameter is passed to it. This can from the result of applying the TO_DATE used. Also, this function would be applied be useful for date comparison purposes. function on the literal string 27-FEB-2010 to every value in that column for every row. Listing 11 shows a revised version of the with a date-only format. Both actions are extreme performance query from Listing 10. As you can see, elimi- Be aware, however, that you might sac- inhibitors. Therefore, another method you nating the time portion of the values in the rifice performance by applying a function can use is to specify a date range outside HIRE_DATE column enables the compar- to your table column values in a WHERE of the date(s) you would actually prefer to ison against the date value 27-FEB-2010 to clause. Indexes (used to assist with data filter on. The query in Listing 12 retrieves the retrieve all records with a HIRE_DATE value access efficiency—and not discussed in this same result set as the query in Listing 11. of 27-FEB-2010, irrespective of the time. series) can improve query performance in The difference between the two is that the The truncated HIRE_DATE value is made certain situations. Applying a function to query in Listing 12 does not apply a function to the HIRE_DATE column data. Instead, it Code Listing 14: SYSDATE used in date arithmetic chooses a range just outside of the desired date(s) and encloses the filtered date data inside this range of values. SQL> select SYSDATE, (TO_DATE('01-JAN-2013', 'DD-MON-YYYY') - TRUNC(SYSDATE)) Days_till_2013 2 from dual; A System for Getting Your Dates Right SYSDATE DAYS_TILL_2013 ————————————— ————————————————————— You will often need to perform date arith- 08-AUG-12 146 metic. A useful built-in function (one already built into Oracle Database) is 1 row selected. SYSDATE. This function returns the current date and time that are set on the operating Code Listing 15: SYSDATE and date arithmetic combined with DATE data system of the computer on which the database resides. It takes no parameters. SQL> select substr(last_name, 1, 10) last_name, substr(first_name, 1, 10) Listing 13 shows an example of using the first_name, hire_date, ROUND(MONTHS_BETWEEN(TRUNC(SYSDATE), TRUNC(HIRE_ SYSDATE function to return and display DATE))/12, 2) YEARS_OF_SERVICE 2 from employee the current date and time. 3 order by years_of_service desc, last_name, first_name; SYSDATE can be extremely useful in date arithmetic. Listing 14 shows how many LAST_NAME FIRST_NAME HIRE_DATE YEARS_OF_SERVICE —————————————— ——————————————— ————————————— ———————————————————————— days are left in 2012 from the current date Eckhardt Emily 07-JUL-04 8.09 (August 8, 2012, in the example). Note that Newton Frances 14-SEP-05 6.9 if the SYSDATE value were not truncated, Newton Donald 24-SEP-06 5.88 Friedli Roger 16-MAY-07 5.23 the returned DAYS_TILL_2013 value would James Betsy 16-MAY-07 5.23 include some fraction of the SYSDATE Michaels Matthew 16-MAY-07 5.23 value (to account for the time component). peterson michael 03-NOV-08 3.77 leblanc mark 06-MAR-09 3.42 Because it is truncated, however, the entire Jeffrey Thomas 27-FEB-10 2.45 current date is subtracted from January 1, Wong Theresa 27-FEB-10 2.45 2013, to arrive at the result of 146 days left

10 rows selected. in the year. Listing 15 uses SYSDATE and date arithmetic (using a date function called MONTHS_BETWEEN) against the Code Listing 16: BETWEEN operator uses midnight in a date range comparison HIRE_DATE column of the EMPLOYEE table, to show the number of years of service for SQL> select last_name, first_name, hire_date each employee. 2 from employee 3 where hire_date BETWEEN TO_DATE('26-FEB-2010', 'DD-MON-YYYY') Another method for performing date 4 AND TO_DATE('27-FEB-2010', 'DD-MON-YYYY'); arithmetic is to use the BETWEEN operator, as demonstrated by the query in Listing 16. LAST_NAME FIRST_NAME HIRE_DATE ———————————————————————————————————————————— ———————————————————————————————————————————— ————————————— Be aware, however, that the BETWEEN Jeffrey Thomas 27-FEB-10 operator uses the midnight (or 00:00:00) time component of the upper-range value 1 row selected. in a date-range comparison. To include all

oracle magazine November/december 2012

ND12_SQL_101.indd 61 10/2/12 11:48 AM 62 SQL 101

possible values for the date specified in the know the pitfalls to be aware of when you NEXT STEPS upper range of the date comparison, ensure use DATE comparisons in WHERE clauses that the date includes the full time compo- with TO_DATE and BETWEEN—and what READ SQL 101, Parts 1–7 nent of your upper range. In the example you can do to avoid unexpected results. bit.ly/omagsql101 in Listing 16, an upper-range date value of By no means has this article provided an LEARN more about date and datatype 27-FEB-2010 23:59:59 would have allowed exhaustive list of the Oracle Database date conversion functions both employee records with a HIRE_DATE and datatype conversion functions. You can bit.ly/PR7GQh bit.ly/NOgf01 value of 27-FEB-2010 to be included in the review the documentation for more details result set. at bit.ly/PR7GQh and bit.ly/NOgf01. READ more about relational database design and concepts The next installment of SQL 101 will Oracle Database Concepts 11g Release 2 (11.2) CONCLUSION discuss aggregate functions. t bit.ly/aonqPP This article has shown you a few of the Oracle Database SQL Language Reference 11g most common date functions and how they Release 2 (11.2) bit.ly/yWtbz1 can be used to manipulate the way data is Melanie Caffrey is Oracle SQL Developer User’s Guide Release 3.1 displayed. You’ve seen how to use the TO_ a senior development bit.ly/I9w52z CHAR and TO_DATE conversion functions manager at Oracle. She is Oracle Database development essentials and have learned the differences between a coauthor of Expert Oracle Database 2 Day Developer’s Guide 11g them. You now know that dates all contain PL/SQL Practices Release 2 (11.2) bit.ly/OzNal3 a time component that can be used or trun- for Oracle Developers DOWNLOAD the sample script for cated according to your needs. You’ve been and DBAs (Apress, 2011) and Expert Oracle this article introduced to the SYSDATE function and Practices: Oracle Database Administration from bit.ly/OzGgwj date arithmetic. Last but not least, you now the Oak Table (Apress, 2010).

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

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_SQL_101.indd 62 10/2/12 11:49 AM Database Application Developer and DBA Ask Tom by Tom Kyte 63

Oracle Database On External Table Queries, Data Consistency, and Nothing Our technologist queries the operating system, locks manually, and uses the right NULL.

n some of my customer’s databases, the place a small shell script that will produce table. As you can see from the output in I DBAs are using datafiles with automatic the df output: Listing 1, all I need to do is have the external extension but with many datafiles sharing table skip the first record and then parse the same file system, such as SQL> create or replace each subsequent line, using white space as a 2 directory exec_dir delimiter. This is something an external table tablespace A, datafiles /u01/oradata/ts_A_ 3 as '/home/tkyte/df' can do easily, as shown in Listing 2. file01.dbf autoextend unlimited 4 / With the df external table created, I can tablespace B, datafiles /u01/oradata/ts_B_ Directory created. now review the df output easily in a query, as file01.dbf autoextend unlimited shown in Listing 3. Next, I’ll create a shell script named run_ Note: Hopefully you see how this and so on. The requested extension is that all df.sh in that directory. This script will contain approach could work easily for ps, ls, du, and datafiles must be capable of growing by at only the following: so on—all the UNIX utilities could easily be least 20 percent of their current size, so if, considered “tables” now! for example, ts_A_file01.dbf currently is #!/bin/bash With this data available to me in the df 100 GB and ts_B_file01.dbf is 200 GB, we /bin/df –Pl external table, it is easy to start working must ensure that at least 20 + 40 = 60 GB is on the query. All I need to do is join df to free in the /u01/oradata file system. And the output of that script will look DBA_DATA_FILES with a join condition that The question is: how can we monitor this something like Listing 1. matches the longest mount point possible in a single query inside the database? Right Note that in the run_df.sh script, I used to each filename. Before I do this, however, now we have a complex script gathering free explicit pathnames to run df—I did not rely I’m going to change my df output for testing space from the df command in a text file, on the environment and on the path environ- purposes. Because I have a rather small file opening a cursor, calculating the current ment variable in particular. This is very impor- system with just one mount point and I want allocated space from DBA_DATA_FILES, and tant: when coding scripts for external tables— to test my logic, I’m going to “fake” my df data reading the df data via an external table. when coding scripts in general!—you always by changing the script as shown in Listing 4. This can be done in a single SQL query. want to use explicit paths to run the program Instead of running df, I’ll fake the output To accomplish this, I’ll need to be able to you actually intend to run. You don’t have any by echoing two possible mount points for query disk free (df) interactively—without a real control over the environment this script the datafiles. Also, I’ll be able to change the complex set of maneuvers such as running will run in, so relying on the environment available amount of data to test for the 20 a script or redirecting output. I’ll start by being set a certain way is a recipe for disaster. percent datafile extension condition. making it so that the df output can be queried So, now that I have the script and the My single-query solution to the issue in as if it were in a table. I’ll be relying on a directory, I am ready to create the external this question is in Listing 5. Here’s what’s feature first added in Oracle Database 11g Release 2 but subsequently back-ported Code Listing 1: Output of the df shell script to version 10.2.0.5 as well (so this works in Oracle Database 10g Release 2 and above). SQL> !./run_df.sh This feature is the preprocessor directive. Filesystem 1024-blocks Used Available Capacity Mounted on (I’ve written about this previously—go to /dev/mapper/VolGr... 18156292 10827600 6391528 63% / bit.ly/P9jdGT.) /dev/sda1 101086 12062 83805 13% /boot tmpfs 517520 0 517520 0% /dev/shm To start I’ll create a directory where I can

oracle magazine November/december 2012

ND12_asktom.indd 63 10/2/12 10:07 AM 64 Ask Tom

happening on some of the lines: reread the external table over and over and an error message at runtime: On lines 3 and 4, I query the df external the results of the df table could change as table. I purposely use a materialize hint to the query runs. This provides the logical KUP-04108 unable to reread file string force the optimizer to load the df data into equivalent of a consistent read on the df the equivalent of a global temporary table, data. Also, if the query plan did involve The documentation (bit.ly/OQ3PBT) because the query would tend to read and rereading the external table, I would receive explains the error: Cause: The query that is executing requires Code Listing 2: Creating the df external table that a datasource for an external table be read multiple times. However, the data- source is a sequential device that cannot be SQL> create table df 2 ( reread. Examples of this type of datasource 3 fsname varchar2(100), are a tape or pipe. 4 blocks number, Action: There are a few ways around this 5 used number, 6 avail number, problem. One is to rewrite the query so that 7 capacity varchar2(10), the external table is referenced only once. 8 mount varchar2(100) Another option is to move the datasource to 9 ) 10 organization external a rereadable device such as a disk file. A third 11 ( option is to load the data for the external table 12 type oracle_loader into a temporary table and change the query 13 default directory exec_dir 14 access parameters so that it references the temporary table. 15 ( On lines 27–30, I join DBA_DATA_FILES 16 records delimited to df data with a WHERE clause, using LIKE. 17 by newline 18 preprocessor This will join every file in DBA_DATA_FILES 19 exec_dir:'run_df.sh' to every possible mount point in the df 20 skip 1 output. I know that the goal, however, is to 21 fields terminated by 22 whitespace ldrtrim find the “longest” matching mount point, 23 ) so to accomplish that I assign—on lines 24 location 24–26—a ROW_NUMBER to each row. This 25 ( 26 exec_dir:'run_df.sh' ROW_NUMBER will be sequentially assigned 27 ) to each duplicated row in DBA_DATA_FILES, 28 ) so if the FILE_NAME matches more than 29 / Table created. one MOUNT, each FILE_NAME occurrence will be assigned a unique, increasing ROW_ NUMBER value. This ROW_NUMBER will Code Listing 3: Querying the df external table be assigned after the data is sorted by the length of the MOUNT, from big to small. SQL> select * from df; Once I have that data, I apply a WHERE

FSNAME BLOCKS USED AVAIL CAPACITY MOUNT clause to save only the first entry for each ————————————————————————————————————————————— ———————————— ————————————— —————————— ——————————— ——————————— FILE_NAME value—that predicate is WHERE /dev/mapper/VolGroup00-LogVol00 18156292 10827600 6391528 63% / rn = 1, on line 32. At the same time, I’ve /dev/sda1 101086 12062 83805 13% /boot tmpfs 517520 0 517520 0% /dev/shm added another column—TOT_BYTES—on lines 18-19. This will enable me to verify the 20 percent threshold. Code Listing 4: Fake data for df (for testing purposes) The last step is to format and output the data. I print the columns I’m interested in SQL> !cat run_df.sh and add a CASE statement on lines 11–15 to #!/bin/bash #/bin/df -Pl verify that 20 percent of the total bytes of storage allocated on a given mount point echo Filesystem 1024-blocks Used Available Capacity Mounted on does not exceed the remaining available echo /dev/mapper/VolG... 18156292 10827600 6391528 63% / echo /dev/mapper/VolG... 18156292 10827600 6391528 63% /home/ bytes of free storage. ora11gr2/app/ora11gr2/oradata/ora11gr2/ORA11GR2 So, now you see how to use external tables echo /dev/sda1 101086 12062 83805 13% /boot to query operating system output such as df, echo tmpfs 517520 0 517520 0% /dev/shm ps, and ls. Additionally, you can use them to

November/December 2012 Oracle.com/oraclemagazine

ND12_asktom.indd 64 10/2/12 10:07 AM Ask Tom 65

Code Listing 5: Single-query monitoring solution query anything that writes to standard out, including gunzip, sed, and so on. If you’d like

SQL> with fs_data to see an interesting example of using an 2 as external table to query multiple gzipped com- 3 (select /*+ materialize */ * pressed files, take a look at bit.ly/PQgOol. 4 from df 5 ) 6 select mount, Question on Locking 7 file_name, If Oracle Database provides automatic 8 bytes, 9 tot_bytes, locking and resolves deadlock situations 10 avail_bytes, automatically, why are there manual locking 11 case and deadlock solutions? 12 when 0.2 * tot_bytes < avail_bytes 13 then 'OK' There are many reasons. The automatic 14 else 'Short on disk space' locking falls into the 80/20 rule: 80 percent 15 end status of the time, it is sufficient. But devel- 16 from ( 17 select file_name, mount, avail_bytes, bytes, opers need to understand when locking is 18 sum(bytes) over something they must be concerned about. 19 (partition by mount) tot_bytes Here is one of the simplest reasons: loss of 20 from ( 21 select a.file_name, update detection. 22 b.mount, Suppose you have a table containing 23 b.avail*1024 avail_bytes, a.bytes, a primary key ID, names, addresses, and 24 row_number() over 25 (partition by a.file_name phone numbers. Further, there is an appli- 26 order by length(b.mount) DESC) rn cation that can read a row from this table, 27 from dba_data_files a, put it onscreen, and let end users update 28 fs_data b 29 where a.file_name the values. When a user clicks a button, the 30 like b.mount || '%' application will issue update table t set 31 ) name = :name, address = :address, phone = 32 where rn = 1 33 ) :phone where id = :id. 34 order by mount, file_name Now, think about what would happen if 35 / two people pulled up your record at about

MOUNT FILE_NAME BYTES TOT_BYTES AVAIL_BYTES STATUS the same time and one of them changed the ——————————— ———————————————————————————————————————————— —————————————— —————————————— ———————————————— ———————— address and the other changed your phone / /home/ora11gr2/app/ora11gr2/ 360710144 2410283008 6544924672 OK number. What would happen if they both oradata/ora11gr2/example01.dbf clicked the button now? / /home/ora11gr2/app/ora11gr2/ 1101004800 2410283008 6544924672 OK oradata/ora11gr2/sysaux01.dbf One update would succeed—say the one / /home/ora11gr2/app/ora11gr2/ 924844032 2410283008 6544924672 OK that changed your address. All would be well oradata/ora11gr2/system01.dbf and good so far. / /home/ora11gr2/app/ora11gr2/ 131072 2410283008 6544924672 OK The second update, to change your oradata/ora11gr2/system02.dbf phone number, would end up updating the / /home/ora11gr2/app/ora11gr2/ 23592960 2410283008 6544924672 OK entire row again, reverting your address to oradata/ora11gr2/users.dbf what it was before, and the address update /home/or /home/ora11gr2/app/ora11gr2/ 144703488 376438784 6544924672 OK would be lost. a11gr2/a oradata/ora11gr2/ORA11GR2/ pp/ora11 datafile/o1_mf_big_tabl_ In a client/server application, you might gr2/orad 7y3thv78_.dbf employ what is known as pessimistic con- ata/ora1 currency control. Before the application 1gr2/ORA 11GR2 lets you type over the address or the phone number, it will issue a SELECT * FROM t /home/or /home/ora11gr2/app/ora11gr2/ 231735296 376438784 6544924672 OK a11gr2/a oradata/ora11gr2/ORA11GR2/ WHERE id = :id AND name = :name AND pp/ora11 datafile/o1_mf_undotbs_ address = :address AND phone = :phone gr2/orad 78w1hprj_.dbf FOR UPDATE NOWAIT to manually lock the ata/ora1 1gr2/ORA record as long as the record still exists. If it 11GR2 does, great—you can modify the columns and be assured that the update will succeed 7 rows selected. and not overwrite anyone else’s changes. If

oracle magazine November/December 2012

ND12_asktom.indd 65 10/2/12 10:08 AM 66 Ask Tom

the SELECT returns zero rows, you’ll know Code Listing 6: Query of NULLs and a good plan that someone else modified the record and

that you have to requery the record before SQL> set autotrace traceonly explain you can modify it. If the query returns an SQL> select * 2 from t error message, you’ll know that someone 3 where end_date else is currently working on it. 4 between to_date( '01-sep-2010', 'dd-mon-yyyy' ) That is one reason for manual locking. 5 and to_date( '30-sep-2010', 'dd-mon-yyyy' ); Here is another situation. Suppose you have Execution Plan a business rule that says, “The total number ———————————————————————————————————————————————————————————————————————————————————————— of employees in a department cannot exceed Plan hash value: 1601196873 —————————————————————————————————————————————————————————————————————————————————————————————————————————————— 100.” How do you enforce that? You have to | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | make sure that when you make an insert into —————————————————————————————————————————————————————————————————————————————————————————————————————————————— the EMP table, no one else is inserting into | 0 | SELECT STATEMENT | | 36024 | 3588K| 339 (1)| 00:00:05 | |* 1 | TABLE ACCESS FULL| T | 36024 | 3588K| 339 (1)| 00:00:05 | that same department. You have to serialize. —————————————————————————————————————————————————————————————————————————————————————————————————————————————— You might use a DBMS_LOCK (user-defined Predicate Information (identified by operation id): lock) to do this, you might use the LOCK ——————————————————————————————————————————————————————————————————————————— 1 - filter(“END_DATE”<=TO_DATE(' 2010-09-30 00:00:00', 'syyyy-mm-dd TABLE command, you might use a select * hh24:mi:ss') AND "END_DATE">=TO_DATE(' 2010-09-01 00:00:00', from dept where deptno=:x for update 'syyyy-mm-dd hh24:mi:ss')) nowait to serialize at the department level, and so on. But you need a manual lock. Automatic locking covers 80 percent But what does this have to do with create an index on the END_DATE column of everything you need. You need manual NULL values? Nothing really—it has to do for retrieval purposes: locking for the rest to ensure logical data with what can happen when developers consistency. do not use a NULL value when they should SQL> create index t_idx have. Many times developers fear using 2 on t(end_date); NULLS and Cardinality NULLs: they do not understand them, and A few issues ago (bit.ly/NROO1a), I wrote up they do not believe they can be indexed, Index created. part of a presentation I delivered at Oracle so they avoid them. They will use a “fake” OpenWorld in 2011. It was from “Five Things value—such as 01-JAN-9999—to represent If I look at the data, I’ll discover that many You Probably Didn’t Know about SQL.” In a missing date value. This is a bad idea for of the values are clumped together in one that article, I said I’d be writing up other sec- many reasons; the first I’ll show you is how it month: tions of that presentation, and that is what can throw off cardinality estimates. I’m doing here. This time I’ll take a look at I’ll start with a table that uses a NULL SQL> select count(*) NULLs and their possible effect on cardi- value. This table will represent “effective- 2 from t nality estimates and index use. dated” records—that is, each record has an 3 where end_date I’ve written many times (see bit.ly/ effective start date and end date. If a record 4 between to_date('01-sep-2010', Pjrbyr, for example) about how important is “current”—that is, it doesn’t have an end 'dd-mon-yyyy') cardinality estimates are to the cost-based date yet—the end date will be NULL. Here is 5 and to_date('30-sep-2010', optimizer (CBO). In short, if the optimizer the CREATE TABLE statement for that table: 'dd-mon-yyyy'); guesses incorrectly how many rows will flow through steps in a query plan, you’ll probably SQL> create table t COUNT(*) get a bad plan and a poorly performing query. 2 pctfree 20 ————————————— For example, if the optimizer believes that it 3 as 36267 is going to retrieve 2 rows out of 1,000,000, 4 select a.*, it will likely choose to use an index if one 5 case when mod(rownum,100) <= 50 My ALL_OBJECTS view has about 72,000 is available. But what if, at runtime, you 6 then last_ddl_time records in it, so table T has about 72,000 discover you are not getting just 2 rows but 7 end end_date records, and half of them fall in the month 500,000? Then using the index will be the 8 from all_objects a; of September 2010. Next I’ll gather statistics worst-possible approach. on this table, and these statistics will include Getting the right estimated cardinality Table created. histograms on the END_DATE column. If values is important to the optimizer, and you are curious about how or why they have anything you do to throw that off—to make In this table, about half of the rows have histograms, refer to the “Why Does My Plan it harder to get the right estimate—is bad. an END_DATE and half are NULL. Next, I’ll Change?” section of bit.ly/PQnpPB.

November/December 2012 Oracle.com/oraclemagazine

ND12_asktom.indd 66 10/2/12 10:08 AM Ask Tom 67

Code Listing 7: Result of rerunning the Listing 6 query against fake data—and a bad plan Easy to fix, you might say: just don’t get NO TAGS as a license plate. Well, not so fast.

———————————————————————————————————————————————————————————————————————————————————————————————————————————————— Another motorist, Nick Vautier, wanted his | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| initials—NV—as his tag. In California, where ———————————————————————————————————————————————————————————————————————————————————————————————————————————————— he lives, the DMV had decided to use NV, for | 0 | SELECT STATEMENT | | 175 | 18375 | 10 (0)| | 1 | TABLE ACCESS BY INDEX ROWID| T | 175 | 18375 | 10 (0)| “not visible,” as its “no tags” value. |* 2 | INDEX RANGE SCAN | T_IDX | 175 | | 2 (0)| Alabama uses XXXXXXX as its “no tags” ———————————————————————————————————————————————————————————————————————————————————————————————————————————————— value, and a news article (bit.ly/RNuqUT) Predicate Information (identified by operation id): ———————————————————————————————————————————————————————————————————————————— about the car owner—Scottie Roberson— 1 - filter("END_DATE"<=TO_DATE(' 2010-09-30 00:00:00', 'syyyy-mm-dd who got that license plate, mentioned a pos- hh24:mi:ss') AND "END_DATE">=TO_DATE(' 2010-09-01 00:00:00', sible solution: “Birmingham Traffic Engineer 'syyyy-mm-dd hh24:mi:ss')) Gregory Dawkins says the city may change the system to keep Roberson from receiving SQL> begin However, what if the developer decides to more tickets. He says “maybe we just need to 2 dbms_stats.gather_table_ use a fake date instead of NULL? What will leave that part blank altogether.’” stats(user, 'T'); happen then? I’ll update the data and gather See bit.ly/OgmnJq for other examples. 3 end; statistics again: There is no good default value to represent 4 / data that is missing. Just use NULL.  PL/SQL procedure successfully completed. SQL> update t 2 set end_date = Tom Kyte is a database 3 to_date( '01-jan-9999', Now I’ll look at the data to understand it evangelist in Oracle’s 'dd-mon-yyyy' ) before I proceed: Server Technologies 4 where end_date is null; division and has worked SQL> select count(*), 35378 rows updated. for Oracle since 1993. He 2 count(distinct end_date), is the author of Expert 3 count(end_date), SQL> commit; Oracle Database Architecture (Apress, 2005, 4 min(end_date), Commit complete. 2010) and Effective Oracle by Design (Oracle 5 max(end_date) Press, 2003), among other books. 6 from t; SQL> begin 2 dbms_stats.gather_table_ Next Steps CNT CNTD CNT2 MIN MAX stats(user, 'T'); —————— ————— —————— ———————————— ————————————— 3 end; ASK Tom 72228 703 36850 01-OCT-02 30-SEP-11 4 / Tom Kyte answers your most difficult technology PL/SQL procedure successfully completed. questions. Highlights from that forum appear in this column. As you can see, there are 72,228 rows in asktom.oracle.com the table, with a low value of October 1, 2002 Now when I run the query in Listing 6 FOLLOW Tom on Twitter and a high value of September 30, 2011. I again, I see the results in Listing 7. @OracleAskTom know that about half of these rows fall into The optimizer has incorrectly estimated READ more Tom September 2010 (there is data skew). Also, it the cardinality for this predicate, leading it to bit.ly/omagasktomk has 703 distinct dates, which will affect the think an index would be appropriate when it Oracle Database Concepts 11g Release 2 (11.2) bit.ly/aonqPP type of histogram the optimizer can store. is not. This is all due to the fake values. Expert Oracle Database Architecture: Oracle Because there are more than 255 distinct Here is another reason to avoid fake Database 9i, 10g, and 11g Programming values, the optimizer will have access to a values. In Washington DC, a car owner Techniques and Solutions, Second Edition height-balanced, rather than frequency- decided to get a vanity (personalized ) license amzn.to/ckGXaR based, histogram. plate for his car. The license plate the owner DOWNLOAD Oracle Database 11g Now if I execute a query against this table, chose was NO TAGS. The owner chose it as a Release 2 bit.ly/epBiUG asking for the rows in September 2010, the joke, but guess what value the programmers LEARN more about optimizer will be able to intelligently come at the Department of Motor Vehicles (DMV) preprocessor directive up with a query plan, as shown in Listing 6. had decided to use (instead of NULL) to rep- bit.ly/P9jdGT Because the optimizer correctly estimated resent a missing license plate value? The title external tables that query files the cardinality of this query at 36,024, it knew of the news article (yhoo.it/NRUisL) about bit.ly/PQgOol to do a full table scan. Using an index would this is “DC Man’s ‘NO TAGS’ Vanity Plate cardinality and the cost-based optimizer bit.ly/Pjrbyr have been a bad idea. Earns Him $20,000 in Tickets.”

oracle magazine November/December 2012

ND12_asktom.indd 67 10/2/12 10:09 AM 68 Time Capsule Flashbacks: Culture. Industry. Oracle. Oracle Magazine. BY RICH SCHWERIN

INTERNATIONAL ORACLE USERS 1982 WEEK (IOUW) Imagine this: When Oracle was still called Relational Software Inc. (RSI), about 50 attendees from a dozen or so companies gathered in a small, windowless room at the San Francisco Grand Hyatt for the first International Oracle Users Week (actually just three days, August 23–25). After the inaugural event in San Francisco, the International Oracle Users Week (IOUW) went on tour; our ears are still ringing. 1986 Two Exhibitors IOUW GOES Oracle hosted IOUW 1981 NATIONWIDE at the Hyatt Regency in San Francisco with Moscone Center nearly 500 attendees Encompassing nearly 1 million square feet 1983: Boston and two exhibitors. During the conference, today, Moscone Center—San Francisco’s 1984: San Francisco 1985: San Diego a general user meeting largest convention center—opened in 1981 was held, and the 1986: San Francisco and played host to the 1984 Democratic International Oracle 1987: Washington DC Users Group (IOUG) Convention. 1988: Orlando was formed. 1989: Dallas 1990: Anaheim 1995 1991: Miami Going to California 1992: San Francisco During IOUW in Philadelphia, 1993: Orlando Oracle CEO Larry Ellison 1994: San Francisco announced via satellite that beginning in 1996 Oracle would 1995: Philadelphia take control of the conference, call it Oracle OpenWorld, and host it in California. 1996

Open Your Golden Gate Oracle OpenWorld ‘96 featured 420 sessions and 17,200 International Perspective visitors at San In addition to San Francisco, many other world-class cities have hosted Francisco’s their own Oracle OpenWorld conferences. Beijing, Copenhagen, Paris, Moscone Center. São Paulo, Tokyo, and more have welcomed Oracle OpenWorld and added 2002 their international flavor to it. Taxi! Take me to OracleWorld? REVISIONIST HISTORY Your Turn We asked our Facebook fans where and No, you’re not hallucinating and that’s From and to Journey when the first Oracle OpenWorld was held: not a typo. For two years (’02 and ‘03), and , the Oracle Appreciation the annual conference was simply called San Francisco, 1986 54% Event has hosted a number of major musical artists 30% OracleWorld. Have you heard people San Francisco, 1998 over the years. Who is your favorite? Anyone you Los Angeles, 1997 8% would like to see in the future? Visit Facebook/ talking about OracleWorld since 2003? Boston, 1983 8% OracleMagazine and let us know. bit.ly/orclmagfb BETTMANN/CORBIS, HARTMANN STUDIOS HARTMANN BETTMANN/CORBIS,

NOVEMBER/DECEMBER 2012 ORACLE.COM/ORACLEMAGAZINE

ND12_TimeCapsule.indd 68 10/2/12 10:28 AM See ORACLE TEAM USA World-Class Sailing, Cutting-Edge Technology, and the Best Viewing in Italy Photography: Guilain Grenier / ORACLE TEAM USA.

Join fans from around the world Venice: April 16–21, 2013 Naples: May 14 –19, 2013 as they gather in Italy to watch the It will be—quite literally— America’s Cup World Series events, the biggest thing in sports. featuring ORACLE TEAM USA. Find Out More oracleteamusa.com Stay Connected #oracleteamusa © ORACLE TEAM USA 2012. All rights reserved.

Untitled-4 1 10/25/12 1:19 AM

ORACLE CREATIVE PERSONNEL PRODUCTION NOTES APPROVALS DATE INTERNAL RD

File Name: 103490_OTUSA_OMAG_ Designer: I-Hua Chen/415.203.9048 Color: 4-color, 1-sided Designer: PROFIT_AD.ai Art Director: Francisco Delgadillo Printed at: 100% Art Director: Job No: 103490 Copywriter: Name/650.506.xxxx Fonts: Univers, Garamond Copywriter: Description: AD Proofer: Name/650.506.xxxx Paper: TBD Proofer Trim: 8" (W) x 10.875"(H) Traffic: Barbara Takauchi Other Special Instructions: Traffic: Live: n/a Production: Name/650.506.xxxx • Cyan keylines do not print Production: 2D Bleed: 8.25" (W) x 11.125" (H) Client: Laurent du Roure Client: 9-18-2012 Finished: 8" (W) x 10.875"(H) Released by: I-Hua Chen Released by: