<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Results Through Technology</title>
	<atom:link href="http://www.rtt.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rtt.com</link>
	<description>Providing services that facilitate achievement of business objectives.</description>
	<lastBuildDate>Sun, 14 Apr 2013 17:30:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Being a Successful Consultant</title>
		<link>http://www.rtt.com/being-a-successful-consultant/</link>
		<comments>http://www.rtt.com/being-a-successful-consultant/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 15:43:37 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=253</guid>
		<description><![CDATA[If you&#8217;re working with clients in the offline world, you need to cultivate the same values you have while working online. If you&#8217;re looking to be a consultant of any kind, there are certain tenants you need to hold dear. We&#8217;ve compiled some of the most important for you to take a look at, internalize, [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">If you&#8217;re working with clients in the offline world, you need to cultivate the same values you have while working online. If you&#8217;re looking to be a consultant of any kind, there are certain tenants you need to hold dear. We&#8217;ve compiled some of the most important for you to take a look at, internalize, and understand. Once you do, get out there and show everybody what you&#8217;re made of when it comes to consulting!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><img class="size-medium wp-image-300 alignright" title="Communication is the key to successful consulting" src="http://www.rtt.com/wp-content/uploads/2013/01/successful-consulting-300x198.jpg" alt="" width="300" height="198" />Listen to your clients. There is a fine balance between offering valid advice and being pushy. At the end of the day the client is paying you for the advice you can give and also for getting the job done in a way that they deem satisfactory. It may be frustrating when you have a brilliant idea and yet the client seems stubborn, but you&#8217;ll have to give in to the one paying your bill at the end of the day. Remember, always offer advice, but understand that the last decision is up to the client. You don&#8217;t want to be in the position of going against the clients preferences and then finding that your suggestion didn&#8217;t turn out as planned!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Quickly establish rapport. Out of all the businesses that you could be going into, <a title="building relationships with clients" href="http://www.rtt.com/services/oracle-consulting/">consulting is very much based on the relationship that you have with the client</a>. A great relationship with one client can lead to them coming back to you the next time that they need a job done, as well as possible job referrals. Make sure to treat each and every client as if they&#8217;re extremely important because they are!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Honesty is the best policy. Cliche, yes. True? Very much so. You are a consultant in order to offer the clients the advice they need, when they need it. The desire to please the client may be strong and is very important but don&#8217;t sugar coat unpleasant truths. If something is going wrong, the client n<span id="more-253"></span>eeds to know as soon as it is convenient. Don&#8217;t be afraid to let the client know when something may be a bad idea. Of course, if the client is very particular about having things done a certain way that&#8217;s a choice that&#8217;s entirely up to them, but never tell a client that everything will be fine if it wont.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Flexibility is key. One of the reasons why people hire consultants in the first place is due to the degree of flexibility that they can offer. Be prompt with your response times to emails. Give your clients your personal number. Stay on alert for them, and if they have time to do business with you at nine in the evening, its probably best for you to take them up on it. This doesn&#8217;t mean that you need to let the client dominate your entire life, but being able to respond to queries and work requests within a short period of time is what makes good consultants great.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Don&#8217;t overprice your services. It can be very tempting to charge clients an arm and a leg for your help, particularly if you&#8217;re a consultant with years and years of experience in the industry. Successful consultants though, are just worth their weight in gold they&#8217;re aware of how much they&#8217;re worth and charge the client accordingly. This is not to say that you shouldn&#8217;t charge what you&#8217;re worth, but if you&#8217;re charging a rate that&#8217;s significantly higher than that of your competition, you&#8217;d better have a convincing reason why this is so.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Don&#8217;t undercharge for your services. On the flip side of the charge equation, be sure not to undersell yourself, either. First of all, it can be difficult to make a living at consulting if you&#8217;re not charging the proper prices. Second, no client likes the prices to be raised in the future, and no client is ever going to tell you that you don&#8217;t charge enough!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Don&#8217;t put all your eggs in one basket. The true nature of consulting work is that its a little bit unsteady some weeks it might seem like you&#8217;ve got clients falling out of your ears, while others nobody ever seems to be calling. To this end, its important to spread out your business among many clients, and not just to rely on the services of one major company. After all, as a consultant you&#8217;re not a permanent member of the company, and its entirely possible that one week they&#8217;ll find somebody that they think can do the job better or they decide that they just don&#8217;t need a consultant anymore. Spreading out your work options means that you&#8217;ve got backup in case somebody bails!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><a href="http://www.rtt.com/wp-content/uploads/2013/01/dream-big.jpg"><img class="size-medium wp-image-302 alignleft" title="Think big but don't over extend with your consulting efforts" src="http://www.rtt.com/wp-content/uploads/2013/01/dream-big-300x199.jpg" alt="Think big but don't over extend with your consulting efforts" width="300" height="199" /></a>Take as much work as you can, but never compromise quality. If you&#8217;re really reelin em in, that&#8217;s great news. However, even if you have a thousand people knocking at your door, you&#8217;ll need to have the discipline to tell some of them no. Never take on more work than you can handle. Being a consultant means that your reputation is extremely important and anything that goes toward tarnishing that reputation is anathema. If you have a thousand potential clients but can only take on two, commit to your 2 clients and help the other prospects find a solution by recommending other consultants (great networking opportunity for you) or at least having a checklist that they can use to find a good consultant. This might bring you their business in the future.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Current clients are more important than gold. This is true for obvious reasons namely, your current clients are the ones providing you with revenue. Whatever you need to do to keep these clients happy and on your side is priority number one. Most literature out on the Internet is dedicated toward helping consultants find new clients, but there&#8217;s very little stressing the importance of the clients that you may already have. Keep them coming back for more and keep them wanting to advertise your services out to others, as well!</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Never stop looking for new clients. Its important to keep your current clients happy and pleased with your work, but you also need to constantly monitor the market for new leads. At least one third of the time you spend at work during the week should be dedicated toward canvassing the wires for potential new clients. Remember that most leads don&#8217;t pan out, so even if you&#8217;ve got a lot on your plate, you should still be looking for more work. Who knows, you might end up landing your next major project or an opportunity that will lead to your magnum opus project as a consultant tomorrow on CraigsList! Be sure to take the time to look.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Credibility is the most important thing. Clients will first contact you because of your skills that you bring to the table. If they need an consultant to help them with their online marketing, they may turn to you because you have a distinguished record of clients assisted, or maybe your own online business is extremely successful. Whatever the case, once they contact you due to your skills, they&#8217;ll stay around because of your credibility. Do you keep your promises? Do you get projects in on time? Are your opinions honest, even when they aren&#8217;t the ones that the client would like to hear? If you market goods and services to your clients, are they ones that the clients might honestly be interested in or is it shameless promotion? Building a reputation of credibility will take you far as a consultant and if you end up with a record for poor credibility your business will go belly up faster than you can say, you lied. Keep your clients and your business be honest.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/being-a-successful-consultant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comprenhensively Utilizing Oracle Tools</title>
		<link>http://www.rtt.com/comprenhensively-utilizing-oracle-tools/</link>
		<comments>http://www.rtt.com/comprenhensively-utilizing-oracle-tools/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 15:55:55 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=273</guid>
		<description><![CDATA[Oracle is breaking record speeds in releasing new products, changing names of existing products and releasing new versions of current products. It has been challenging for technologists to keep track of the changes.  The constant flux of changes has caused some people confusion in knowing the purpose, functionality, and role of each product.  This confusion [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle is breaking record speeds in releasing new products, changing names of existing products and releasing new versions of current products. It has been challenging for technologists to keep track of the changes.  The constant flux of changes has caused some people confusion in knowing the purpose, functionality, and role of each product.  This confusion may lead some people to believe that similar Oracle products compete against each other.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The purpose of this article/presentation is to touch base with Oracle Development Products/Tools; discuss the functionality of each product; discuss the similarities and migration utilities between pro ducts; and to discuss developing business applications using one or a combination of these development tools from Oracle.  This article/presentation explains Oracle’s future direction on some of the products and discusses the licensing/server model that Oracle has developed, the introduction of 9iAS.</span></p>
<p><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Servers, Languages and Development Tools:</span></strong></p>
<p><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Servers:</span></strong></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">At a higher-level, Oracle has two products:  <span id="more-273"></span>Oracle Database Server and Oracle Internet Application Server.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Visit <a href="http://www.oracle.com/ip/index.html?content.html" target="_blank">http://www.oracle.com/ip/index.html?content.html</a> , <a href="http://technet.oracle.com/products/content.html " target="_blank">http://technet.oracle.com/products/content.html</a> for more information. This article/presentation assumes that you are familiar with Oracle Database Server and its applicability (visit http://technet.oracle.com/products/oracle9i/content.html  for more information).   Built with Apache HTTP Server and multiple services/cartridges, Oracle iAS has become necessary for deploying (runtime) most/any of Oracle’s development tools specifically for browser-based applications. Some of the services and features that are built into iAS in clude: HTTP Server, Oracle Portal (Formerly WebDB), iFS support, J2EE &amp; XML, Oracle Forms and Reports Services, Discoverer, WorkFlow, PL/SQL cartridge, BC4J, Wireless Support, etc.  Oracle Internet Application Server comes with Standard, Enterprise and Wireless edition.</span></p>
<p><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Programming Languages</span></strong></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle supports native PL/SQL and/or Java as native languages in most of their tools/servers. There are programming extensions to Pro*C, Pro*COBOL, C, C++, and OCI on database server side. Oracle has been supporting XML in the Database Server, Application Server and a few development tools as well.  Since the release of Oracle DB Release Version 8, Oracle has incorporated <!--more-->Java Virtual Machine (J Server – Oracle’s Java Virtual Machine) into the DB Server and Application Server.</span></p>
<p><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Development Environment:</span></strong></p>
<p><a title="We provide development assistance with Oracle Tools" href="http://www.rtt.com/services/analysis-design/" target="_blank"><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Designer: (Oracle CASE Designer/2000/Oracle Designer)</span></a><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Oracle Designer is a one-stop development environment that provides complete “end-to-end” development of applications. This offers a toolset to Model, Generate and Capture the requirements of Web based, and Client Server Applications.  In order to use this tool to its fullest extent (both Modeling and Generation), the learning curve of this tool is going to be significantly lengthy. The generation part includes both the server (database) side and the client side application generation.</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The client side generation includes Forms, Reports generation for both client server and browser based deployment and Web</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Server Generation (WSG) for web deployment.  This consists of PL/SQL packages that generate dynamic HTML user interface and JavaScript programming language.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">COMPARISON OF WEB SERVER GENERATION USING DESIGNER VS. HAND-CODED USING PL/SQL WEB TOOL KIT</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Both of these options require HTML and JavaScript knowledge to develop applications that meet business requirements.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For most of the part, Designer generates browser independent JavaScript and works both in Internet Explorer (IE)</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> and Netscape.  If you are not using Designer, you will need to be aware of the differences in IE and Netscape.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Unless you have skilled people in -house that can perform modeling using Designer, there may be a huge learning curve to learn Designer for the purpose of web server generation.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Using Designer, Standards (using preferences) can be easily enforced. Designer has tons of other functionality including Table API generation, Version Control, Security model, and Error Handling.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Customization can be done within Designer (Pre -generation) changes. There are limitations (examples will be discussed at ODTUG) and Post-Generation changes may occur. This will significantly add to the maintenance of that code outside of Designer. Hand coding does not have any such issues.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">If you are hand coding, you will need to have programming knowledge of HTP/HTF packages and WSGL packages in case of Designer generation (simple apps can be developed without much knowledge).</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">If you are hand coding, you can use HTML to PL/SQL converter (WebAlchemy) for screen layout.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle JDeveloper IDE:</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle JDeveloper is a Java development environment for developing Internet applications. JDeveloper provides an end-to- end, highly productive development environment for the Java(tm) 2 Enterprise Edition (J2EE) platform. Oracle JDeveloper includes Oracle Business Components for Java (http://technet.oracle.com/products/jdev/info/techwp20/wp.html ), which is a standards-based, server-side framework for cre ating scalable, high-performance Internet applications. The framework provides design-time facilities and runtime services to drastically simplify the task of building, debugging, customizing, and</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> reusing business components. Business Components for Java implements design patterns necessary for delivering real world, performance J2EE applications. In addition, applications developed with Business Components for Java can be accessed from a wide variety of clients (JDeveloper, Oracle Forms) including Web browsers, professional desktop clients, hand-held and wireless devices. JDeveloper 3.2 provides numerous features for Java XML developers and comes with integrated Oracle XDK built into JDeveloper.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Portal (WebDB Portal)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle9iAS Portal is a web-based application for building and deploying e-business portals. It provides a secure, manageable environment for accessing and interacting with enterprise software services and information resources. In addition to rich features like web publishing, personalization, easy to use and customize etc., the key feature to consider from application development point of view is its “Extensible Framework”. This framework integrates web-based resources such as web pages, applications (e.g., applications developed using other Oracle tools), business intelligence reports (Discoverer, Oracle</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Reports), and syndicated content feeds, within standardized, reusable information components called Portlets. Built into iAS, this portlet features can be considered as an umbrella to integrate applications developed using multiple Oracle tools like, Forms, Reports, Discoverer, PL/SQL based web packages, JSP or Java based applications into one framework.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle XML Development Kit (XDK):</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Oracle XML Developer&#8217;s Kits (XDK http://technet.oracle.com/tech/xml/ ) contain the basic building blocks for reading, manipulating, transforming and viewing XML documents. To provide a broad variety of deployment options, the Oracle XDKs are available for Java, JavaBeans, C, C++ and PL/SQL. Oracle XDK is integrated into JDeveloper, Oracle Database, iAS.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XML PARSERS:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Supporting Java, C, C++ and PL/SQL, the components create and parse XML using industry standard DOM and</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> SAX interfaces.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XSLT PROCESSOR:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Transforms or renders XML into other text -based formats such as HTML. Supports both Java and PL/SQL, C, C++</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XML SCHEMA PROCESSOR:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Supporting Java, C, and C++, allows use of XML simple and complex data types.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XML CLASS GENERATOR:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Automatically generates Java and C++ classes from DTDs and Schemas to send XML data from Web forms or applications.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XML TRANSVIEWER JAVA BEANS :</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Visually view and transform XML documents and data via Java components.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XML SQL UTILITY:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Supporting Java, PL/SQL, generates XML documents, DTDs and Schemas from SQL queries.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">XSQL SERVLET:</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Combines XML, SQL, and XSLT in the server to deliver dynamic web content..</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle PL/SQL Web Tool Kit:</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The PL/SQL cartridge built into Oracle iAS, provides an environment that enables users to use their browsers to invoke PL/SQL procedures stored in Oracle databases. The stored procedures can retrieve data from tables in the database, and generate HTML pages that include the data to return to the client browser. Installing PL/SQL t ool kit will install several PL/SQL Packages including HTF, HTP, OWA, OWA_SEC, OWA_UTIl,OWA_COOKIE, OWA_PATTERN, OWA_IMAGE, OWA_TEXT, OWA_CONTENT, etc.</span></p>
<h3><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">PL/SQL Server Pages (PSP):</span></h3>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> A PL/SQL Server Page is a dynamic, database driven page of Internet content built mainly in the easy to write HTML language, with dynamic pieces on Oracle content specified in scriptlet tags. By writing an HTML page with embedded PL/SQL code and compiling it as a PL/SQL Server Page, you may call procedures from the PL/SQL Web Toolkit, but are not required to generate every line of HTML output. Each .psp file is loaded into database using load psp utility as a stored procedure. You can also build these pages using Oracle Portal.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Forms (SQL*Forms  Developer Forms   Oracle Forms)</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Oracle Forms is a Rapid Application Development tool originally developed as a very rich Client Server development tool. It is a highly productive end-to-end development environment for building enterprise-class, database-centric Internet applications.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">ORACLE 9IAS FORMS SERVICES:</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Application developed using Oracle Forms can be deployed as browser based applications using Forms Server and 9iAS Fomrs Services. Please visit http://technet.oracle.com/products/forms/ for complete architecture of this deployment option.  Oracle9iAS Forms Services are the foundation of Oracle Applications 11i. With the latest version of Forms Server and 9iAS Forms Services open API’s it is possible to access Oracle’s Business Components for Java (BC4J) and other industry standards such as EJB, CORBA, XML.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Reports (SQL*Reports Developer Reports Oracle Reports)</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Oracle Reports provides a powerful development and deployment platform to build and publish high-quality, dynamically generated Web reports in an unrivaled scalable, secure environment. Oracle Reports consists of Oracle Reports Developer (shipped with Oracle iDS) and Oracle Reports Services, which ships as part of Oracle9iAS. Visit</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a title="Oracle Reports" href="http://technet.oracle.com/products/reports/" target="_blank">http://technet.oracle.com/products/reports/</a> for complete technical details. Oracle reports and Oracle forms are tightly integrated and complement each other to fulfill the development requirements t o build rich applications.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Discoverer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle9iAS Discoverer, Oracle’s award winning product, is a key component of Oracle9iAS integrated business intelligence solution.  Oracle9iAS Discoverer is an intuitive ad hoc query, reporting, analysis, and web publishing tool that empowers business users at all levels of the organization to gain immediate access to information from data marts, data warehouses, and online transaction processing (OLTP) systems. Visit http://technet.oracle.com/products/discoverer/ for complete technical details and architecture.  Report builders and analysts can create, modify, and execute ad hoc queries and reports.  The more casual users can view and navigate through pre-defined reports and graphs. Discoverer provides a business view to hide the complexity of the underlying data structure. It enables users to focus on solving business problems instead of data access issues.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/comprenhensively-utilizing-oracle-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizing JDeveloper To It&#8217;s Fullest</title>
		<link>http://www.rtt.com/utilizing-jdeveloper-to-its-fullest/</link>
		<comments>http://www.rtt.com/utilizing-jdeveloper-to-its-fullest/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 15:38:53 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=266</guid>
		<description><![CDATA[Java for the Oracle Developer The Oracle developer may be somewhat perplexed when first encountering JDeveloper.  Numerous terms and definitions are foreign to traditional Forms and PL/SQL Programmers.  The programmer occasionally needs to “roll your own” extended classes or even new clas ses to achieve “basic” functionality.  One feels like they are working with a [...]]]></description>
				<content:encoded><![CDATA[<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Java for the Oracle Developer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Oracle developer may be somewhat perplexed when first encountering JDeveloper.  Numerous terms and definitions are foreign to traditional Forms and PL/SQL Programmers.  The programmer occasionally needs to “roll your own” extended classes or even new clas ses to achieve “basic” functionality.  One feels like they are working with a complex procedural</span> <span style="font-family: arial,helvetica,sans-serif; font-size: medium;">3GL.  That’s because one is working with a complex procedural 3GL! Recommendations for the Oracle Development team that has not worked with Java</span><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> gain sophisticated Java Programming expertise</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Assure at least one team member has a good understanding of JDeveloper, including how to set up projects, generate libraries, define manifest files,  implement version control, Java Virtual Machines and the Java Runtime Environment (JRE)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Explore the following:  events/listeners, jtable methods, table models (particularly as related to customizing grid controls), extending existing classes, interfaces</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Don’t be afraid to use Java!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Use more of the functionality of BC4J than simply mapping tables and creating views! Visit java.sun.com</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle for the Java Developer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Java Developer who has had little or no previous experience with <span id="more-266"></span>databases will find JDeveloper an excellent tool for learning how to build database applicatio ns.  Simple database applications can be created quickly and easily through wizards, while the tool allows experienced programmers to access the lowest levels of control.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Many developers new to databases often use the database as simply a storage location for putting and retrieving records. However, databases such as Oracle provide much, much more powerful resources for the practical JDeveloper to quickly create sophisticated applications.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Recommendations for the Java Developer Team that has not worked with Oracle:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Gain sophisticated SQL programming expertise.   There’s more to it than most utilize.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Assure at least one team member acquires a good understanding of Oracle, including how to set up tnsnames, the init.ora file, tuning approaches</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Explore the fo llowing resources: database triggers, database stored procedures, optimization hints, query outlines, indexing options, virtual private databases, views, materialized views, constraints, IFS, database links to Oracle and heterogeneous databases, interMedia , database security approaches, SQL*Loader</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Evaluate Oracle Enterprise Manager and similar 3rd party tools</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Test your SQL in SQL*Plus first.  If it takes a long time to process there… figure out why.  There is generally a good reason why it is slow, and more often than not you can do something about it ( Creating appropriate indexes, changing your SQL, modifying ora.ini parameters such as number  of  buffers, using hints, etc )</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Consider leveraging rather than replacing existing database routines such as store d procedures, constraints, sequences and triggers.  Remember that database functionality is available to all developers and all toolsets at very low levels, and is already tested and working</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Don’t be afraid to use BC4J for more than mapping tables and creating views! Visit technet.oracle.com</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">JDeveloper for the MS Access™ Developer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">You aren’t in Redmond, anymore!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">At  first glance JDeveloper seems to be vastly inferior.  No reporting tool, no obvious fancy functions, no apparent instant</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> JPG integration!  And you have a seemingly overly complex IDE with a seemingly overly complex database back end!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For large scale, sophisticated, long lived enterprise applications, JDeveloper provides a powerful environment for the professional developer. “Overly complex”  generally means it has a host of features one doesn’t know one needs until  one is well into production and running into architectural dead ends of less sophisticated products!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">If, however, MS Access serves your purpose, then be Practical and use it.  It may be the right tool for the right use in your situation.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Recommendations for the MS Access Developer:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Keep an open mind.  This is just like learning for the first time about writing Macros and then turning actual Basic Modules into a real application.  It’s a learning experience… and the more you learn, the more you learn how to take control of your application at lower and lower levels…</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Stick with it. Through Pain comes understand and appreciation of  the whys of complexity</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Explore BC4J in it’s entirety</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">If you don’t see functionality you need… search the help (it’s usually available, just not obvious), look for 3rd party components on the web, or roll your own.   And then share it with other developers through one of the various forums available.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">A Word About Wizards</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">There are numerous Wizards that assist one is setting up projects and business components.  These wizards are useful and ease the creation of an application.   Any non-trivial application, however, will quickly require a fairly deep understanding of Java, Oracle and Business Components for Java by the developers.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Business Components for Java</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">East meets west through Business Components for Java.(BC4J).  For years there has been a tug of war between database and applications designers… where should rules and code be physically instantiated?    A constant tug of war… in the code.. in the database.  Both had pros and cons.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">BC4J offers an alternative approach taking the best of both worlds and setting up a framework that can be deployed at multiple levels.. taking the strengths of the database layer and applying it in a structured manner to a middle tier code layer… and taking the strengths of the application code layer and applying it in a structured manner to the middle tier code layer!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">A frequent question when developers first encounter JDeveloper is.. “Why use this JDeveloper instead of Competitor X”. BC4J is the strongest poker hand JDeveloper has to play in response.  To those who understand and utilize BC4J… they’ve got a royal flush!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For traditional database applications’ engineers, BC4J gives parallels t o familiar database concepts, under a framework accessible via Java:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Database Concept    BC4J Concept    Notes</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Domains (rdb), user</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> defined types    Domains    Use these! Define “custom datatypes” and apply them to your entity object</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> attributes… examples:  a_social_security_number. a_state_abbreviation, a_phone_number</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Tables/Views/Synonyms    Entity Objects    Remember that an entity object could be a database view that contains</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> dblinks in the server database.. or you can have entity objects that operate in a distributed ma nner, as well, using different connections.</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Column    Entity Attribute, View</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Object Attribute    The attributes can be computed and not persisted in an underlying database</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Foreign/Primary Key    Associations     Can indicate cardinality!</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Views    View Objects</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> N/A?     View Links    Master:Detail, one:many or cascading</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Triggers    Entity Object Impl</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> methods (within the EO)</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> or Publish/Subscribe    Publish/Subscribe to affect changes or validations across entity objects! (</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> very interesting! )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Commit time validation</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> event     Entity’s validateEntity() method</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Stored Procedures    Java Class methods</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Default Values    EntityObjectImpl.create()    Create() method, using the appropriate setAttribute() methods</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Constraints    In Impl SetAttributes</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> methods     Also EO validation rules, via Domain definitions and methods, and the</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Entity validateEntity() method</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Composition Association    Delete Restrict; Trigger to Parent</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Primary Key Sequence (</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> applied via before insert</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> trigger)    Implemented in</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> EntityObjectImpl.create()</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> method    If the database already has a trigger sequence, set the sequence attribute to</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> mandatory=no, refresh after insert=yes; and in the create set the sequence</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> attribute to an incremented negative int.  This will “fake” a sequence compatibly and avoid a network interchange.</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Transactions    ApplicationModule.</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> transactions</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Locking    Default is “pessimistic</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> locking”    May be slightly different that most database programmers are acquainted</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> with.  When read, it does not lock the record… when the record is first updated.. then the lock gets thrown. If you need to lock at the top of the transaction you can have explicit locking control through other methods.</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Cursors    ScrollableRowsetAccess    Also look at DataItemViews (see Excel example)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">While these are all not exact equivalents, the BC4J framework offers many extensions to traditional capabilities… such as defining one:many  metadata definitions from a view object onto a view object.  The framework also goes far, far beyond the simple table and view mappers that other IDEs generally offer.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For Database folk this is a comfortable, familiar arrangement, once the terminology and differences are understood.  For non- Database Java developers, this provides a structured framework for understanding database oriented applications design and implementation.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For large enterprise applications development, BC4J looks very, very promising over the alternatives.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Déjà vu? Do I really need BC4J?</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For the traditional database applications programmer, BC4J may simply look like database capabilities duplicated in the applications coding tier.  Indeed, if one is coding against an existing database with many validation rules and business processes coded in PL/SQL stored procedures and triggers, the better part of valor may be to implement the BC4J in a reduced but compatible scope.  In the future,  one can envision migrating BC4J classes to inside the database ( or simply called from the database) and having interplay between existing PL/SQL procedures and triggers and BC4J functionality. However, the database programmer may go through the steps of:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(1)  I can do it all in the database functions quicker and easier</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(2)  Wow, it sure would be nice if I could define more metadata to add business semantics to the database, and share understanding/version control with those applications folk</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(3)  HEH… through BC4J and the Extensible Object oriented environment… adding business semantics to the database becomes realizable!  And applications folk can understand what I’m doing… and I can work closer to their environment!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For the traditional Java Programmer, it might look like direct JDBC calls and “in code” validations would be simpler and cheaper to implement, and that BC4J introduces too much overhead.  However, given a sufficiently sophisticated database application, the Java programmer will soon understand why the BC4J framework is a boon!  Too many  non-database programmers go through the stages of</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(1)  I can do it quicker and easier through brute force coding</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(2)  Hmmm… I’m generating lots of replication… and difficult… unstructured…uncoordinated….we ll, I can build tools to make it quicker,  easier and more coordinated…</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">(3)  Heh!  I’m trying to build what BC4J already offers, class by class, method by method… and it’s man-years ahead of what I could implement…well.. uh, maybe I should just use BC4J more completely….</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Caveats</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Database triggers and constraints fire no matter what the source of the DML… SQL/Plus, a JDBC call, or an MS Access update.  BC4J does not have such primitive trapping unless you somehow can use database triggers to explicitly call the BC4J object methods.  If you have need to protect your database at this level, BC4J can still be used to augment this with middle or client tier validation.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">While it can be envisioned that the BC4J framework could create a semantic business layer for the database (not just syntax validation! ), implementing such a model transparently and completely appears to be a ways off for most organizations.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">BC4J and its integration with the application layer has improved greatly over the last couple of years, but there are still some minor tweaking that will be resolved over future releases.  For example, effective trapping of commit and rollback events in a procedural, ordered, aware manner.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">BC4J is fairly “open”.  As such, the source can often be reviewed and extended by the applications programmer.. The bad news is that it is large, can appear fairly complex… and one must have a fairly significant  understanding of the</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">DACF layer, the Swing layer (if applicable), the BC4J layer, and the Infobus layer to be able to n egotiate all their application’s needs.  And also understand how to apply “oil to any friction” that may encountered between layers.  ( Example:  3.2 and before : DACF date formatters returning error if the application code set a date to NULL, or rollbacks resetting DACF grid control formats back to their original state.)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">There are often checkboxes available to the programmer that oversimplify the actual complexity of the task.  For example, the Entity Object Attribute “Queriable” checkbox, or uppercase searching:  without indexes defined in the database to support those queries and a design that takes into account the performance cost of  maintaining those indexes, those simple checkboxes and property settings at the application level can significantly degrade the user experience. Another example is the default pessimistic locking scheme.  The programmer needs to understand the tradeoffs of the approach, which can include improved concurrency and reduced stalling.. but potentially increased failures “Another</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> user has updated…” in very high update environments over a smaller set of high contention records ( such as inventory</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> movement  in a robotic environment ), where an exclusive lock on the table at transaction start may actually improve throughput and reduce transaction commit failures.. but with greater stalling.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Whereas Stored Procedures and Triggers are usually procedural in orientation, the equivalent under BC4J may be a set of events/listener methods that all fire in parallel. In the event certain tasks must be completed before the later tasks can begin, special coding may be required to synchronize and coordinate the threads.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">BC4J Framework is best implemented in structured environments which use formal design modeling.  As in any large object oriented project, centralized management of classes and methods are essential to achieving the re -usability gains and limiting a plethora of ill conceived classes and method implementations.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Recommendations</span></h2>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Read the BC4J Whitepapers on technet.oracle.com</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Determine, design and implement domains at the beginning of the project</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Understand the event/listener publish/subscribe event driven approach</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Move applicable validation code which you may have in your client code to the appropriate BC4J class methods or functions.  Understand how to trap errors using this approach.</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Consider Defining the BC4J classes in a separate project managed and maintained by a BC4J administrator.  This can then be used in turn by multiple projects.</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> In JDeveloper 3.2 and earlier, implement all session and rowSetInfo/attributeInfo definitions in their own class, rotating them out of any Wizard generated frame classes, for example.  This will mean that the IDE no longer will allow you to choose attributes via the property boxes for DACF controls… you will have to manage these directly in the source code.  But in the long run, on a significant application project, you will come out ahead.</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> If you run into a conceptual roadblock, or cannot find the correct method to fulfill a task, ask for help on the</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> JDeveloper forum at technet.oracle.com</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Get it working.  Then optimize it. Performance always matters.  If one deployment approach results in unacceptable performance, try a different deployment approach.</span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Yes, there are bugs in the JDeveloper IDE.   Issues with bugs in the source editor can be frustrating. Remain focused on the gains brought by the BC4J framework for the long haul.  The bugs will eventually be fixed.  And the BC4J framework will only get better!  Don’t throw the baby out with the bathwater!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Some Practical Code Fragments</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Reports</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">For the Practical JDeveloper with the goal of getting the job done quickly and effectively, the decision to use the right tool at the right time is an important one.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">One could use JDeveloper to create and format an html report to a file, and then display that file to a browser, but there are numerous third party report writers that are tailored to the task that can get the job done quickly, easily and with much more powerful options out of box.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Oracle Reports  6i and Reports Server 6i are such tools.  With Reports 6i you can quickly generate complex reports.  Reports Server 6i installed on a middle tier will allow JDeveloper to directly call reports for displaying in the browser, emailing, or printing to printers accessible to the middle tier server.  Code samples follow, showing building a URL.  You’ll probably use one of the more secure methods (such as using a keyfile) of  calling reports 6i in actual usage, but this will get you started….</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Build a string that defines a valid URL to request a print out of a report ( See Reports 6i server documentation ):</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">/* note the multiple back slashes to get past the layers */ myURLRequest.append( “http:\\\\myserver.myco.com\\ReportsServer”); myURLRequest.append(&#8220;&amp;report=drive:/directory/&#8221;); myURLRequest.append( pReportName);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> myURLRequest.append( pOtherParameters); myURLRequest.append(&#8220;&amp;userid=&#8221;+Application1.currentReportUser); myURLRequest.append(&#8220;&amp;destype=PRINTER&amp;desname=\\\\PRINT_SERVER\\&#8221;); myURLRequest.append(pPrinterTarget);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> if (isPostscriptPrinter)</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> { myURLRequest.append(&#8220;&amp;desformat=&#8221;+pOrientation);}</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Remember that you can test the URL directly in your browser to start with, then work on the Java code. The following takes the URL built to print a report and calls Reports 6i directly</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> URL url = new URL ( pURL );</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> HttpURLConnection urlConn =(HttpURLConnection)url.openConnection();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> urlConn.connect();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> System.out.println(urlConn.getResponseMessage());</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> urlConn.disconnect();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch ( IOException io )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {System.out.println(io.toString());}</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Or to bring it up in Acrobat in an IE or Netscape Window:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">MyURLRequest.append(“&amp;desformat=PDF&amp;destype=CACHE”); /* use this in your built URL */</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">….</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* The following is in a generalized mthod that takes a URL */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* for either direct execution via http or through bringing up the command line */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* on the client for displaying the report in PDF format.. */</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">if (System.getProperty(&#8220;os.name&#8221;).equals(&#8220;Windows NT&#8221;) )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* throw own the up arrow in front Aof the ampersand so NT */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* command line will not barf */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> posIdx = pURL.indexOf(&#8220;&amp;&#8221;);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> while ( posIdx &gt; 0 )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> tempstr = pURL.substring(0,posIdx)+&#8221;^&#8221;+pURL.substring(posIdx);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> pURL = tempstr;</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> posIdx = pURL.indexOf(&#8220;&amp;&#8221;,posIdx+2);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {Runtime.getRuntime().exec(&#8220;cmd  /c start &#8220;+pURL);}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch (Exception e1) {System.out.println(e1.getMessage());  }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> else /* Win95 and 98 */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> try {Runtime.getRuntime().exec(&#8220;start  &#8220;+pURL);}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch (Exception e2) {System.out.println(e2.getMessage());}</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Export to Excel™</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">A common request of users is the ability to export the data one has retrieved to Microsoft Excel™.   The following example shows how to extract the data from a rowSetInfo to a file, and then bring up Excel:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">void excel_btn_actionPerformed(ActionEvent  e)</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> String rowRecord = &#8220;&#8221;; PrintWriter out = null; setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {out = new PrintWriter ( new FileOutputStream(&#8220;c:\\FileName.xls&#8221;));} catch (FileNotFoundException e2) { System.out.println(e2.toString());  } out.println(&#8220;My Column Titles\tTitle 2\tTitle3&#8243;);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* we use DataItemView to run through all the records in the rowset */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* we do not use simple ScrollableRowsetAccess because that will cause*/</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* rowChangeListeners to fire everywhere, while DataItemView will not*/</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ScrollableRowsetAccess x = (ScrollableRowsetAccess)myRowSet.getRowsetAccess();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Object dataItem = myRowSet.getRowsetAccess();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> DataItemView dview = (DataItemView)dataItem;</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ArrayAccess access = dview.getView(-1);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> int buffSize = x.getBufferSize();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> int k = 0;</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> int rowCount = x.getRowCount();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> for (int i=0; i&lt;rowCount; i++)</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> k = i%buffSize;</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* reset my window on the world, since the dataItemView only sees a  */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* windowed buffer of records at any point of time of the entire resultset */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> if ( k==0 )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> dview.setViewStart(i);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> access = dview.getView(-1);</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* build the row, using tabs and getting the formatting right */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* 1,2,6,7 are the attributes in the rowsetInfo as they appear in order */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> rowRecord = (</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ((ImmediateAccess)access.getItemByCoordinates( new int[] { (k),1 }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> )).getPresentationString(Locale.getDefault()).trim()+&#8221;\t&#8221;+</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ((ImmediateAccess)access.getItemByCoordinates( new int[] { (k),2 }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> )).getPresentationString(Locale.getDefault()).trim()+&#8221;\t&#8221;+</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ((ImmediateAccess)access.getItemByCoordinates( new int[] { (k),6 }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> )).getPresentationString(Locale.getDefault()).trim()+&#8221;\t&#8221;+</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> ((ImmediateAccess)access.getItemByCoordinates( new int[] { (k),7 }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> )).getPresentationString(Locale.getDefault()).trim()</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> );</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> out.println ( rowRecord );</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch ( Exception e0) {System.out.println(e0);}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> out.close();</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> /* note the doubleslash needed */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> if (System.getProperty(&#8220;os.name&#8221;).equals(&#8220;Windows NT&#8221;) )</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {Runtime.getRuntime().exec(&#8220;cmd  /c start excel /e  c:\\FileName.xls&#8221;);}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch (Exception e1) {System.out.println(e1.getMessage());  }</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> else /* W95 or W98 */</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> try</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> {Runtime.getRuntime().exec(&#8220;start  excel /e c:\\FileName.xls&#8221;);}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> catch (Exception e2) {System.out.println(e2.getMessage());}</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));</span><br />
<span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> }</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Last Words</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The extent to which one uses the BC4J framework, vs rolling your own in Java or using legacy code in the Database, is dependent upon the staff training , time to implementation, ultimate design goals and the architecture of your system.  Once again, the Practical JDeveloper  whatever tools are at their disposal to accomplish the goal of implementing the stable production database application as quickly and easily as possible.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Don’t be afraid of using Java solutions or Database solutions if they are more comfortable to you and will accomplish the task quicker.  Learning how to use the other approaches can be left to later projects… there is considerable territory to cover from both directions!</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Best of Luck!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/utilizing-jdeveloper-to-its-fullest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Tip: Switching Oracle instances</title>
		<link>http://www.rtt.com/technical-tip-switching-oracle-instances/</link>
		<comments>http://www.rtt.com/technical-tip-switching-oracle-instances/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:27:35 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=238</guid>
		<description><![CDATA[If you have multiple instances on a single machine, you need to have a way to switch from one instance to another. I have seen many systems set up where this is done manually, rather than through the scripts provided by Oracle. I would strongly suggest that you use Oracle&#8217;s scripts. Most manual processes that [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">If you have multiple instances on a single machine, you need to have a way to switch from one instance to another. I have seen many systems set up where this is done manually, rather than through the scripts provided by Oracle. I would strongly suggest that you use Oracle&#8217;s scripts. Most manual processes that I have seen assume that there is only one version of oracle, and maybe even only one instance on a machine. In those cases, adding a new version or a new instance can cause problems.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">VMS<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">You switch to a new Oracle instance by running the orauser.com script that was built for that instance when it was created. Although this script takes care of everything for you, you first have to know where it is. If you had Oracle 7.3 installed under the DISK01:[ORACLE73] directory, the orauser script for the ABC instance would be: DISK01:[ORACLE73.DB_ABC]ORAUSER_ABC.COM.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Users would point to the ABC instance by running that script.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">$ @ DISK01:[ORACLE73.DB_ABC]ORAUSER_ABC.COM<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">The script defines logical names to point to the various Oracle directories, and defines symbols so that you can run the Oracle programs, such as sqlplus.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">If you want to point to another instance, you would need to locate and run the orauser.com script for that instance.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">UNIX<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Oracle on UNIX provides a single script that allows you to switch from one instance to another. Actually, there are 2 scripts; one for csh users and one for ksh users. These scripts look in the oratab file to find the correct value for $ORACLE_HOME for the instance, then set environment variables to correctly configure your environment.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><span id="more-238"></span>Although the scripts are the same on different flavors of UNIX, their location is not. For example, the scripts are in /opt/bin under Solaris and in /usr/local/bin under HP-UX.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Because these scripts set environment variables, they cannot be executed as normal scripts, since an executed script spawns a subshell, and any environment variables set in the subshell do not get passed back to its parent shell. So, these scripts must be run underneath the current shell. Here are csh and ksh examples of how this script must be executed.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">csh: % source /opt/bin/coranev</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">ksh: $ . /opt/bin/oraenv<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">You will be prompted for the value of ORACLE_SID. The script will find the instance that you specify in the oratab file and:<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Find and set the value for $ORACLE_HOME</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Remove any old $ORACLE_HOME/bin entries from your path</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Add the new $ORACLE_HOME/bin to your path so that you will be able to run appropriate version of sqlplus, exp, imp, svrmgrl, etc.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Set ORACLE_SID to the value that you entered.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">If you are running a script where it is inconvenient or impossible to be prompted for the value of ORACLE_SID, you can set ORACLE_SID beforehand. You must also set ORAENV_ASK to NO so that the oraenv or coraenv script will use the current value of ORACLE_SID. Here is a c-shell example.<br />
</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">setenv ORACLE_SID abc</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">setenv ORAENV_ASK NO</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">source /opt/bin/coraenv</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/technical-tip-switching-oracle-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration Management Features and Capabilities of Oracle Designer</title>
		<link>http://www.rtt.com/configuration-management-features-and-capabilities-of-oracle-designer/</link>
		<comments>http://www.rtt.com/configuration-management-features-and-capabilities-of-oracle-designer/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:25:06 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=219</guid>
		<description><![CDATA[Oracle Designer offers substantial new configuration management capabilities utilizing the Oracle Repository.  This presentation will provide an overview of the new configuration management functionality and how it can best be utilized to provide a robust application development environment. One of the primary benefits of using Oracle Designer is the ability to share existing knowledge between [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Oracle Designer offers substantial new configuration management capabilities utilizing the Oracle Repository.  This presentation will provide an overview of the new configuration management functionality and how it can best be utilized to provide a robust application development environment.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">One of the primary benefits of using Oracle Designer is the ability to share existing knowledge between applications.  However when new functionality needs to be added to the repository and existing applications have already been defined serious configuration management issues can arise.  What used to work may suddenly exhibit new and unintended features.  A well planned configuration management plan coupled with the new features of Designer 6i can help to alleviate most of the problems associated with revisions and derivations of applications.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Configuration Management coordinates the resolution of software development issues by identifying and controlling the problems that confront software development teams.  Maintaining multiple incremental releases of software inevitably causes them to diverge from each other meaning that even with the best of intentions a seemingly identical change made to two versions of an application many times result in two different results.  Over time the discrepancy between versions grows wider as new features are introduced that may not be included in the original version.  Without control over existing releases with their bug fixes and new release that introduce added functionality the ability to rebuild prior versions becomes difficult or impossible.   Manually maintaining the identification and maintenance of existing versions becomes increasingly difficult as new versions are released.  As additional versions are introduced it is increasingly likely that a modification will not be propagated or retrofitted which may introduce bugs or result in a loss of functionality.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><span id="more-219"></span>Sharing data and information between Designer applications presents many benefits.  The ability to maintain information in one place reduces overhead and eliminates having to determine which information is correct or the most up to date.  For example if the length or type of a field needs to be changed many applications, modules and databases may be affected.  In traditional development environments manually identifying where the required changes need to be made is a daunting task, ensuring the modification is made everywhere it is needed is even more difficult.  The ability to automatically perform impact analysis to determine the scope of a change quickly and accurately benefits management and designers when they need to estimate the resources required to implement a change and developers who may have to grope through a variety of systems to locate all occurrences that need modification.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Simultaneous updates are another problem that offer many pitfalls.  If Sally is modifying a module and Frank needs to fix a bug in the same module the likelihood of Franks bug fix being overwritten by Sally’s enhancement is high.  Without a configuration management procedure in place the communication needed to keep everyone informed with all modifications being made is nearly impossible.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Through this paper and the accompanying presentation examples will be shown and solutions described illustrating how Oracle Designer 6i and the Oracle Repository provide many of the requirements of a sound configuration management system.  Using this information you will be better equipped to develop a configuration management framework to control objects within the Oracle Repository.</span></p>
<h3><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Communication issues</span></h3>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Consider that a three person team only has three communication paths.  However adding a fourth team member doesn’t just add one more communication path it raises the number of communication paths to six.  Imagine adding a fifth developer!  Frequent team meetings somewhat alleviate this problem, however it is all too often true that the meetings are not frequent enough, don’t cover all of the necessary issues or may be impossible due to teams being separated geographically.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">The nomenclature and concepts of the Oracle Repository and Designer 6i</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">The Oracle Repository and Designer 6i introduce many new terms and concepts; Containers, Configurations, Workareas, Merge, a new check in/check out mechanism, synchronization with file systems just to name a the most common associated with Configuration Management.  In the past there were only two kinds of element types used to store information about Applications in the Repository, Primary Access Controlled elements (PAC) and Secondary Access Controlled elements (SAC).  The following descriptions will provide a framework of knowledge about the new terminology and their function.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Containers</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">With the new functionality of being able to version and work with many objects at the same time for different purposes, a means of organizing these objects into a manageable size was needed.  A new versionable and transferable construct called a Container was created for this purpose.  Containers are similar to directories in a file system they provide a way to organizing repository objects in a logical fashion.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Containers can be of two types depending on how the repository is utilized, folders and application systems.  If the repository is used only as a source control system Folders are available.  If Designer is used for application development then Application Containers and Folders can be used.  Application Containers are very similar and have the same appearance of an “Application” in prior releases of Designer.  Folders on the other hand are totally new in this release and provide a means to upload and version external files and documents.  It appears though that technically they are identical under the covers since typical application objects (modules, entities…) can exist in folders and external documents (word, excel) can exist in application containers.   New versions of containers are created when objects are added or removed from it, or if changes are made to the properties of the Container.  Containers can contain totally different objects or exactly the same objects as another container only diverging when a modification is made.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Configurations</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">A group of versioned objects are specified to exist in a configuration.  An object can exist only once in a configuration but it may exist in many different configurations.  This graphic from Designers Help depicts two different configurations and show that a configuration can itself be versioned and tracked as an object.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">A configuration provides a method of tracking releases of a set of objects at a specific time (or state).</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">An object version included in a configuration is considered a member of that configuration.  They can be added, modified or removed to create new versions of the configuration.  A Configuration can also be created and defined via one of the following rules:  include/exclude folders or objects, latest, latest before and between, another configuration.<strong></strong></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Workareas</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Development shops typically have more than a single developer.  These developers certainly find, on occasion, that they need to modify or enhance part of an application that another developer is also modifying.  Separate Workareas provide a means for concurrent access to objects that can later be merged into a configuration or serve as a basis for a new configuration.  Additionally in the case of large applications with thousands of modules a developer probably doesn’t need or want to have every one of those modules in their development area.  A Workarea provides a mechanism of organizing the objects that the developer is currently interested in thereby removing the clutter of the other unneeded objects.  Workareas are non-versionable objects that serve as a context for all work performed until a sessions ends or the user decides to change work areas.  By specifying access control on the work area they can be configured to be private for a specific developer or testing team or open for access to everyone.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Designer provides several methods to control locking, checking in/checking out and merging of objects in the repository for example:</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Mary checks out MODULE01 and locks it</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Bob checks out MODULE01 and begins updates on it</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Bob attempts check in MODULE01 but cannot unless a new branch is created</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Strict locking prevented new modifications to be made on an object until the locking check out has been released.  When Mary checks MODULE01 back in releasing the lock, Bob will then have to merge in his changes to be able to allow a check in of his work.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Another possibility would be for Mary to not lock the module on checkout this would allow Bob to have checked out MODULE01 updated it and checked it back in.  Now Mary would have to Merge her modifications in with the modifications Bob made.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Object Versioning</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Versioning as it was known in past versions of Designer is very different with the new Oracle Repository.  Gone are the Dummy Applications and Skeletons created to try to keep everything in sync through versioning and exporting.  The repository maintains the associations and properties of old configurations without the baggage of Dummy and Skeleton applications through fundamental changes to the underlying database structure of the repository (hence the somewhat high overhead double repository upgrade process).  This new versioning concept is succinctly described by the Designer on line help and is provided here for reference and definition:</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><em>“Version control is the process of maintaining multiple versions of software development objects and is the most basic requirement for a software configuration management system. The Oracle Repository manages all repository objects, and any kind of file and directory. This enables tracking of changes to the source model, as well as tracking the changes to the contents of individual files.  Version control of any element within the Repository will not commence until the element has been initially checked in. Thus if no elements have been checked in then no versioned objects will exist within the Repository and the existing Designer tool set will behave as it does in previous releases.”</em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><em>While an object is checked in it is write protected and, therefore, cannot be modified. The object must be checked out before it can be changed. Each time an object is checked back into the repository, its version number is updated (for example, version 1.0 becomes version 1.1). In this way, Oracle Repository can keep track of every change that is made to an object, so that exactly the right version of the object is used when creating the application. As an object evolves from one version to the next, a graphical representation known as a version tree also evolves:”</em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Version Event Viewer</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Here is a graphic example of multiple Branches of development for a module but it is important to remember that non-repository objects contained in folders can be versioned and displayed as well.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Synchronization</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">The Repository has the capability of maintaining versions of non-repository objects and files.  Through an upload files can be copied from the file system into the repository.  When the file needs to be updated a copy is made to the file system (even if editing was invoked from within Designer) and once updated the Repository provides an upload and synchronization mechanism to keep the Repository up to date with the modifications.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">These following checks are done during a synchronization</span></p>
<p>&nbsp;</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Repository copy</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">File system copy</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">System Action</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unchanged</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unchanged</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">None</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unchanged Checked in</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Hijacked file &#8211; displays dialog for user intervention</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unchanged Checked out</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Uploads copy from file system</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unchanged</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Downloads copy to file system</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed Checked in</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Displays dialog for user intervention</span></td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed Checked out</span></td>
<td valign="top" width="108"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Changed</span></td>
<td valign="top" width="222"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Displays dialog for user intervention</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">If a file is updated and has not been checked out it is called “hijacked”.  The options available to reconcile this situation are to checkout and download the repository copy, overwriting the changes made to the file system copy; or to just check out the repository copy thereby allowing for an upload of the updated file system copy; or if parsers are available to merge the files.  These options are presented automatically whenever the Repository recognizes that modifications have been made to a non-checked out file.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Here are some informative notes from the Designer help files about synchronization:</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">·<em>     If you delete the repository copy but not the file system copy before synchronization, the repository copy reappears on synchronization. This is because in this case it is treated as a new file and uploaded accordingly. The same applies if you exclude the repository copy from your workarea.</em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><em>·     If you delete the repository copy but not the file system copy after the two have been synchronized, subsequent synchronization operations offer you the choice of deleting or retaining the file system copy. The same applies if you exclude the repository copy from your workarea. If you choose to retain the file system copy, on subsequent synchronization the repository copy reappears. This is because it is treated as a new file and uploaded accordingly.</em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><em>·     You cannot synchronize a file system file with a shortcut reference (denoted by the  icon). </em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;"><em>·     Users of UNIX systems cannot synchronize a repository-hosted file with a symbolic link on the file system</em></span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Merging repository objects</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">When an object has been modified more than once for concurrent changes to multiple configurations Designer allow the objects to be merged together.  There are three components involved in a merge a “target” and a “source” and a “common” ancestor version.  During the merge internal rules are used to create a result based on changes found in all three versions. The target version is updated and becomes available as a new version when it is checked back in.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">A comparison of two module versions            Selecting the Source for a Merge                       Selecting the Target</span></p>
<h3><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Unstructured Data</span></h3>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">The Oracle Repository has the capability to store and version objects created by other applications.  Word, PowerPoint, ASCII text or graphic documents in fact any file that can exist on the file system can be stored and version controlled in the Oracle Repository.   There are limitations on merge comparison of binary files and without parsers many other type of files may be difficult to distinguish differences.</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">To accomplish this a file system directory is mapped to a Repository Folder.  The file system contents can then be loaded directly into the Repository.  After check in there is no need to keep the file on the file system as it can be checked out of the Repository whenever there is a need to update it.  Removing it from the file system also prevents inadvertent updating of non-checked out files, which would result in the file being considered “hijacked”.  If a hijacked file is detected the “Resolve synchronization errors” window is invoked</span></p>
<p style="text-align: left;" align="center"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Compare utility</span></p>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">One of the options is to compare the files for differences by which is accomplished by opening a viewer that highlights the differences between the files.  A determination can then be made to; upload the file from disk, overwrite the file on disk with the repository copy or merge the two files.</span></p>
<h3><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Conclusion</span></h3>
<p><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">There are many new constructs, terminology and functionality involved with configuration management using Designer 6i and the Oracle Repository over past releases.  They provide for many of the requirements of a sound configuration management system.  By developing a configuration management framework to control objects both inside and outside the repository then problems associated with unintended modifications, lost code, missing documentation can be avoided without impacting productivity.  During the accompanying presentation to this paper each of the described components will be demonstrated to show how they are related and can be used to help provide a stable design and development environment.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><span style="font-size: medium; font-family: arial,helvetica,sans-serif;">Copyright © 2000,2001 by Scott Nelson</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/configuration-management-features-and-capabilities-of-oracle-designer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Tip: Fail on Two</title>
		<link>http://www.rtt.com/technical-tip-fail-on-two/</link>
		<comments>http://www.rtt.com/technical-tip-fail-on-two/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:22:46 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=241</guid>
		<description><![CDATA[It&#8217;s always better to know about a potential failure and fix it rather than have to scramble to find and allocate space when there is a failure.  This script will help identify (but not eliminate) impending space allocation failures.   The reason it&#8217;s not foolproof is that a segment taking an extent may cause another segment [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">It&#8217;s always better to know about a potential failure and fix it rather than have to scramble to find and allocate space when there is a failure.  This script will help identify (but not eliminate) impending space allocation failures. </span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The reason it&#8217;s not foolproof is that a segment taking an extent may cause another segment to not have enough space for it&#8217;s next extent.  Running this script daily  will catch most problems and if you &#8220;know your data&#8221; it will give you a heads up on what other segments will soon need attention.</span></p>
<pre> --******************************************************************
--
-- Script Name: fail_on_two.sql
--
-- Purpose: Determine if a Table, Index or Cluster segment will fail
--          when taking a next extent or if it will fail on taking 2 
--          extents</pre>
<p><span id="more-241"></span></p>
<pre>--
-- Description:  SELECT 1
-- Report on segment that will fail when taking 1 extent
--             UNION
--             SELECT 2
--             Report that there are no segments that will cause a failure
--             UNION
--             SELECT 3
--             Report on segment that will fail when taking 2 extents
--             UNION
--             SELECT 4
--             Report that there are no segments that will cause a failure
--             when taking 2 extents
--
--  Select statements 2 and 4 are optional but are included to produce 
--  output if everything is OK
--
-- Author: Scott Nelson
--         Results Through Technology, Inc.
--
--****************************************************************</pre>
<p>&nbsp;</p>
<pre>set feedback off
set echo off
set feedback off
set echo off
set pagesize 60
set linesize 132
col bkup hea 'Backup Date' format a15
col numfiles hea 'Number of Files' format 999
col problem_segment hea 'SEGMENT IN TABLESPACE' format a40
col next_ext_2 hea 'NEXT_EXTENT Info' format 999,999,999
col next_ext hea 'NEXT_EXTENT Info' format 999,999,999</pre>
<pre>PROMPT Checking for fail on next extent AND fail on taking two extents
set verify off
SELECT Segment_Type||' '||Segment_Name||' in '||
       ts.ts#||':'||Tablespace_Name problem_segment,
       next_Extent*2 next_ext_2
FROM   dba_segments ds, sys.ts$ ts
WHERE  ds.segment_type in ('INDEX','TABLE','CLUSTER')
  AND  ds.next_extent*2 &gt; (SELECT nvl(sum(dfs.bytes),0)
                           FROM dba_free_space dfs
                           WHERE dfs.bytes       &gt;= ds.next_extent
                           AND ds.tablespace_name = dfs.tablespace_name)
  AND  1 &lt; (SELECT count(segment_name)
            FROM   dba_segments ds2
            WHERE  ds2.tablespace_name = ds.tablespace_name)
              AND  ds.tablespace_name = ts.name
UNION
SELECT v.name||' has no fail on 2 extents' problem_segment,
       0 next_ext
FROM   v$database v
WHERE  not exists
       (SELECT 'x'
        FROM  dba_segments ds, sys.ts$ ts
        WHERE ds.segment_type in ('INDEX','TABLE','CLUSTER')
          AND ds.next_extent*2 &gt; (SELECT nvl(sum(dfs.bytes),0)
                                  FROM dba_free_space dfs
                                  WHERE dfs.bytes       &gt;= ds.next_extent
                                  AND ds.tablespace_name = dfs.tablespace_name)
          AND 1 &lt; (SELECT count(segment_name)
                   FROM dba_segments ds2
                   WHERE ds2.tablespace_name = ds.tablespace_name)
                   AND ds.tablespace_name    = ts.name)
UNION
SELECT Segment_Type||' '||Segment_Name||' in '||
       ts.ts#||':'||Tablespace_Name  problem_segment,
       next_extent next_ext
FROM   dba_segments ds, sys.ts$ ts
WHERE  ds.segment_type in ('INDEX','TABLE','CLUSTER')
  AND  ds.next_extent &gt;  (SELECT nvl(sum(dfs.bytes),0)
                          FROM   dba_free_space dfs
                          WHERE  dfs.bytes         &gt;= ds.next_extent
                            AND  ds.tablespace_name = dfs.tablespace_name)
  AND  1 &lt; (SELECT count(segment_name)
            FROM   dba_segments ds2
            WHERE  ds2.tablespace_name = ds.tablespace_name)
              AND  ds.tablespace_name  = ts.name
UNION
SELECT v.name||' has no fail on next extent' problem_segment,
       0 next_ext
FROM   v$database v
WHERE  not exists
       (SELECT 'x'
        FROM   dba_segments ds, sys.ts$ ts
        WHERE  ds.segment_type in ('INDEX','TABLE','CLUSTER')
          AND  ds.next_extent &gt; (SELECT nvl(sum(dfs.bytes),0)
                                 FROM   dba_free_space dfs
                                 WHERE  dfs.bytes &gt;= ds.next_extent
                                 AND  ds.tablespace_name = dfs.tablespace_name)
          AND  1 &lt; (SELECT count(segment_name)
                    FROM   dba_segments ds2
                    WHERE  ds2.tablespace_name = ds.tablespace_name)
                      AND  ds.tablespace_name  = ts.name)
/</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/technical-tip-fail-on-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Tip: Saving SQL values into SQL*Plus variables.</title>
		<link>http://www.rtt.com/technical-tip-saving-sql-values-into-sqlplus-variables/</link>
		<comments>http://www.rtt.com/technical-tip-saving-sql-values-into-sqlplus-variables/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:18:12 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=236</guid>
		<description><![CDATA[The SQL*Plus COLUMN command allows you to have SELECT statement results stored into a SQL*Plus variable. You can then use that variable later in your SQL*Plus script. The two scripts below are simple examples of this capability. rem rem Get the database name and use it in the spool command to spool to a file [...]]]></description>
				<content:encoded><![CDATA[<p>The SQL*Plus COLUMN command allows you to have SELECT statement results stored into a SQL*Plus variable. You can then use that variable later in your SQL*Plus script. The two scripts below are simple examples of this capability.</p>
<pre>rem 
rem Get the database name and use it in the spool command to spool to a file that 
rem is named according to the database name.
rem
column db_name noprint new_value db_name
select name db_name from v$database;
spool &amp;db_name..rpt

rem
rem Set the output linesize to the maximum length of any data in the column that you are
rem selecting.
rem
set pagesize 0
set feedback off
column line_size noprint new_value line_size
select max(length(mydata)) line_size from mytable;
set linesize &amp;line_size
spool mytable.rpt
select mydata from mytable;
spool off</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/technical-tip-saving-sql-values-into-sqlplus-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indexing decisions: hashing out and choosing among unique options</title>
		<link>http://www.rtt.com/indexing-decisions-hashing-out-and-choosing-among-unique-options/</link>
		<comments>http://www.rtt.com/indexing-decisions-hashing-out-and-choosing-among-unique-options/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:08:46 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=233</guid>
		<description><![CDATA[By Scott Nelson Oracle offers a number of different types of indexes that can be created to provide a means to expedite access to data stored in the database.  It is up to the DBA or Designer to determine which type of index should be implemented to best satisfy the performance requirements and provide the [...]]]></description>
				<content:encoded><![CDATA[<p>By Scott Nelson</p>
<p>Oracle offers a number of different types of indexes that can be created to provide a means to expedite access to data stored in the database.  It is up to the DBA or Designer to determine which type of index should be implemented to best satisfy the performance requirements and provide the optimal access paths to the data.<em> </em></p>
<p>Well-designed indexes avoid full table scans thereby decreasing access times.  Unique indexes insure the uniqueness of indexed attributes. Certain index types offer direct support for joins while certain index types support accessing table rows in a particular order.  In general, indexes are the best and easiest mechanism for optimizing a database.</p>
<p>However, poorly designed indexes may cause query execution to take longer than performing full table scans and they may require a large amount of disk space. Additionally having to many indexes or poorly chosen indexes on a table may adversely affect update operations.</p>
<p>B+ Tree Indexes<span id="more-233"></span></p>
<p>These are the most common indexes because they provide performance and functionality that benefits the widest variety of applications and data access methods.  The full explanation of the storage structure of a B-tree index is beyond the scope of this paper, but briefly B-tree indexes are stored in a tree structure that has branch blocks which point to lower-level blocks. The lower level index blocks are called leaf blocks that contain the indexed data value and a corresponding ROWID. The ROWID is a pointer that points directly back to the row in the data table.</p>
<p>One of the principal performance benefits of indexes is realized when an index is accessed and the data needed to satisfy the query resides in the index there is no need access the table. With an index organized table the index can serve as the source of data, rather than the table.  A B-tree index can dramatically improve response times when an application or user selects data where:</p>
<ul>
<li>A where clause value equals a specific key value</li>
<li>Index values are unique or close to unique</li>
<li>Rows are within a range of values</li>
</ul>
<p>&nbsp;</p>
<p>B-tree indexes improve the performance of queries that select a small percentage of rows from a table. Typically if more than 15% of the data will be returned an index should not be used as the performace hit of accessing the index and the table exceed accessing the entire table (full table scan).</p>
<p>In a nutshell:</p>
<ul>
<li>Structure is an inverted tree with one root node and several interior and leaf nodes.</li>
<li>B+ trees are balanced in that all leaf nodes are equidistant from the root node.</li>
<li></li>
</ul>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="120" height="0"></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p><br clear="ALL" />All nodes have a similar structure containing indexed values and pointers to other index nodes or data blocks. (fig 1)</p>
<p align="center">Fig 1</p>
<p>&nbsp;</p>
<ul>
<li>All root and interior pointers reference other index nodes.</li>
<li>All leaf pointers reference data blocks except for the last which points to the next sequential index block.</li>
<li>Depth of tree dynamically grows and shrinks with data.</li>
<li>Depth of tree grows and shrinks at much slower rate than data.</li>
<li>Top few levels of the tree may be cached.</li>
<li>Leaf node values are dense having a value-pointer combination for every data value in the index.</li>
<li>The value slots in the root and interior nodes are compacted.</li>
<li>Completely NULL values are not stored but composite indexed attributes with at least one non-NULL attribute value are stored.</li>
</ul>
<p>&nbsp;</p>
<p>B+ Tree Indexes have many advantages and no severe disadvantages.  The disadvantages are disk space usage and small performance degradation with large table growth.  They have been in practical use for years and are well understood.  Except for a few notable cases, they should be the index of choice.  They support fast random access on all or portions of the indexed attributes; accessing one data row requires at most the depth of the B+ tree plus one accesses.  They support sequential access, range queries and sorting on all or a portion of the indexed attributes.  They efficiently check for the existence or nonexistence of data records having specific values for the indexed attributes and,  in some cases, can completely answer a query.</p>
<p>Clustering</p>
<p>Clustering refers to the practice of grouping one or more rows from possibly more than one table in the same data block.  The grouping is accomplished via attributes which all the tables share in common; these attributes are known as the cluster key.  Records with a common cluster key value are stored in the same block(s).  A cluster is one or more tables that share the same data blocks because they share common columns and are often used together.</p>
<p>There are two primary benefits of clustering data:</p>
<ul>
<li>Disk I/O is reduced and access time improves for joins of clustered tables.</li>
<li>Disk storage is reduced.  Each cluster key value is stored only once each in the cluster and the cluster index, no matter how many rows of different tables contain the value.</li>
</ul>
<p>&nbsp;</p>
<p>There are two different types of clusters: clustered by the value of one or more attributes or clustered by the value of a function applied to one or more attributes.</p>
<ul>
<li>First type, indexed clustering, requires B+ tree index on the cluster key.</li>
<li>Second type, hash clustering, is also known as hashing and requires no auxiliary index structure.</li>
</ul>
<p>&nbsp;</p>
<table cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td width="91" height="0"></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Indexed Cluster</p>
<p>A clustered index is a sparse B+ tree index on the distinct values of the cluster key.  Clustering offers fast access for rows of one or more tables which are frequently accessed together, e.g., joins, but not inserted together..  Use indexed clusters for critical transactions where several rows of one or more tables are accessed together using equality on the full cluster key and those rows will not generally be in the same block,  A side benefit is that a cluster may conserve space as the cluster key is not repeated.</p>
<p>Hashed Clusters<em> </em></p>
<p>For data warehouse applications hash clusters can improve the performance of data retrieval.  A hash function is used to generate a distribution of numeric values called hash values, which are based on specific cluster key values.  To find or store a row in a hash cluster, the hash function is applied to the row’s cluster key value. The hash value returned corresponds to a data block in the cluster, which is read or written to on behalf of the issued statement.</p>
<p>If all goes well, clusters guarantee an access time almost as fast as rowid access (1 block read).  A single hash bucket is devoted to the hashed value of fully NULL keys should any exist.  One of the main problem with hash clusters is that the number of clusters is fixed for the lifetime of the cluster  in that the number of hash buckets cannot grow beyond those initially allocated.  Therefore tables in a hash cluster should be relatively static or at least possess a bounded growth pattern.</p>
<p>If the number of hash clusters is too small, collisions will occur and performance will degrade.  Also the unanticipated insertions to tables that are members of a hash cluster may cause the creation of overflow buckets which is a form of chaining.  Another limitation is that the hash function can only be used for equality conditions on the full cluster key &#8212; not range queries, access via partial key, etc.</p>
<p>Hashed Index Evaluation</p>
<p>Use hash clusters for critical transactions where several rows of one or more tables are accessed together using equality on the full cluster key and those rows will generally not be in the same block OR need fast access on a single row of a table via equality on a unique key.</p>
<p>The ideal candidate for hash cluster organization is information that could be represented as a fixed sized table and is frequently accessed on its full primary key.  Another candidate is a constant-sized or slowly growing table whose numeric primary key is frequently used as a foreign key in other tables.</p>
<p>Bitmap Indexes</p>
<p>A B-tree index is most effective for high-cardinality data.  A bitmapped index is most appropriate and effective for low-cardinality data, where a column has relatively few distinct values. Bitmapped indexing provides both performance benefits and storage savings.</p>
<p>When a bitmap index is created on a column, a bit stream (ones and zeros) is created for each distinct value in the indexed column. A one or zero represents whether or not a record in the table is equal to the bit-streamed value.</p>
<p>Bitmap indexes are an efficient representation of an inverted list index structure. (Fig 2) where each table row is represented by a corresponding bit.</p>
<p>Bitmap Indexes support fast random access on indexed attributes as well as inequality and range queries.  They efficiently check for the existence or nonexistence of data records having specific values for the indexed attributes and, in some cases, can completely answer an aggregate query.  They outperform B+ tree indexes when there are a large number of rows and #rows/#distinct index values.  They may also outperform B+ tree indexes when there are a large number of rows and #rows/#distinct index values &lt; 100 if most queries have complex WHERE clauses.</p>
<p>While bitmap indexes are not for most OLTP applications they are ideal for data warehousing databases.  They are very effective for use in an environment where there are no concurrent DML operations, the indexed table has a large number of rows, and #rows/#distinct index values &gt;= 100 OR most queries which might use the index have a complex WHERE clause.</p>
<p>INDEX-ORGANIZED TABLES</p>
<p>In a B-tree index, the table data is stored in a database object, and the index data, the B-tree, is stored<br />
in another database object. The index data object includes the indexed column values and a ROWID<br />
pointing into the data table. In other words, the indexed values are stored twice, once in the table, and<br />
once in the index.</p>
<p>Usually the indexed columns are a small part of the overall data stored in a row resulting in an index that is smaller than the table. Sometimes an index is comprised of a majority of the columns of the table. This results in the redundant storage of the data. In this case the table would benefit from an index-organized table</p>
<p>In an index-organized table, only one database object is used to store both the data and the index there is no database object used to only store the data. The index structure holds both the indexed column values and the remaining column values.</p>
<p>To implement an index-organized table it is created using the INDEX ORGANIZED option.  Access to the index-organized table is just like a regular table, using standard SQL statements for query, insert, update, or delete.  The catch to index-organized tables is that no secondary indexes can be created on the table and an updated row may force the entire row to be moved.</p>
<p>Because all data, the key columns and the remaining columns, is stored in the B-tree structure, index-organized tables provide a faster, key-based access to table data for queries involving exact match and/or range search. Once the search has located the key values, the remaining data is present at that location, so there is no need to follow a ROWID back to the table data, as would be the case with a table and B-tree index structure. This eliminates one I/O, namely the read of the table.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/indexing-decisions-hashing-out-and-choosing-among-unique-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explain It To Me One More Time</title>
		<link>http://www.rtt.com/explain-it-to-me-one-more-time/</link>
		<comments>http://www.rtt.com/explain-it-to-me-one-more-time/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:05:29 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=229</guid>
		<description><![CDATA[By Scott Nelson I do the very best I know how &#8211; the very best I can; and I mean to keep doing so until the end. Abraham Lincoln So begins the Optimizer chapter in the Oracle Server Concepts manual1 and it&#8217;s a fitting way to begin this paper.  I take this quote as meaning [...]]]></description>
				<content:encoded><![CDATA[<p>By Scott Nelson</p>
<blockquote><p><em>I do the very best I know how &#8211; the very best I can; and I mean to keep doing so until the end.</em></p>
<p>Abraham Lincoln</p></blockquote>
<p>So begins the Optimizer chapter in the Oracle Server Concepts manual<sup>1</sup> and it&#8217;s a fitting way to begin this paper.  I take this quote as meaning that no matter how a query is written Oracle will not give up on it until either there is an answer or Oracle has consumed every resource available.  Most of us have seen the later at one time or another.  It&#8217;s that query from hell that brings out the best in a user community</p>
<p>This paper is intended to increase your knowledge of the Explain Plan and TKPROF utilities and gain an understanding how to affect the Oracle Optimizer with initialization parameters, query structure and hints.  The  Explain Plan and TKPROF utilities tend to be underutilized because their outputs seem so complicated and convoluted. This papers intentions is to help you learn to interpret the output of these utilities, understand why the optimizer chooses different execution plans and how to override the default optimization of a query.  Nested loop, merge join, filter, projection <span id="more-229"></span>and range scans represent some of the many options and methods of getting at the data.  Understanding how Oracle manipulates and handles your query is the key to maximizing your applications performance.</p>
<h2>The Optimizer</h2>
<p>&#8220;Attention: In general, you should use the cost-based optimization approach. The rule-based approach is available for the benefit of existing applications, but all new optimizer functionality uses the cost-based approach.&#8221;</p>
<p>Oracle 7 Server Tuning manual</p>
<p>Why use the cost based optimizer?  Oracle says that the cost-based approach typically chooses an execution plan that is as good as or better than the plan chosen by the rule-based approach, that the cost-based approach improves productivity by eliminating the need to tune your SQL statements.  And if you’re using star queries, hash joins, histograms, parallel query or partition views cost based optimization must be used to achieve efficient performance. In the case of parallel query and partition views Cost-based optimization is always used.</p>
<p>It is important to remember that the plans generated by the cost-based optimizer depend on the sizes of the tables.  This is of particular relevance to developers when using the cost-based optimizer with a subset of the data for development or testing.  It is important to not assume that the plan chosen by the optimizer for a fully populated database will be the same as that chosen for a subset of the database.</p>
<p>To enable cost-based optimization for an instance set the OPTIMIZER_MODE initialization parameter  to CHOOSE.  Alternatively to enable cost-based optimization for your session only, issue an ALTER SESSION statement with an OPTIMIZER_GOAL option value of ALL_ROWS or FIRST_ROWS.  To limit the scope of the optimizer even more you may enable cost-based optimization for an individual SQL statement by using any hint other than RULE.  Another important quote from the Oracle Documentation is &#8220;<strong>The RULE hint, along with the rule-based approach, will not be available in future versions of Oracle.&#8221;</strong>  I would consider that as the definitive word on the subject (even though they have been saying it for years and it&#8217;s still around)</p>
<p>Even if rule-based optimization has been selected as the system default  the use of hints may causes the cost-based optimization to be invoked.  Therefore, because cost-based optimization is dependent on statistics, it is important to analyze all tables referenced in a query which has hints.</p>
<p>Because the cost-based approach relies on statistics they will need to be generated for all tables, clusters, and indexes accessed by SQL statements before using the cost-based approach. If the size and data distribution of these tables changes frequently, you should generate these statistics regularly to ensure that they accurately represent the data in the tables.</p>
<p>Statistics can be generated using the ANALYZE command by either estimating or computing the values.  <em>The time necessary to compute statistics for a table is approximately equal to the time required to perform a full table scan and a sort of the rows of the table</em>.  If there is not enough space in memory to perform the sort, temporary space may be required.  To save time and resources use estimations as Oracle requires only enough space to perform a scan and sort of the rows in the requested sample.  When estimating statistics for tables and clusters a recommended sample size of 20% provides, in almost all cases, accurate and statistically valid results.  For indexes, computation does not take up as much time or space, so it is best to perform a computation whenever possible.</p>
<p>There are two goals that can be specified when using the cost based optimizer; best throughput or best response Time. The default cost-based approach optimizes for best throughput.  This is good for batch jobs but not so good for OLTP systems where response time is important.</p>
<p>The OPTIMIZER_GOAL is an initialization parameter that can be overridden at the session level by issuing an ALTER SESSION statement with the OPTIMIZER_GOAL option of ALL_ROWS.  This will cause the optimizer to select execution plans for best throughput.  Conversely specifying FIRST_ROWS will cause the optimizer to select execution plans that will provide best response time</p>
<p>These initialization parameters have a direct im[act on the cost based optimizer:</p>
<ul>
<li>OPTIMIZER_SEARCH_LIMIT: the maximum number of tables in the FROM clause for which all possible join permutations will be considered</li>
<li>OPTIMIZER_GOAL: dynamically changeable parameter you can use to modify the goal of the cost-based optimization approach for your session. Used only in the session; not used in initialization file.</li>
<li>OPTIMIZER_MODE: sets the mode of the optimizer at instance startup: rule-based, cost based optimized for throughput or response time, or a choice based on presence of statistics. Used in initialization file only; use OPTIMIZER_MODE to change the value during a session.</li>
<li>OPTIMIZER_PERCENT_PARALLEL: defines the amount of parallelism that the optimizer uses in its cost functions</li>
<li>HASH_JOIN_ENABLED: enables or disables the hash join feature</li>
<li>HASH_AREA_SIZE: larger value causes hash join costs to be cheaper, giving more hash joins</li>
<li>HASH_MULTIBLOCK_IO_COUNT: larger value causes hash join costs to be cheaper, giving more hash joins</li>
<li>SORT_AREA_SIZE: large value causes sort costs to be cheaper, giving more sort merge joins</li>
<li>SORT_DIRECT_WRITES: gives lower sort costs and more sort merge joins</li>
<li>SORT_WRITE_BUFFER_SIZE: large value causes sort costs to be cheaper, giving more sort merge joins</li>
<li>DB_FILE_MULTIBLOCK_READ_COUNT: large value gives cheaper table scan cost and favors table scans over indexes</li>
<li>ALWAYS_ANTI_JOIN: sets the type of antijoin that Oracle uses: NESTED_LOOPS/MERGE/HASH</li>
<li>PARTITION_VIEW_ENABLED: enables partition views</li>
<li>V733_PLANS_ENABLED: enables a set of special optimizations: GROUP BY No Sort, Index Fast Full Scans, and using B-tree indexes in bitmap access paths provided bitmap indexes exist on the table</li>
<li>BITMAP_MERGE_AREA_SIZE: is the size of the area used to merge the different bitmaps that match a range predicate. Larger size will favor use of bitmap indexes for range predicates.</li>
</ul>
<p>Rule-Based Optimization</p>
<p>If you neither collect statistics nor add hints to your SQL statements, your statements will use rule-based optimization.  With the rule-based approach, the optimizer chooses whether to use an access path based on these factors:</p>
<ul>
<li>the available access paths for the statement</li>
<li>the ranks of these access paths</li>
</ul>
<p>The optimizer looks at the conditions in the statements WHERE clause to determine which access paths are available. The optimizer then chooses the most highly ranked available access path.  It is during this operation when the rule-based approach always chooses an access path that uses an index if one is available, even if a full table scan might execute faster.</p>
<p>Rank   Access Path</p>
<p>1   Single row by ROWID</p>
<p>2   Single row by cluster join</p>
<p>3   Single row by hash cluster key with unique or primary key</p>
<p>4   Single row by unique or primary key</p>
<p>5   Cluster join</p>
<p>6   Hash cluster key</p>
<p>7   Indexed cluster key</p>
<p>8   Composite key</p>
<p>9   Single-column indexes</p>
<p>10   Bounded range search on indexed columns</p>
<p>11   Unbounded range search on indexed columns</p>
<p>12   Sort-merge join</p>
<p>13   MAX or MIN of indexed column</p>
<p>14   ORDER BY on indexed columns</p>
<p>15   Full table scan</p>
<p>Unranked Access Paths</p>
<p>-  Fast full index scan (not available with the rule-based optimizer)</p>
<p>-  Bitmap index scan (not available with the rule-based optimizer)</p>
<p>&nbsp;</p>
<p>Access Methods</p>
<p>Full Table Scans: a full table scan retrieves all rows in the table, examining each row to determine whether it satisfies the statement&#8217;s WHERE clause.</p>
<p>Table Access by ROWID : a table access by ROWID is the fastest way for Oracle to find a single row.</p>
<p>Cluster Scans: after obtaining the ROWID of one of the selected rows by scanning the cluster index the rows  are returned.</p>
<p>Hash Scans: determine the hash value by applying a hash function to a cluster key value specified by the statement then scans the data blocks containing rows with that hash value.</p>
<p>Index Scans: searche the index for the indexed column values accessed by the statement. If the statement accesses only columns of the index the values are returned directly from the index without having to access the table.  An Index Scan can be one of these types:</p>
<ul>
<li>unique scan: a unique scan of an index returns only a single ROWID</li>
<li>range scan:  a range scan of an index can return zero or more ROWIDs.</li>
<li>full scan: full scan can be used to eliminate a sort operation. It reads the blocks singly.</li>
<li>fast full scan: fast full scan accesses the data in the index itself, without accessing the table. It cannot be used to eliminate a sort operation. It reads the entire index using multiblock reads (unlike a full index scan) and can be parallelized.</li>
<li>bitmap: bitmap indexes use a bitmap for key values and a mapping function that converts each bit position to a ROWID. Bitmaps efficiently merge indexes that correspond to several conditions in a WHERE clause, using Boolean operations to resolve AND and OR conditions.</li>
</ul>
<p>Choosing Execution Plans</p>
<p>The optimizer first determines whether joining two or more of the tables definitely results in a row source containing at most one row. The optimizer recognizes such situations based on UNIQUE and PRIMARY KEY constraints on the tables. If such a situation exists, the optimizer places these tables first in the join order. The optimizer then optimizes the join of the remaining set of tables.</p>
<p>For join statements with outer join conditions, the table with the outer join operator must come after the other table in the condition in the join order. The optimizer does not consider join orders that violate this rule.</p>
<p>Cost-Based<sup>1</sup></p>
<p>&#8220;With the cost-based approach, the optimizer generates a set of execution plans based on the possible join orders, join operations, and available access paths. The optimizer then estimates the cost of each plan and chooses the one with the lowest cost. The optimizer estimates costs in these ways:</p>
<ul>
<li>The cost of a nested loops operation is based on the cost of reading each selected row of the outer table and each of its matching rows of the inner table into memory. The optimizer estimates these costs using the statistics in the data dictionary.</li>
<li>The cost of a sort-merge join is based largely on the cost of reading all the sources into memory and sorting them.</li>
<li>The optimizer also considers other factors when determining the cost of each operation. For example:</li>
<li>A smaller sort area size is likely to increase the cost for a sort-merge join because sorting takes more CPU time and I/O in a smaller sort area. Sort area size is specified by the initialization parameter SORT_AREA_SIZE.</li>
<li>A larger multiblock read count is likely to decrease the cost for a sort-merge join in relation to a nested loops join. If a large number of sequential blocks can be read from disk in a single I/O, an index on the inner table for the nested loops join is less likely to improve performance over a full table scan. The multiblock read count is specified by the initialization parameter DB_FILE_MULTIBLOCK_READ_COUNT.</li>
<li>For join statements with outer join conditions, the table with the outer join operator must come after the other table in the condition in the join order. The optimizer does not consider join orders that violate this rule.</li>
</ul>
<p>With the cost-based approach, the optimizer&#8217;s choice of join orders can be overridden with the ORDERED hint. If the ORDERED hint specifies a join order that violates the rule for outer join, the optimizer ignores the hint and chooses the order. You can also override the optimizer&#8217;s choice of join operations with hints.&#8221;</p>
<p>Rule-Based<sup>1</sup></p>
<p>&#8220;With the rule-based approach, the optimizer follows these steps to choose an execution plan for a statement that joins R tables:</p>
<p>The optimizer generates a set of R join orders, each with a different table as the first table. The optimizer generates each potential join order using this algorithm:</p>
<ul>
<li>To fill each position in the join order, the optimizer chooses the table with the most highly ranked available access path according to the ranks for access paths.  The optimizer repeats this step to fill each subsequent position in the join order.</li>
<li>For each table in the join order, the optimizer also chooses the operation with which to join the table to the previous table or row source in the order. The optimizer does this by &#8220;ranking&#8221; the sort-merge operation as access path 12 and applying these rules:
<ul>
<li>If the access path for the chosen table is ranked 11 or better, the optimizer chooses a nested loops operation using the previous table or row source in the join order as the outer table.</li>
<li>If the access path for the table is ranked lower than 12, and there is an equijoin condition between the chosen table and the previous table or row source in join order, the optimizer chooses a sort-merge operation.</li>
<li>If the access path for the chosen table is ranked lower than 12, and there is not an equijoin condition, the optimizer chooses a nested loops operation with the previous table or row source in the join order as the outer table.</li>
</ul>
</li>
</ul>
<p>The optimizer then chooses among the resulting set of execution plans. The goal of the optimizer&#8217;s choice is to maximize the number of nested loops join operations in which the inner table is accessed using an index scan. Since a nested loops join involves accessing the inner table many times, an index on the inner table can greatly improve the performance of a nested loops join.</p>
<p>Usually, the optimizer does not consider the order in which tables appear in the FROM clause when choosing an execution plan. The optimizer makes this choice by applying the following rules in order:</p>
<ul>
<li>The optimizer chooses the execution plan with the fewest nested-loops operations in which the inner table is accessed with a full table scan.</li>
<li>If there is a tie, the optimizer chooses the execution plan with the fewest sort-merge operations.</li>
<li>If there is still a tie, the optimizer chooses the execution plan for which the first table in the join order has the most highly ranked access path:</li>
<li>If there is a tie among multiple plans whose first tables are accessed by the single-column indexes access path, the optimizer chooses the plan whose first table is accessed with the most merged indexes.</li>
<li>If there is a tie among multiple plans whose first tables are accessed by bounded range scans, the optimizer chooses the plan whose first table is accessed with the greatest number of leading columns of the composite index.</li>
<li>If there is still a tie, the optimizer chooses the execution plan for which the first table appears later in the query&#8217;s FROM clause.&#8221;</li>
</ul>
<p>Explain Plan</p>
<p>The EXPLAIN PLAN command displays the execution plan chosen by the Oracle optimizer for DML statements. The statement&#8217;s execution plan is the sequence of steps that Oracle performs to execute the statement and by examining the execution plan, you can see how Oracle will execute the SQL statement.</p>
<p>The explain plan produced is based on the data and statistics that is available when the explain plan is run.  This can differ significantly between a test of development environment where a developer is likely to be working versus a production environment.   According to Oracle version 8i of the database will allow for the export and import of statistics from one database to another.</p>
<p>Create the Output Table</p>
<p>Before you can issue an EXPLAIN PLAN or use the AUTOTRACE command, the PLAN_TABLE must be created to hold the commands output.  The plan table is version specific so be sure to create the plan table appropriate for your version.  In the account you intend to execute the EXPLAIN PLAN command run the SQL script UTLXPLAN.SQL (typically found in the rdbms directory) to create the PLAN_TABLE or issue the following SQL statement (version 8.0.4):</p>
<p>CREATE TABLE plan_table</p>
<p>(statement_id     VARCHAR2(30),</p>
<p>timestamp        DATE,</p>
<p>remarks          VARCHAR2(80),</p>
<p>operation        VARCHAR2(30),</p>
<p>options          VARCHAR2(30),</p>
<p>object_node      VARCHAR2(128),</p>
<p>object_owner     VARCHAR2(30),</p>
<p>object_name      VARCHAR2(30),</p>
<p>object_instance  NUMERIC,</p>
<p>object_type      VARCHAR2(30),</p>
<p>optimizer        VARCHAR2(255),</p>
<p>search_columns   NUMERIC,</p>
<p>id               NUMERIC,</p>
<p>parent_id        NUMERIC,</p>
<p>position         NUMERIC,</p>
<p>cost             NUMERIC,</p>
<p>cardinality      NUMERIC,</p>
<p>bytes            NUMERIC,</p>
<p>other_tag        VARCHAR2(255)</p>
<p>other            LONG);</p>
<p>&nbsp;</p>
<p>The descriptions for the columns in this table can be found in the Oracle Tuning Manual.</p>
<p>&nbsp;</p>
<p>AUTOTRACE</p>
<p>If you’re using SQL*PLUS 3.3 or later you can use the autotrace command to automatically explain any DML statements executed during the session. Whether you are using autotrace or manually explaining the execution plan the PLAN_TABLE table must already have been created.  Additionally, when using autotrace you need to be granted the PLUSTRACE role.</p>
<p>&nbsp;</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="169">SET AUTOTRACE OFF</td>
<td valign="top" width="318">No AUTOTRACE report is generated. This is the default.</td>
</tr>
<tr>
<td valign="top" width="169">SET AUTOTRACE ON EXPLAIN</td>
<td valign="top" width="318">The AUTOTRACE report shows only the optimizer execution path.</td>
</tr>
<tr>
<td valign="top" width="169">SET AUTOTRACE ON STATISTICS</td>
<td valign="top" width="318">Shows only the SQL statement execution statistics.</td>
</tr>
<tr>
<td valign="top" width="169">SET AUTOTRACE ON</td>
<td valign="top" width="318">Both optimizer execution path and SQL statement execution stats.</td>
</tr>
<tr>
<td valign="top" width="169">SET AUTOTRACE TRACEONLY</td>
<td valign="top" width="318">Suppresses the printing of the user&#8217;s query output, if any.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>SET AUTOTRACE ON</p>
<p>SQL&gt; set autotrace traceonly</p>
<p>SQL&gt;</p>
<p>select d.dname,e.empno,e.ename</p>
<p>from scott.emp e,scott.dept d</p>
<p>where e.deptno=d.deptno</p>
<p>order by 1;</p>
<p>&nbsp;</p>
<p>Execution Plan</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>0      SELECT STATEMENT Optimizer=CHOOSE</p>
<p>1    0   SORT (ORDER BY)</p>
<p>2    1     NESTED LOOPS</p>
<p>3    2       TABLE ACCESS (FULL) OF &#8216;EMP&#8217;</p>
<p>4    2       TABLE ACCESS (BY INDEX ROWID) OF &#8216;DEPT&#8217;</p>
<p>5    4         INDEX (UNIQUE SCAN) OF &#8216;PK_DEPT&#8217; (UNIQUE)</p>
<p>&nbsp;</p>
<p>Statistics</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>0  recursive calls</p>
<p>3  db block gets</p>
<p>17  consistent gets</p>
<p>0  physical reads</p>
<p>0  redo size</p>
<p>1093  bytes sent via SQL*Net to client</p>
<p>723  bytes received via SQL*Net from client</p>
<p>4  SQL*Net roundtrips to/from client</p>
<p>2  sorts (memory)</p>
<p>0  sorts (disk)</p>
<p>14  rows processed</p>
<p>Running EXPLAIN PLAN</p>
<p>To execute an EXPLAIN PLAN place the EXPLAIN PLAN and SET STATEMENT ID commands just prior to the statement to be explained.  Then using SQL*PLUS execute the concatenated statement.</p>
<p>SQL&gt; Truncate table plan_table;</p>
<p>&nbsp;</p>
<p>Table truncated.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>EXPLAIN PLAN</p>
<p>SET STATEMENT_ID = &#8216;Explain Test&#8217; FOR</p>
<p>select d.dname,e.empno,e.ename</p>
<p>from scott.emp e,scott.dept d</p>
<p>where e.deptno=d.deptno;</p>
<p>&nbsp;</p>
<p>Upon execution the EXPLAIN PLAN statement will generate an execution plan and place the output in the PLAN_TABLE:</p>
<p>There are many ways to extract information from the PLAN_TABLE.  To see the output of the explain plan in a tabular format the follwing select statement can be used:</p>
<p>SELECT operation, options, object_name, id, parent_id, position</p>
<p>FROM plan_table</p>
<p>WHERE statement_id = &#8216;Explain Test&#8217;</p>
<p>ORDER BY id;</p>
<p>&nbsp;</p>
<p>OPERATION            OPTIONS         OBJECT_NAME       ID PARENT_ID POSITION</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212; &#8212;- &#8212;&#8212;&#8212; &#8212;&#8212;&#8211;</p>
<p>SELECT STATEMENT                                        0</p>
<p>NESTED LOOPS                                            1         0        1</p>
<p>TABLE ACCESS         FULL            EMP                2         1        1</p>
<p>TABLE ACCESS         BY INDEX ROWID  DEPT               3         1        2</p>
<p>INDEX                UNIQUE SCAN     PK_DEPT            4         3        1</p>
<p>&nbsp;</p>
<p>The ORDER BY clause returns the steps of the execution plan sequentially by ID value. However, Oracle does not perform the steps in this order. PARENT_ID receives information from ID, yet more than one ID step can feed into PARENT_ID.</p>
<p>Selecting from the Plan Table with a nested format of the output that more closely depicts the processing order used for the SQL statement.</p>
<p>If the dept and emp tables have been analyzed the plan looks like this:</p>
<p>select decode(id,0,&#8221;,lpad(&#8216; &#8216;,2*(level-1))||level||&#8217;.'||position)||&#8217; &#8216;||</p>
<p>operation||&#8217; &#8216;||options||&#8217; &#8216;||object_name||&#8217; &#8216;||object_type||&#8221;||</p>
<p>decode(id,0,&#8217;Cost = &#8216;||position) Query_plan</p>
<p>from plan_table</p>
<p>connect by prior id = parent_id and statement_id = &#8216;Explain Test&#8217;</p>
<p>start with id = 0 and statement_id = &#8216;Explain Test&#8217;;</p>
<p>&nbsp;</p>
<p>QUERY_PLAN</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>SELECT STATEMENT    Cost = 3</p>
<p>2.1 HASH JOIN</p>
<p>3.1 TABLE ACCESS FULL DEPT</p>
<p>3.2 TABLE ACCESS FULL EMP</p>
<p>&nbsp;</p>
<p>And if the dept and emp tables have not been analyzed the plan looks like this:</p>
<p><strong> </strong></p>
<p>select decode(id,0,&#8221;,      lpad(&#8216; &#8216;,2*(level-1))||level||&#8217;.'||position)||&#8217; &#8216;||</p>
<p>operation||&#8217; &#8216;||options||&#8217; &#8216;||object_name||&#8217; &#8216;||   object_type||&#8217; &#8216;||</p>
<p>decode(id,0,&#8217;Cost = &#8216;||position) Query_plan  from plan_table</p>
<p>connect by prior id = parent_id and statement_id = &#8216;Explain Test&#8217;</p>
<p>start with id = 0 and statement_id = &#8216;Explain Test&#8217;;</p>
<p>&nbsp;</p>
<p>QUERY_PLAN</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>SELECT STATEMENT    Cost =</p>
<p>2.1 NESTED LOOPS</p>
<p>3.1 TABLE ACCESS FULL EMP</p>
<p>3.2 TABLE ACCESS BY INDEX ROWID DEPT</p>
<p>4.1 INDEX UNIQUE SCAN PK_DEPT UNIQUE</p>
<p>EXPLAIN PLAN Operations<sup>2</sup></p>
<p>The operations and options used by the explain plan are summarized below:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" width="96">OPERATION</td>
<td valign="bottom" width="78">OPTION</td>
<td valign="bottom" width="318">Description</td>
</tr>
<tr>
<td valign="top" width="96">AND-EQUAL</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts multiple sets of ROWIDs and returns the intersection of the sets, eliminating duplicates. This operation is used for the single-column indexes access path.</td>
</tr>
<tr>
<td valign="top" width="96">BITMAP</td>
<td valign="top" width="78">CONVERSION</td>
<td valign="top" width="318">TO ROWIDS converts the bitmap representation to actual ROWIDs that can be used to access the table.FROM ROWIDS converts the ROWIDs to a bitmap representation.COUNT returns the number of ROWIDs if the actual values are not needed.</td>
</tr>
<tr>
<td valign="top" width="96"></td>
<td valign="top" width="78">INDEX</td>
<td valign="top" width="318">SINGLE VALUE looks up the bitmap for a single key value in the index.RANGE SCAN retrieves bitmaps for a key value range.FULL SCAN: A bitmap index full scan is performed if there is no start or stop key.</td>
</tr>
<tr>
<td valign="top" width="96"></td>
<td valign="top" width="78">MERGE</td>
<td valign="top" width="318">Merges several bitmaps resulting from a range scan into one bitmap.</td>
</tr>
<tr>
<td valign="top" width="96"></td>
<td valign="top" width="78">MINUS</td>
<td valign="top" width="318">Subtracts the bits of one bitmap from another. This row source is used for negated predicates and can be used only if there are some nonnegated predicates yielding a bitmap from which the subtraction can take place.</td>
</tr>
<tr>
<td valign="top" width="96"></td>
<td valign="top" width="78">OR</td>
<td valign="top" width="318">Computes the bitwise OR of two bitmaps.</td>
</tr>
<tr>
<td valign="top" width="96">CONNECT BY</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">A retrieval of rows in a hierarchical order for a query containing a CONNECT BY clause.</td>
</tr>
<tr>
<td valign="top" width="96">CONCATENATION</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts multiple sets of rows and returns the union-all of the sets.</td>
</tr>
<tr>
<td rowspan="2" valign="top" width="96">COUNT</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that counts the number of rows selected from a table.</td>
</tr>
<tr>
<td valign="top" width="78">STOPKEY</td>
<td valign="top" width="318">A count operation where the number of rows returned is limited by the ROWNUM expression in the WHERE clause.</td>
</tr>
<tr>
<td valign="top" width="96">FILTER</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts a set of rows, eliminates some of them, and returns the rest.</td>
</tr>
<tr>
<td valign="top" width="96">FIRST ROW</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">A retrieval on only the first row selected by a query.</td>
</tr>
<tr>
<td valign="top" width="96">FOR UPDATE</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that retrieves and locks the rows selected by a query containing a FOR UPDATE clause.</td>
</tr>
<tr>
<td rowspan="3" valign="top" width="96">HASH JOIN</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that joins two sets of rows, and returns the result.</td>
</tr>
<tr>
<td valign="top" width="78">ANTI</td>
<td valign="top" width="318">A hash anti-join.</td>
</tr>
<tr>
<td valign="top" width="78">SEMI</td>
<td valign="top" width="318">A hash semi-join.</td>
</tr>
<tr>
<td rowspan="3" valign="top" width="96">INDEX</td>
<td valign="top" width="78">UNIQUE SCAN</td>
<td valign="top" width="318">A retrieval of a single ROWID from an index.</td>
</tr>
<tr>
<td valign="top" width="78">RANGE SCAN</td>
<td valign="top" width="318">A retrieval of one or more ROWIDs from an index. Indexed values are scanned in ascending order.</td>
</tr>
<tr>
<td valign="top" width="78">RANGE SCAN DESCENDING</td>
<td valign="top" width="318">A retrieval of one or more ROWIDs from an index. Indexed values are scanned in descending order.</td>
</tr>
<tr>
<td valign="top" width="96">INLIST ITERATOR</td>
<td valign="top" width="78">CONCATENATED</td>
<td valign="top" width="318">Iterates over the operation below it, for each value in the IN list predicate.</td>
</tr>
<tr>
<td valign="top" width="96">INTERSECTION</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts two sets of rows and returns the intersection of the sets, eliminating duplicates.</td>
</tr>
<tr>
<td rowspan="4" valign="top" width="96">MERGE JOIN</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts two sets of rows, each sorted by a specific value, combines each row from one set with the matching rows from the other, and returns the result.</td>
</tr>
<tr>
<td valign="top" width="78">OUTER</td>
<td valign="top" width="318">A merge join operation to perform an outer join statement.</td>
</tr>
<tr>
<td valign="top" width="78">ANTI</td>
<td valign="top" width="318">A merge anti-join.</td>
</tr>
<tr>
<td valign="top" width="78">SEMI</td>
<td valign="top" width="318">A merge semi-join.</td>
</tr>
<tr>
<td valign="top" width="96">CONNECT BY</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">A retrieval of rows in hierarchical order for a query containing a CONNECT BY clause.</td>
</tr>
<tr>
<td valign="top" width="96">MINUS</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts two sets of rows and returns rows that appear in the first set but not in the second, eliminating duplicates.</td>
</tr>
<tr>
<td rowspan="2" valign="top" width="96">NESTED LOOPS</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts two sets of rows, an outer set and an inner set. Oracle compares each row of the outer set with each row of the inner set and returns those rows that satisfy a condition.</td>
</tr>
<tr>
<td valign="top" width="78">OUTER</td>
<td valign="top" width="318">A nested loops operation to perform an outer join statement.</td>
</tr>
<tr>
<td valign="top" width="96">PARTITION</td>
<td valign="top" width="78">CONCATENATED</td>
<td valign="top" width="318">Iterates over the operation below it, for each partition in the range given by the PARTITION_START and PARTITION_STOP columns.</td>
</tr>
<tr>
<td valign="top" width="96">PROJECTION</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An internal operation.</td>
</tr>
<tr>
<td valign="top" width="96">REMOTE</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">A retrieval of data from a remote database.</td>
</tr>
<tr>
<td valign="top" width="96">SEQUENCE</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation involving accessing values of a sequence.</td>
</tr>
<tr>
<td rowspan="5" valign="top" width="96">SORT</td>
<td valign="top" width="78">AGGREGATE</td>
<td valign="top" width="318">A retrieval of a single row that is the result of applying a group function to a group of selected rows.</td>
</tr>
<tr>
<td valign="top" width="78">UNIQUE</td>
<td valign="top" width="318">An operation that sorts a set of rows to eliminate duplicates.</td>
</tr>
<tr>
<td valign="top" width="78">GROUP BY</td>
<td valign="top" width="318">An operation that sorts a set of rows into groups for a query with a GROUP BY clause.</td>
</tr>
<tr>
<td valign="top" width="78">JOIN</td>
<td valign="top" width="318">An operation that sorts a set of rows before a merge-join.</td>
</tr>
<tr>
<td valign="top" width="78">ORDER BY</td>
<td valign="top" width="318">An operation that sorts a set of rows for a query with an ORDER BY clause.</td>
</tr>
<tr>
<td rowspan="4" valign="top" width="96">TABLE ACCESS</td>
<td valign="top" width="78">FULL</td>
<td valign="top" width="318">A retrieval of all rows from a table.</td>
</tr>
<tr>
<td valign="top" width="78">CLUSTER</td>
<td valign="top" width="318">A retrieval of rows from a table based on a value of an indexed cluster key.</td>
</tr>
<tr>
<td valign="top" width="78">HASH</td>
<td valign="top" width="318">Retrieval of rows from table based on hash cluster key value.</td>
</tr>
<tr>
<td valign="top" width="78">BY ROWID</td>
<td valign="top" width="318">A retrieval of a row from a table based on its ROWID.</td>
</tr>
<tr>
<td valign="top" width="96">UNION</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that accepts two sets of rows and returns the union of the sets, eliminating duplicates.</td>
</tr>
<tr>
<td valign="top" width="96">VIEW</td>
<td valign="top" width="78"></td>
<td valign="top" width="318">An operation that performs a view&#8217;s query and then returns the resulting rows to another operation.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>SQL Trace and TKPROF</p>
<p>To find out additional information beyond what Explain can provide the SQL trace facility provides more in-depth information about the statement, session and instance. It generates the following statistics for each statement:</p>
<ul>
<li>Parse, execute, and fetch counts</li>
<li>CPU and elapsed times</li>
<li>Physical reads and logical reads</li>
<li>Number of rows processed</li>
<li>Misses on the library cache</li>
<li>Username under which each parse occurred</li>
<li>Each commit and rollback</li>
</ul>
<p>&nbsp;</p>
<p>The SQL trace facility can be enabled for single session or for an entire instance. When the SQL trace facility is invoked performance statistics for all SQL statements executed during a user session or for the entire instance are placed into a trace file.</p>
<p>Running the TKPROF program to formats the trace file and into a readable output file. TKPROF can also</p>
<ul>
<li>determine the execution plans of SQL statements</li>
<li>create a SQL script that stores the statistics in the database</li>
</ul>
<p>&nbsp;</p>
<p>TKPROF reports how each statement was executed, the resources it consumed, the number of times it was called, and the number of rows processed.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>References and footnotes</p>
<p><sup>1</sup> &#8211; Oracle Concepts Manual 8.0.4</p>
<p><sup>2</sup> &#8211; Oracle8 Tuning Manual Release 8.0</p>
<p>&nbsp;</p>
<p>About the Author</p>
<p>Scott Nelson is the founder of Results Through Technology, Inc. an Indianapolis based consulting firm that specializes in the Oracle Database, Oracle Tools and Internet technologies.  For the past 11 years he has specialized in Oracle based analysis, design, migrations, CASE, DBA, methodology, and project management areas.  He is a certified DBA through both Chauncey and Oracle OCP programs and is a frequent presenter on Designer and DBA topics at local, ODTUG, IOUG-A, and EOUG user group conferences.  He was appointed to the ODTUG board in 1998, elected Vice President of the group in 1999 and served as the ODTUG 99 and 2000 conference chair.  He is a past president of the Indiana Oracle User Group and is currently serving as the group&#8217;s treasurer.  For the past four years he has worked with the IOUG-A and Oracle OpenWorld conferences as a Focus Area Manager for the Methodology, Designer and Modeling streams.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/explain-it-to-me-one-more-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jumpstart Your Web Application Using Designer</title>
		<link>http://www.rtt.com/jumpstart-your-web-application-using-designer/</link>
		<comments>http://www.rtt.com/jumpstart-your-web-application-using-designer/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:03:36 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Technical Tips]]></category>

		<guid isPermaLink="false">http://www.rtt.com/?p=226</guid>
		<description><![CDATA[By Connie S. Alexander Introduction Recently I was given the opportunity to create a web application for a local humane society.  The requirements were small, but did include a fully functioning database to support internal daily business.  I chose to create my application in Designer/2000, then use the Web Generator to create my web application. [...]]]></description>
				<content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">By Connie S. Alexander</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Introduction</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Recently I was given the opportunity to create a web application for a local humane society.  The requirements were small, but did include a fully functioning database to support internal daily business.  I chose to create my application in Designer/2000, then use the Web Generator to create my web application.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">This paper is intended for the novice developer in both Designer/2000 and Web Application Server.  My goal is to outline the tools I used to create this web application and to show how easy it is to use Designer/2000 to jumpstart your web application.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Determine if your application is a good candidate</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The World Wide Web has generated a lot of excitement in the computer industry.  The flexibility, ease of use, and minimal cost has enticed managers everywhere to consider a web application.  But, is your application a good candidate?</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Good examples might include:</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">large amounts of informational data (i.e., manuals or catalogs)</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><span id="more-226"></span>small amount of simple forms (i.e., insert, update or view)</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">forms where valid values can be chosen from a list of values (i.e., addresses, purchase order)</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">users distributed among several sites or infrequent users</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">small amounts of simple graphics (complex graphics look nice, yet diminish response time)</span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">However, the Internet can be rather slow.  The web isn’t suited for complex forms or heavy data entry.  Another consideration is security.  If you intend to display confidential data, data encryption is a must.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Web applications can save you time and money.  The cost of analysis and design will not change; however, you will reduce the amount of time it takes to develop your application using Designer/2000.  Striving for 100% generated code will save time and money now and when changes are introduced later.  Training users is not an issue as web applications are simple and intuitive.  Maintenance and support of your application will also be reduced because you won’t have the software on the client.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">In web development, you should use a phased approach to delivering the application to the client.  Take a couple of weeks (not months) to develop a prototype.  Take the prototype to the users and determine if what you developed meets their needs.  Set user expectations early.  Describe the look and feel of your web application along with estimated access times will make user acceptance go smoother.  Once the prototype has been accepted, set it aside.  Next, develop the smallest, most important piece of your application through to completion.  Once that piece is completed, start on the next phase of the project.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Reverse engineering utilities</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The process of taking something that you know works and working backwards to help you find out how it works is called reverse engineering.  There are several utilities to assist you in reverse engineering an existing Oracle database in Designer/2000.  The Reverse Engineering Database Objects utility takes the existing database tables, views, and sequences and creates Designer/2000 objects to be used by the diagrammers for module creation.  A logical schema of entities from tables can be created using the Table to Entity Retrofit utility.  You can also reverse engineer forms and reports from Developer/2000 by using the Reverse Engineer Form and Reverse Engineer Report utilities respectively.  Reverse engineering is an iterative process; thus it may be run as many times as needed.  The process can be used for single or multiple tables.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Entity Relationship Diagrammer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Designer/2000 comes with a suite of diagrammer tools.  The key to success is determining which diagrammer to use.  My database was new, so I couldn’t use reverse engineering.  For this project, I chose the Entity Relationship Diagrammer (ERD) to model my business requirements.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The tool bar contains all the necessary tools to display entities and relationships.  To create an entity, drag the entity icon on the tool bar to the canvas.  Double click on the entity and enter the entity attributes.  The Definition tab is where you define the short name, name, and the plural form of the name.  If any synonyms exist, use the Synonyms tab.  Unique identifier information is gathered under the UIDs tab.  Name, sequence, domain, and format are some of the attributes that are captured on the Attributes tab.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Once the entities are created, relationships need to be added.  Click on the appropriate relationship icon on the tool bar.  Then click on the entities.  Designer/2000 won’t let you save a relationship without filling in the From Name and To Name.  Don’t worry if you don’t get the correct cardinality the first time.  Just double click on the relationship and change the cardinality in the Edit Relationship dialog box.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Tip – The many relationship is commonly known as crow’s feet.  Remember dead crows fly east.  Meaning, if you have a many relationship coming from the north or west, you probably still have some work to do.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Modifications to data in the Entity Relationship Diagrammer are relatively easy.  There is an AutoLayout feature under the Utilities menu if your diagram needs some help untangling itself.  The ERD allows for visual scrutiny of your database.  Creating multiple ERD diagrams is a great way to break up complex diagrams to hand out to users for signoff.  After all relationships are correct, you can generate your database.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Database Wizard</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Database Wizard transforms entity models into database designs.  If you are still in the Entity Relationship Diagrammer, you can select the Database Wizard from the Utilities menu.  If you are at the main Designer/2000 screen, double click on the Database Wizard.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">This utility transfers information from logical to physical.  If this thought is confusing, just think of copying entity and attributes to table and columns respectively.  Choose which entities you want to map in the Table Mappings tab.  The Run Options tab sets various flags to allow for creating, modifying, and when to commit the changes.  The Database Wizard can be run more than once to modify elements not created correctly the first time around.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Module Data Diagrammer</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Now comes the fun stuff!  You have done the analysis and design and created the database.  Now you need to create the modules that will become the HTML needed for the Web Application Server.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">One of the features that Designer/2000 offers is an About screen.  This screen is created in all diagrammers.  It contains the diagram name, title, type, create and last modified date, author, application system and username.  This information can be used as an About screen for your application.  By default, it is turned off.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Module Data Diagrammer (MDD) is where you create screens and reports that will be used in your web application.  You can create master-detail links, look up links, and treewalk links just to name a few.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">To create a detailed table usage, click on the first icon of the toolbar and drag it to the canvas.  Notice that a double-lined border is surrounding your detailed table usage.  The border signifies a screen.  If more than one table is needed to complete this page, you must drag the next detailed table usage within the double-lined border.  Use the relationship icon to draw relationships.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Double clicking the detailed usage table displays the Detailed Usages for the Web Application Server Module dialog box.  Within this dialog box, you control the table, column, and page details.  The Table Details tab contains Allow checkboxes to determine whether records can be added, updated, delete, or queried.  Alias is mandatory and must be unique as it will be used as the FROM clause in the SQL statements.  There are three kinds of Presentation Styles: list, frames, and form.  List displays a record list and view form on separate pages.  Frames display the record list and view form on the same page.  A Form contains buttons to move from one record detail to another.  Use the Form Presentation Style only if you have selected a query only form.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Page Text tab is used to define text that will introduce your document or give instructions to the reader.  Special formatting, such as bold or italic, can be achieved via the use of HyperText Functions (HTF) packages that come with the Developers Toolkit.  During generation, page text is scanned for function calls.  When found, appropriate PL/SQL is generated to combine HTML returned from the function call, with the rest of the static text.  An asterisk (*) displayed next to the name denotes page text has been defined.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Example page text</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Welcome to the htf.italic(‘Best Dog Humane Society’)web page.  To look at the animals we have up for adoption, press htf.bold(‘Animals’).</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Web page will look like</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Welcome to the <em>Best Dog Humane Society</em> web page.  To look at the animals we have up for adoption, press <strong>Animals</strong>.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Other examples of HTF functions include htf.image, hft.mailto, and htf.anchor.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The next tab is Usage.  Select the CRUD matrix options desired for the columns in use.  Remember the options available depend on whether the table you are using is a base or lookup table.  Be sure and check Ctx if you are using a record list .  If this option is not checked, your records will not display.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The Column Details and Column Display tabs allow for more formatting of your page.  The Display Style dropdown list gives you the options of image, pop list, and radio group.  Radio group (meaning) displays associated meanings on screen.  Use the formatting column if you have a valid URL you want displayed as a hyperlink.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Preferences Navigator</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Double Click on the Prefs icon from the main Designer/2000 screen to format your application.  Select WebServer Generator as the Product and Flavor when the Product Flavors dialog box is displayed.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Tip – Select Description from the View Menu.  Oracle brings up the preferences using their name, i.e., MODAL C.  MODAL C spelled out stands for Active Hyperlink Color.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> A lot can be said or not said about changing preferences.  I’ll give you a couple of ideas.  It’s best just to play around and see what you like.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> To change the text color isn’t as easy as highlighting Text Color and putting in the word, Blue.  Colors are defined using hexadecimal values in the form “XXYYZZ”, where XX is the value from 00-FF(hex) for red, YY for green, and ZZ for blue.  The easiest way to find a color is to press <strong>?</strong> (help) on the tool bar, then click on the Text Color field of COLORS.  This will bring up the Color Preferences help guide.  At the bottom of this help guide is a Quick Reference Color Chart.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Specify the name of the image you want to use as a background on the Background Image File under GENERAL.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Tip – Set up a virtual directory for images in the Oracle Web Listener – Directory Mapping.  This allows for one central location to change the location of your images.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">To have your logo show up as a background image, put &lt;path&gt;&lt;image name&gt; (i.e., /images/logo.jpg) in the Background Image File (see Figure 2).  This preference may be set at the application or module level.  If set at the application level, the image will be common across all pages.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Headers and footers are another preference that can be set in the Preferences Navigator.  They can be set at the application or module level.  Standard Header/Footer On All Pages defaults to No, which means the header/footer will only appear on the Startup Page.  Standard Header/Footer defines the content and format of the header/footer.  Use the htf.img(‘/images/header.jpg’) command to display an image.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Generating Your Web Application</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> You have setup your module, defined your preferences, and now you are ready to generate your web application.  Verify the Web Application Server has been configured.  If the Web Application Server has not been configured, refer to Setting up Oracle Web Application Server latter in this paper.  To start the web generator, double click on WebServer from the Client/Server Generators Tab on the Designer/2000 Main screen.   The Generate WebServer dialog box is displayed.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Select the Generate Server API tab first (see Figure 3).  Click on Show All Tables in the Application checkbox.  Select all tables by pressing the double down arrows icon.  Click Start Server API Generation.  You must generate the API before generating the module initially.  After initial generation, only regenerate the server API when changes are made to the underlying database tables.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><em> </em>Next, select the Options tab.  Fill in the PL/SQL username, password, and connect string in the Install Generated PL/SQL box.  Also, fill in the Browser and Web Agent URL.  The URL contains the Oracle Web Application Server Database Access Descriptor (DAD) for the generated WebServer application.  The URL should look like:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> http://&lt;machine:port#&gt;/&lt;WebServer DAD&gt;/owa</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Setting up the Run Generated Application box allows 1) your browser to be invoked and 2) the name of the procedure generated for the Startup Page of the module appended to the Web Agent URL.  In short, this is the URL needed to view your web page.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">On the Generate Tab, Highlight the Module you have created.  Once you get several modules created, you will want to check the Include the module network checkbox.  This will generate for the whole module network.  Putting a check in the Update Repository checkbox allows the Designer/2000 Repository to be automatically be updated if warning messages during generation suggest a change is needed to the module definition.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Now you are ready to press Start.  This brings up the WebServer Generator.  The WebServer Generator will generate the module you requested.  Next, a SQL*PLUS dialog box is displayed showing the generation of the packages.  A Processing Complete dialog box is displayed when generation is finished.  Press Run from the WebServer Generator and with any luck, your web page is displayed.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> A few words on what the server generates.  The server API packages are created from three generated script files and written to the current working directory (usually c:/orant/bin).  These script files are:</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">master command file                     CDSAP13.SQL</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">package specification                    &lt;table_alias or table_name&gt;.PKS</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">package body                                &lt;table_alias or table_name&gt;.PKB</span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The master command file calls the package specification and package body scripts.  Here is an example of the master command file:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">PROMPT Spooling to logfile ‘cvwsgin.log’</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">SPOOL cvwsgin.log</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> START ANIMAL.pks</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">START ANIMAL.pkb</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">START FEATURE.pks</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">START FEATURE.pkb</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> SPOOL OFF</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> EXIT</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The package specification and package body scripts contain the commands required to create the package in the database.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Setting up Oracle Web Application Server Version 3.0 (Advanced Edition)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> I found setting up the Oracle Web Application Server was probably the most taxing phase of this project.  I have included this section in my paper to shed a little light on setting up the server.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Setting up the Web Application Server consists of creating a Web Listener, creating a web user, creating a Database Access Descriptor, creating a PL/SQL Agent, and configuring the Web Request Broker.  These steps will be carried out on the Oracle Web Application Server web page usually installed at http://&lt;machine:8888&gt;.  The number, 8888, is the default admin port number.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The Web Listener’s task is to listen for user requests.  A user request is a Uniform Resource Locator (URL).  The URL contains the Database Access Descriptor (DAD) for the Web Application Server user.  To create a Web Listener go to the Oracle Web Application Server.  Click on Web Application Server Manager.  Click on Oracle Web Listener.  Click on Create Listener.  You need to supply a name for the listener, port number, host name of machine, and document root.  If you are using UNIX, you need to supply a user ID and group ID.  The port number can be any port not currently in use by another listener.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Next, create a Web Application Server User.  This user will have access to the database containing the web-generated application.  This user will also be used to install the Oracle Web Application Server Developers Toolkit, Web Application Server Generator Library packages, create the Oracle Web Application Server Database Access Descriptor (DAD) and update the Oracle Web Application Server Web Request Broker.  To create the Web Application Server User, log on to SQL*Plus as a DBA user and type the following:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> CREATE USER &lt;username&gt; IDENTIFIED BY &lt;password&gt;;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">GRANT CONNECT, RESOURCE TO &lt;password&gt;;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The Oracle Web Application Server Developer Toolkit has four packages: HTF, HTP, OWA, and OWA_UTIL.  To install these packages, run the OWAINS.SQL script as application owner located in the $ORACLE_HOME/ows/admin directory.  Remember to ‘set scan off’ before you run the script.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> The Web Application Server Generator library contains three packages: WSGL, WSGJSL, and WSGLM.  To install these packages, run WSGL.SQL script as application owner, located in the orant\cgenw10\cvwetc directory.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Now, add your new user to the Web Application Server configuration by creating a Database Access Descriptor (DAD).  To create the DAD, go to the Oracle Web Application Server.  Click on Web Application Server Manager.  Click on Oracle Web Application Server.  Click on DAD Administration.  Click on Create New DAD.  You will need to supply the DAD name, database user, ORACLE_HOME, and SQL*NET V2 Service (which is the host name).  If the DAD is accessing a remote database, supply the DBA Username and Password.  Click on Submit New DAD.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Next, create a PL/SQL Agent.  To create the new agent, go to the Oracle Web Application Server.  Click on Web Application Server Manager.  Click on Oracle Web Application Server.  Click on Cartridge Administration.  Click on PL/SQL Cartridge.  Click on Create New PL/SQL Agent.  You will need to supply the name of the PL/SQL Agent, name of the DAD you just created, and Authorized Ports.  The Authorized Ports can be any port you want.  Separate multiple port numbers with a comma (,).  Many users use port 80.  Click on Submit New Agent.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Last, but not least, add the virtual path to the PL/SQL Agent you just created.  To add the virtual path, go to the Oracle Web Application Server.  Click on Web Application Server Manager.  Click on Oracle Web Application Server.  Click on Cartridge Administration.  Click on PL/SQL Cartridge.  Click on Configure Web Request Broker parameter for PL/SQL.  Arrow down to the Virtual Paths section (see Figure 4).  Add a virtual path for plsql and owa for your application.  Click on Modify Cartridge to save your changes.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Tip – When adding a name, use the name of the application.  This allows for consistency throughout the application and identity when other applications are introduced later.</span></p>
<h2><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> Conclusion</span></h2>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"> In conclusion, it is my hope I have been able to give you a taste of how easy it is to create a web application in Designer/2000.  By just using three tools, the Entity Relationship Diagrammer, Database Design Wizard, and the Module Data Diagrammer I was able to create the database and application.  Using the WebServer generator, I was able to web enable my application.</span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtt.com/jumpstart-your-web-application-using-designer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
