Oracle Pro Tips, Trends & Technology eXTRA Pinnacle Publishing http://www.pinnaclepublishing.com Issue 3.4 March 19, 2002 TABLE OF CONTENTS 1) Pop Quiz (answer at the end) 2) Oracle News 3) Java Series -- Introduction to OC4J 4) Industry News 5) Answer To The Pop Quiz --------------------------------------------------------- 1) POP QUIZ (answer at the end) --------------------------------------------------------- How do you provide a query hint for an Oracle SQL statement? --------------------------------------------------------- 2) ORACLE NEWS --------------------------------------------------------- Last week, Oracle announced a 17 percent drop in overall third-quarter revenue and a 29 percent drop in software licensing revenue. According to the Forbes article, Oracle blamed the shortfall on a continued slow-down in IT spending, but the article challenged that assertion, citing revenue increases by Oracle's competitors. Find out more at: http://www.forbes.com/2002/03/15/0315oracle.html. --------------------------------------------------------- 3) JAVA SERIES -- INTRODUCTION TO OC4J --------------------------------------------------------- The following article is contributed by my colleague, Jim Skehill (mailto:jskehill@procaseconsulting.com), who has years of experience in Java application design and development. He graduated from the University of Toronto, and his current project is http://www.globeinvestorgold.com/. Enjoy! * * * * Oracle has been making a lot of noise on the Java front over the past six months. It began with a keynote address from Oracle CEO Larry Ellison at the JavaOne conference last June. The gist of the talk was that Oracle's new application server technology, Oracle Containers For J2EE (OC4J), could run circles around BEA's WebLogic and IBM's WebSphere. Ellison's talk and its confrontational tone was a clear shot across the bows of both BEA and IBM who, between them, have around 80% of the application server market. It made it clear that Oracle was out for a slice of that market: Oracle's battle for the middle tier had begun. Since then, Oracle has continued the marketing offensive and been busy integrating OC4J with Oracle 9i and the rest of its development environment. What I hope to do over the next few months is look past the marketing hype and consider what exactly Oracle's new application server technology means to the Java developer working on enterprise applications, particularly those that already involve the Oracle database. I'll take a look at the background and history of Oracle's philosophy and marketing strategy concerning Java. I'll examine what J2EE is and what is meant by an application server. I'll also discuss what was wrong with Oracle's old application server and how OC4J addresses those problems. I'll discuss the history of OC4J (it's actually technology that Oracle has licensed from a small Swedish company), its architecture, its features, its strengths and weaknesses. I'll examine Oracle's Java development environment, JDeveloper, analyzing what has changed in response to Oracle 9i and OC4J and what has stayed the same. I'll also give a few programming examples that you can use to kick the tires. When I'm finished, I hope you'll have a clearer idea of the worth of OC4J and whether it's the application server for you. --------------------------------------------------------- * PRESENTING: PINNACLE PUBLISHING ONLINE SEMINARS * --------------------------------------------------------- No airline ticket needed. No hotel reservation required! We've combined streaming audio with a complete slide presentation to deliver the benefits of a keynote without the expense of travel. And it's interactive. Submit your questions in a classroom-like setting, and the speaker will address them: Don't miss these upcoming information-packed events: * Demystifying ASP.NET -- March 27, 2002, presented by Bill Hatfield * Demystifying VB.NET -- April 17, 2002, presented by Rod Stephens * Demystifying C# -- April 24, 2002, presented by Brad Jones * Demystifying ADO.NET -- May 1, 2002, presented by Bill Vaughn All events are held at 1:00 pm EST. For more information and to register for these events, visit http://www.developerdiscoverylive.com. Or you can call our Pinnacle Publishing customer service department directly at 1-800-788-1900. --------------------------------------------------------- 4) INDUSTRY NEWS --------------------------------------------------------- According to industry sources, Sun Microsystems (http://www.sun.com/) has acquired Clustra Systems (http://www.clustra.com/) and will integrate it with Sun's iPlanet application server suite of products. Among other factors, Sun is probably interested in Clustra's "clustering" capability. The clustering technology ensures "high availability" of applications because services "are available despite emergencies or mishaps." Find out more at: http://story.news.yahoo.com/news?tmpl=story&u=/cn/20020318/tc_cn/sun_buys_high_end_software_company. --------------------------------------------------------- 5) ANSWER TO THE POP QUIZ --------------------------------------------------------- The hint is embedded inside a comment, and it appears immediately after the first keyword in the SQL statement. In the case of a SELECT statement, the syntax is: SELECT /*+ hint_name */ column_name, ... FROM ... Oracle will not raise an error if the hint text is malformed; it simply ignores it. You must use EXPLAIN PLAN to verify that your hints are actually being used. You can provide hints to override the default behavior of the Oracle optimizer. Using hints, you can instruct Oracle on how to access data and join tables. Let's discuss some of the more common hints. The RULE hint causes Oracle to use rule-based optimization. For instance, the following statement uses rule-based optimization: SELECT /*+ RULE */ * FROM emp WHERE emp_id > 0; The FULL(table_name) hint causes a full table scan, as shown below: SELECT /*+ FULL(e) */ * FROM emp e WHERE emp_id > 0; Without the hint, Oracle may decide to use an index scan to retrieve the data. If you know that the retrieved rows may constitute a large fraction of the total number of rows for the table (for instance, 30 percent), then it may be a good idea to use a full table scan. The INDEX(table_name index_name) hint allows you to specify an index for Oracle, as depicted below: SELECT /*+ INDEX(e emp_name_idx1) */ * FROM emp e WHERE e.last_name like 'C%'; In the example, Oracle will use the emp_name_idx1 index to retrieve the data. Note that one disadvantage with this approach is that we're "hard-coding" the index name. If we rename the index or change the database object naming conventions, then we may cause the query to work incorrectly. Other commonly used hints include ORDERED, USE_NL(table_name), and USE_MERGE(table_name), allowing you to specify the manner in which multiple tables are joined in a query. --------------------------------------------------------- Well, that's it for this week. I welcome your feedback, input, tips, suggestions, Web sites, and other Oracle- related news. If you send me something, please let me know whether I can use your name with your comments. I apologize in advance if I don't respond personally to each of your questions or suggestions, but I'll get to as many as I can in the eNewsletter if not personally. Garry Chan, Editor Database Architect mailto:GChan@ProcaseConsulting.com ORACLE PRO eXTRA To be removed from this mailing list, forward this message to pinnacleor-unlist@dsi-enews.net. (be sure to forward the ENTIRE message, or it will not unsubscribe you!) **********************************************************************