Oracle Pro Tips, Trends & Technology eXTRA Pinnacle Publishing www.pinnaclepublishing.com Issue 3.7 May 15, 2002 TABLE OF CONTENTS 1) Pop Quiz (answer at the end) 2) Did You Know ... 3) IT Industry News 4) Java Series 5) Oracle News 6) Answer to the Pop Quiz --------------------------------------------------------- 1) POP QUIZ (answer at the end) --------------------------------------------------------- In Oracle9i, how do you monitor index utilization? --------------------------------------------------------- 2) DID YOU KNOW... --------------------------------------------------------- * that you can subscribe to an Internet discussion group on Oracle topics? You can subscribe to it by sending an e-mail to mailto:LISTSERV@LISTS.SUNYSB.EDU and including the following message in the body text (not the subject line): SUBscribe ORACLE-L --------------------------------------------------------- 3) IT INDUSTRY NEWS --------------------------------------------------------- ACM technews www.acm.org/technews/articles/2002-4/0510f.html included an article published in Intelligent Enterprise on the future of database technology. The article was actually a roundtable discussion between NCR Teradata CTO Stephen Brobst, IBM Fellow Donald J. Haderle, Ken Jacobs of Oracle, and Stanford University professor Jeffrey D. Ullman. The panelists discussed issues with the existing technology and summarized industry efforts to address these issues. Of particular importance was their view on the integration between SQL and the emerging XML technology. Find out more about the survey at the following URL: www.intelligententerprise.com/020509/508feat1_1.shtml --------------------------------------------------------- 4) JAVA SERIES --------------------------------------------------------- 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 University of Toronto, and his current project is www.globeinvestorgold.com. Enjoy! * * * * In this article, I'll take a closer look at JDeveloper, Oracle's Java Development environment. There are a lot of Java development environments out there. Of course, strictly speaking, all you need to write a Java application is a text editor (like Windows Notepad) to edit the code and the Java Development Kit (JDK) to compile it. And in the past, a lot of Java programmers did all their development using this low-tech approach. But as Java has grown, the environment in which it runs has become more complex, and development environments have a lot of values-added features like class browsers, code wizards, debuggers, etc. These features, if used properly, can greatly increase your productivity. So if you're currently churning out Enterprise Java Beans (EJBs) by the cartload and suddenly find out that you now have to support JINI, you may want to check out a development environment to ease your workload. There are a few Java development environments to choose from including Borland's JBuilder, IBM's VisualAge for Java, Sun's Forte, and, the subject of this article, Oracle's JDeveloper. JDeveloper is based on JBuilder and has been around for a few years. The main changes in its most recent incarnation are that now it's written 100 percent in Java, and it supports OC4J. (In fact, the OC4J server is bundled with JDeveloper) Let's takes a closer look at JDeveloper. First, the bad points. It's slow. This is probably the result of going from native code to 100 percent Java. In fact, JBuilder went through the same growing pains around two years ago, and there are still programmers I know who insist on using JBuilder's last native code release despite the improvements since then. Further, I found the editing environment clumsy. For example, drag-and-drop isn't supported. Also there's no way to overwrite an existing file when saving a file under another name. The editor is sometimes flaky. My editing cursor occasionally disappears, and sometimes the menu hot keys (for example, hitting Alt-E-F instead of selecting the "Edit" menu, then the "Find" item) stop working. The online Help is pretty quirky too. For example, sometimes when you invoke the Help from a dialog box, you can't continue with the dialog until you've closed the Help. And, yes, you can copy text from a Help screen, but you must use Ctrl-C (something I found out by pure accident). Keep in mind that the version I'm reviewing here is Release Candidate 2 and is a beta version. One hopes that Oracle can get these issues dealt with in the near future. Now the good points. JDeveloper comes chock-full of wizards. In my mind, there are two categories of wizards. First, there are wizards that take care of the drudge work quickly so that you can devote yourself to the meat of the matter. Second, there are those that reduce a job that may take hours of pouring over manuals into a sequence of steps where you are presented with options and choices at each step, and then hit a button, and it's done. In the first category, we have wizards to generates EJBs, servlets, JSPs, and a host of the Java objects that make up a Java application. In the second category, there are wizards to set up database connections, application server connections, etc., and then there are deployment wizards where you can mix and match the application server you deploy too and database you talk to as you like. Once you have a database connection set up, JDeveloper presents windows that allow you to browse the tables, contents of PL/SQL stored procedures, etc., inside the database schema. You can also open up an SQL Window and run queries on that database. JDeveloper also includes a debugger to let you step through your Java code. If it's servlets or EJBs, you can step through them either on the OC4J server that comes with JDeveloper, or remotely on any OC4J server to which you have deployed the code. This is something I've used quite a bit in the past few months, and I'm pleased to say that it's solid. In conclusion, the most recent JDeveloper release provides a very complete set of tools for Java development. The interface is still a bit flaky, but the tools are solid, and some of them I'd call indispensable if you're working with an Oracle database and/or OC4J. Next issue, I'll talk some more about JDeveloper. --------------------------------------------------------- 5) ORACLE NEWS --------------------------------------------------------- On May 8, 2002, Oracle issued a press release on worldwide database market share numbers. The numbers were based on a Gartner/Dataquest survey done in 2001. According to the survey, Oracle leads the "modern" relational database market with 39.8 percent share, and Oracle's lead on UNIX is also strong at 63.3 percent share. The keyword here is "modern," meaning that database licensing on legacy/mainframe systems is excluded. While you may argue this is nothing but Oracle's attempt to put a positive spin on its market share, we can definitely learn a lot from how Oracle interpreted the results of the survey to its advantage. Treat this as "Marketing 101"! Find out more at the following link: www.oracle.com/corporate/press/index.html?1335580.html --------------------------------------------------------- 6) ANSWER TO THE POP QUIZ --------------------------------------------------------- Oracle 9i provides a facility to monitor index usage. This facility can be used to determine if an index is being used. It can also be used to check if a specific query is utilizing an expected index. Syntax: ALTER INDEX index_name MONITORING | NOMONITORING USAGE; The monitoring result can be viewed using the v$object_usage data dictionary view. Note that view is reset for the specified index each time monitoring is restarted. Let's illustrate this with an example. 1. Let's monitor the employee ID primary key index, emp_pk, on the employees table. ALTER INDEX emp_pk MONITORING USAGE; 2. Next, let's use the data dictionary view for monitoring. Let's execute a query that doesn't use the index. SELECT last_name FROM employees WHERE emp_id IS NULL; 2a. Query the data dictionary view. SELECT start_monitoring, end_monitoring, used FROM v$object_usage WHERE index_name = 'EMP_PK'; START_MONITORING END_MONITORING USE ------------------ ------------------- --- 3/31/2002 23:55:45 NO 3. Execute a query that uses the index. SELECT last_name FROM employees WHERE emp_id = 100; 3a. Query the data dictionary view again. SELECT start_monitoring, end_monitoring, used FROM v$object_usage WHERE index_name = 'EMP_PK'; START_MONITORING END_MONITORING USE ------------------ ------------------- --- 3/31/2002 23:55:45 YES Stop monitoring 4. Stop index monitoring. ALTER INDEX emp_pk NOMONITORING USAGE; --------------------------------------------------------- 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 This eNewsletter is brought to you compliments of Pinnacle Publishing, Inc. Copyright(c) 2002 www.pinnaclepublishing.com All rights reserved.