<?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"
	>

<channel>
	<title>Sinoptix</title>
	<atom:link href="http://www.sinoptix.ro/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sinoptix.ro</link>
	<description>Oracle Developers</description>
	<pubDate>Thu, 25 Jun 2009 17:08:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Always Bulk Collect</title>
		<link>http://www.sinoptix.ro/archives/303</link>
		<comments>http://www.sinoptix.ro/archives/303#comments</comments>
		<pubDate>Mon, 23 Jun 2008 14:34:00 +0000</pubDate>
		<dc:creator>Steven Feuerstein</dc:creator>
		
		<category><![CDATA[Steven Feuerstein's Blog]]></category>

		<guid isPermaLink="false">http://www.toadworld.com/Default.aspx?tabid=67&EntryID=239</guid>
		<description><![CDATA[You learn something new every day, right? Well, I certainly do (more or less). Even about PL/SQL, about which I am sure many people think I already know <em>everything</em>. Far from it.

In fact, I learned just last week from the PL/SQL Product Manager, Bryn Llewellyn, that his recommendation regarding cursor FOR loops and bulk collect is different from mine – and for a very good reason.]]></description>
			<content:encoded><![CDATA[<div>You learn something new every day, right? Well, I certainly do (more or less). Even about PL/SQL, about which I am sure many people think I already know <em>everything</em>. Far from it.</div>
<div>In fact, I learned just last week from the PL/SQL Product Manager, Bryn Llewellyn, that his recommendation regarding cursor FOR loops and bulk collect is different from mine – and for a very good reason.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/303/feed</wfw:commentRss>
		</item>
		<item>
		<title>More Blogs</title>
		<link>http://www.sinoptix.ro/archives/275</link>
		<comments>http://www.sinoptix.ro/archives/275#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:55:46 +0000</pubDate>
		<dc:creator>Doug Burns</dc:creator>
		
		<category><![CDATA[Doug's Oracle Blog]]></category>

		<guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1419-guid.html</guid>
		<description><![CDATA[    It's good to see some more people joining in, particularly those I already know and admire.<br /><br />First up is <a href="http://markjbobak.wordpress.com/">Mark Bobak</a>, who I've met at several conferences and, as you can tell from his first few posts, is likely to have some interesting technical tales to tell.<br /><br />Via Mark's blog-roll, I noticed <a href="http://adhdocddba.blogspot.com/">Robyn Sands</a> has been blogging for a while, too. As well as having shared DBA interests (being oddly organised; OFA and anything else that brings some engineering discipline to our field), we have the same taste in presentation images.<br /><br />Next is <a href="http://karenmorton.blogspot.com/">Karen Morton</a> of <a href="http://method-r.com/">Method R Corp</a>., Cary Millsap's new company, who has an interesting blog post about <a href="http://karenmorton.blogspot.com/2008/06/future-of-presenting.html">presentation style</a>. Maybe I'll comment more on that later, but it's been a very long (if interesting) day at work and Ibrahimovic just scored the first goal after I missed laying the bet on him that I'd planned <img src="http://oracledoug.com/serendipity/templates/default/img/emoticons/sad.png" alt=":-(" style="display: inline; vertical-align: bottom;" class="emoticon" /><br /><br />Oh, and to revisit <a href="http://www.liberidu.com/blog/">an old favourite</a> - do you think that the Dutch are quite pleased about last night's 3-0 victory against Italy? (I don't know whether he's changed the oranje, but it seems much calmer than how it looked in the office today!) They have every right to be too, but don't tell me that prone Italian defender was playing Van Nistelrooy onside! (Ooops, slipped into a personal blog moment there)<br />
 
    ]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s good to see some more people joining in, particularly those I already know and admire.</p>
<p>First up is <a href="http://markjbobak.wordpress.com/">Mark Bobak</a>, who I&#8217;ve met at several conferences and, as you can tell from his first few posts, is likely to have some interesting technical tales to tell.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/275/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to Run an OS Command from PL/SQL</title>
		<link>http://www.sinoptix.ro/archives/304</link>
		<comments>http://www.sinoptix.ro/archives/304#comments</comments>
		<pubDate>Wed, 04 Jun 2008 14:11:00 +0000</pubDate>
		<dc:creator>Steven Feuerstein</dc:creator>
		
		<category><![CDATA[Steven Feuerstein's Blog]]></category>

		<guid isPermaLink="false">http://www.toadworld.com/Default.aspx?tabid=67&EntryID=228</guid>
		<description><![CDATA[<p>Oracle doesn't make it terribly easy to run operating system commands from within a PL/SQL block. I suppose that's understandable, given that PL/SQL is an embedded database-oriented language. Still, developers do ask me on a regular basis about how they can do this.</p>
<p>As I understand it, there are basically three ways to do this:</p>
<ol>
    <li>Invoke a Java method from within a PL/SQL wrapper<br />
     </li>
    <li>Call a C program as an external procedure from within PL/SQL.<br />
     </li>
    <li>Use the new DBMS_SCHEDULER package.</li>
</ol>
<p>I will soon publish a DBMS_SCHEDULER solution (written by Bryn Llewellyn, PL/SQL Product Manager) on my OTN Best Practices column. In the meantime, you will find below a quick review of the steps needed to do this in Java and C.</p>
<p><font size="3"><strong>Executing Host Command with Java</strong></font></p>
<p>With the Java approach, you will take these steps:</p>
<ol>
    <li>Find the Java class that implements host command execution.<br />
     </li>
    <li>Build a class that invokes that host command method. Let's call it HostCommand.<br />
     </li>
    <li>Build a PL/SQL program that calls a method in HostCommand to run your command.<br />
     </li>
    <li>Acquire the privileges needed to execute host commands via Java in the database.</li>
</ol>
<p>Let's go through each of these steps.</p>
<p><strong>1. Find the Java class that implements host command execution.</strong></p>
<p>Objects of the java.lang.Runtime class include an exec method that will execute a host command.</p>
<p><strong>2. Build a class that invokes that host command method.</strong></p>
<p>Let's call it HostCommand.</p>
<p>Here's code to create a new Java class in the database to invoke this command for the Windows XP operating system:</p>
<blockquote>
<pre>CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "UTLcmd"<br />AS import java.lang.Runtime;<br />public class execHostCommand<br />{ <br />  public static void execute (String command) <br />    throws java.io.IOException<br />  {<br />   String osName = System.getProperty("os.name");<br />   if(osName.equals("Windows XP"))<br />       command = "cmd /c " + command;<br />   Runtime rt = java.lang.Runtime.getRuntime();<br />   rt.exec(command);<br />  }<br />}<br />/</pre>
</blockquote>
<p>You can easily modify the execute method to support other operating systems based on the value of osName.</p>
<p><strong>3. Build a PL/SQL program that calls a method in HostCommand to run your command.</strong></p>
<blockquote>
<pre>CREATE OR REPLACE PACKAGE host_command IS<br />  PROCEDURE execute (cmd IN VARCHAR2) AS LANGUAGE JAVA NAME<br />           'execHostCommand.execute(java.lang.String)';<br />END;<br />/</pre>
</blockquote>
<p>Notice that I "map" the VARCHAR2 datatype to the java.lang.String class in my call to the new Java method.</p>
<p><strong>4. Acquire the privileges needed to execute host commands via Java in the database.</strong></p>
<p>You need special privileges to execute host commands from within the database through Java. Otherwise when you try to execute your command you will see an error like this (the error message will vary depending on what you are trying to do):</p>
<blockquote>
<p><img width="449" height="178" src="http://www.toadworld.com/Portals/0/blogimages/sf_blog060408.gif" alt="" /><br />
</p>
</blockquote>
<p>One way to obtain these privileges is to have the JAVASYSPRIV role granted to your schema. This role contains all the privileges you need (and more).</p>
<p>For a more nuanced approach to granting the required privileges, you can also use the Java security API available in the Oracle database. For example, if I want to delete a file using a host command (perhaps it is not accessible through UTL_FILE), I will need to grant the following privileges to the schema in which the command is executed, such as HR:</p>
<blockquote>
<pre>BEGIN<br />   DBMS_JAVA.grant_permission ('HR'<br />                             , 'SYS:java.io.FilePermission'<br />                             , '<<ALL FILES>>'<br />                             , 'execute'<br />                              );<br />   DBMS_JAVA.grant_permission ('HR'<br />                             , 'SYS:java.lang.RuntimePermission'<br />                             , 'writeFileDescriptor'<br />                             , ''<br />                              );<br />   DBMS_JAVA.grant_permission ('HR'<br />                             , 'SYS:java.lang.RuntimePermission'<br />                             , 'readFileDescriptor'<br />                             , ''<br />                              );<br />END;<br />/</pre>
</blockquote>
<p><font size="3"><strong>Executing Host Command with C</strong></font></p>
<p>To use C, you must define an external procedure and then invoke it within your PL/SQL block. It is not possible within this article to cover completely all the steps and issues involved in setting up such an external procedure. I will, instead, cover the highlights. For the full details, read Chapter 27 of Oracle PL/SQL Programming, 4th edition, in which my co-author Bill Pribyl thoroughly explains external procedures.</p>
<p>As with Java, you will need help from your database administrator to supply the privileges needed to execute your host command in C. </p>
<p>Here are the steps to follow with C:</p>
<ol>
    <li>Find (or build) the C program that implements host command execution.<br />
     </li>
    <li>Save the C source to a file and generate a shared library for it.<br />
     </li>
    <li>Save the library file where Oracle can find it.<br />
     </li>
    <li>Define a library inside Oracle that is associated with the shared library on disk.<br />
     </li>
    <li>Create a PL/SQL wrapper for the C function.</li>
</ol>
<p>Let's go through each of these steps.</p>
<p><strong>1. Find (or build) the C program that implements host command execution.</strong></p>
<p>The C system function executes an operating system command. So I build a simple C function, extprocsh(), that accepts a string and passes it to the system function for execution:</p>
<blockquote>
<pre>int extprocsh(char *cmd)<br />{<br />   return system(cmd);<br />}</pre>
</blockquote>
<p>The function returns the result code as provided by system, a function normally found in the C runtime library (libc) on Unix, or in msvcrt.dll on Microsoft platforms.</p>
<p><strong>2. Save the C source to a file and generate a shared library for it.</strong></p>
<p>I save the source code in a file named extprocsh.c. I then use the GNU C compiler to generate a shared library. On a 64-bit Solaris machine running GCC 3.4.2 and Oracle Database 10g Release 2, the following compiler command worked to create a shared library:</p>
<blockquote>
<pre>gcc -m64 extprocsh.c -fPIC -G -o extprocsh.so</pre>
</blockquote>
<p>Similarly, on Microsoft Windows XP Pro running GCC 3.2.3 from Minimal GNU for Windows (MinGW), also with Oracle Database 10g Release 2, this works:</p>
<blockquote>
<pre>c:\MinGW\bin\gcc extprocsh.c -shared -o extprocsh.dll</pre>
</blockquote>
<p><strong>3. Save the library file where Oracle can find it.</strong></p>
<p>These commands generate a shared library file, extprocsh.so or extprocsh.dll. Now I need to put the library file somewhere that Oracle can find it. The default locations for Windows and Unix respectively are:</p>
<blockquote>
<pre>$ORACLE_HOME/bin<br />$ORACLE_HOME/lib</pre>
</blockquote>
<p>If you want to use a non-default location, you will need to edit the listener configuration file and supply path value(s) for the ENVS="EXTPROC_DLLS...".</p>
<p><strong>4. Define a library inside Oracle that is associated with the shared library on disk.</strong></p>
<p>After copying the file and/or making adjustments to the listener, you will then define a "library" inside Oracle to point to the DLL. For example:</p>
<blockquote>
<pre>CREATE OR REPLACE LIBRARY extprocshell_lib <br />   AS '/u01/app/oracle/local/lib/extprocsh.so';   -- Unix<br />     <br />CREATE OR REPLACE LIBRARY extprocshell_lib<br />   AS 'c:\oracle\local\lib\extprocsh.dll';      -- Microsoft</pre>
</blockquote>
<p><strong>Note:</strong> performing this step requires Oracle's CREATE LIBRARY privilege.</p>
<p><strong>5. Create a PL/SQL wrapper for the C function.</strong></p>
<p>Now I can create a PL/SQL call specification which uses the newly created library:</p>
<blockquote>
<pre>CREATE OR REPLACE FUNCTION exec_host_command (cmd IN VARCHAR2)<br />   RETURN PLS_INTEGER<br />AS<br />   LANGUAGE C<br />   LIBRARY extprocshell_lib<br />   NAME "extprocsh"<br />   PARAMETERS (cmd STRING, RETURN INT);</pre>
</blockquote>
<p>Then, assuming that your DBA has set up the system environment to support external procedures, the exec_host_command function can now be called anywhere you can invoke a PL/SQL function.  </p>
<p>Note that these operating system commands will execute with the same privileges as the Oracle Net listener that spawns the extproc process.</p>]]></description>
			<content:encoded><![CDATA[<p>Oracle doesn&#8217;t make it terribly easy to run operating system commands from within a PL/SQL block. I suppose that&#8217;s understandable, given that PL/SQL is an embedded database-oriented language. Still, developers do ask me on a regular basis about how they can do this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/304/feed</wfw:commentRss>
		</item>
		<item>
		<title>Testing and refreshing data from production</title>
		<link>http://www.sinoptix.ro/archives/305</link>
		<comments>http://www.sinoptix.ro/archives/305#comments</comments>
		<pubDate>Thu, 17 Apr 2008 16:21:00 +0000</pubDate>
		<dc:creator>Steven Feuerstein</dc:creator>
		
		<category><![CDATA[Steven Feuerstein's Blog]]></category>

		<guid isPermaLink="false">http://www.toadworld.com/Default.aspx?tabid=67&EntryID=204</guid>
		<description><![CDATA[<div>As many of my readers likely know by now, I have been working for the past several years on the Quest Code Tester development effort.<br />
 </div>
<div>Code Tester is the most powerful PL/SQL test automation tool available. You describe the expected behavior of your programs and Code Tester generates your test code, which can then be run from the UI or via a script. With Code Tester, you can build comprehensive regression tests and even implement the Test Driven Development methodology.<br />
 </div>
<div>In the process of talking about Code Tester with many developers, I have come across a belief regarding code testing and the refreshing of data from production tables that I think actually reflects a misunderstanding about both how to use Code Tester specifically and, more generally, how to test our code.<br />
 </div>
<div>Here's the way this belief was expressed by a customer recently:<br />
 </div>
<div>"We have a development environment - let's call it TEST. Inside this environment is the supporting schema / repository for Code Tester, as well as the test definitions and generated test code."<br />
 </div>
<div>"Once a week, we refresh the TEST environment from the production environment, PROD. PROD doesn't contain a Code Tester repository, so after I refresh, I lose my test repository and code."<br />
 </div>
<div>Clearly, this developer can do an export of the Code Tester schema and then import it after refresh, but he was concerned about having to add any overhead for the DBA to this refresh process.<br />
 </div>
<div>Actually, I think the problem goes much deeper than that: if you refresh your test tables with production data on a regular basis, you will find it very difficult indeed to create stable regression tests that can be run against your code.<br />
 </div>
<div>Why do I say that? Because when you refresh data from production, you change the "inputs" to your programs (contents of the tables) and therefore you will almost certainly have to change the expected results for your tests.</div>
<div>In fact, I think that when it comes to <em>functional testing of your programs </em>(does it meet user requirements?), you should <em>not</em> be refreshing your test tables from production. To understand why I would say this, let's talk about....<br />
 </div>
<div><strong><em><font size="3">How we make sure our programs work<br />
 </font></em></strong></div>
<div>There are as many kinds of tests as there are definitions of what it means for a program to "work." We need to make sure, for example, that our programs meet functional requirements (they are correct) and also that they run quickly enough to avoid user frustration. The programs need to scale up for many users and lots of data, etc.</div>
<div> <br />
<a href="http://unittest.inside.quest.com/index.jspa">Quest Code Tester</a> is designed specifically to help you implement tests on functional requirements; in essence, to verify that your program is correct.<br />
 </div>
<div>To do this, I will almost always want to compare the actual results of running my program with the expected results or control data. <br />
 </div>
<div>For example, if table XYZ contains a certain set of rows, then after running the program, table ABC should be changed in a specific way. Or the program is a function such that when I pass "ABC" for an IN argument, the function returns 100, and so on.<br />
 </div>
<div>In general, there is no room for ambiguity here. Either the program works as expected or it does not. <br />
 </div>
<div>Now, if I want to build regression tests and <em>automate</em> the process of testing my program, I need to able to tell Code Tester that for a given set of inputs, I expect the associated outcomes. And – this is the key thing to realize – those inputs can't keep changing on me. Every time the inputs change, I would need to change the expected outcomes. <br />
 </div>
<div>Constantly updating one's test code might make sense if you are perform manual tests from hand-coded scripts. But if you want to build comprehensive, serious regression tests, then you need a stable, consistent environment from which to run those tests.<br />
 </div>
<div>Every time you refresh data from production, you change the values in your table and thus you cannot reliably execute your regression test.<br />
 </div>
<div><strong><em><font size="3">But don't we need real production data to really test?<br />
 </font></em></strong></div>
<div>Is this a big problem? Does this mean that we can't or shouldn't build static, repeatable regression tests for our code? After all (so the thinking goes), we need to test our code against production data to make sure that code handles "real world" situations.<br />
 </div>
<div>Clearly, our code does need to work properly with production data.<br />
 </div>
<div>This does not mean, however, that you need to constantly change the data for your functional tests as production data changes. It <em>does</em> mean that the data used in functional tests should <em>represent</em> the variety of data found in production. <br />
 </div>
<div>In other words, the data in your test tables must be sufficiently varied to allow you to exercise the program to verify all requirements. It doesn't really matter so much that the data is precisely <em>the same</em> as that found in production.</div>
<div>And, again, if you keep changing the test data, you must also change your test definition.<br />
 </div>
<div><strong><em><font size="3">OK, but don’t we need to test against production volume?<br />
 </font></em></strong></div>
<div>There's another problem with basing functionality testing around production data: the data volumes are generally too large, increasing the time it takes to complete the tests. <br />
 </div>
<div>You certainly do need to make sure your code executes with production volumes of data. But that sort of <em>stress testing</em> should be done independently of your functionality testing. With functionality testing, you want your tests to run as quickly as possible, for these reasons:</div>
<ul type="disc">
    <li>You will have lots of (dozens, perhaps hundreds) of separate test cases to run; if each test takes five minutes due to data volume, the test cycle will take an enormous amount of time.<br />
      </li>
    <li>Ideally, you run your tests after each change you make to your program. That way, you can immediately determine if you have introduced any bugs. But if running those tests takes an hour, you will test less frequently and you will get less "return" on your investment of creating your tests. </li>
</ul>
<div><strong><em><font size="3">Conclusion: Segregate your functional test environment<br />
 </font></em></strong></div>
<div>The most important thing to verify about your program is that it is <em>correct</em>: it meets user requirements. <br />
 </div>
<div>The best way to do this is to build a regression test that you can run after any change to the program, to ensure that it has no bugs. <br />
 </div>
<div>A regression test should not have to be changed as long as the program itself has not changed. It should work from a consistent set of "inputs" (values for IN arguments, contents of any tables queried by programs, etc.) that do <em>not</em> change. [Of course, you may need to make some changes along the way as program requirements change, as you add more test cases, etc. That is different, however, from daily or weekly refreshes.]<br />
 </div>
<div>In addition, you want regression tests to run as efficiently as possible. These tests focus on program functionality, not performance. So you want the <em>minimum </em>volume of data in test tables that allow you to cover your requirements. Use different tests to verify adequate performance.<br />
 </div>
<div>Consequently, when it comes to functionality testing, you should avoid refreshing your test tables from production. Instead, invest the time upfront to come up with setup scripts to populate tables with data that fully exercises your code. Include those setup scripts in your Code Tester test definitions and then you have an independent, consistent test environment.</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>]]></description>
			<content:encoded><![CDATA[<div>As many of my readers likely know by now, I have been working for the past several years on the Quest Code Tester development effort.
</div>
<div>Code Tester is the most powerful PL/SQL test automation tool available. You describe the expected behavior of your programs and Code Tester generates your test code, which can then be run from the UI or via a script. With Code Tester, you can build comprehensive regression tests and even implement the Test Driven Development methodology.</div>
<div></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/305/feed</wfw:commentRss>
		</item>
		<item>
		<title>Auto-formatting of templates for Toad</title>
		<link>http://www.sinoptix.ro/archives/306</link>
		<comments>http://www.sinoptix.ro/archives/306#comments</comments>
		<pubDate>Thu, 10 Apr 2008 16:14:00 +0000</pubDate>
		<dc:creator>Steven Feuerstein</dc:creator>
		
		<category><![CDATA[Steven Feuerstein's Blog]]></category>

		<guid isPermaLink="false">http://www.toadworld.com/Default.aspx?tabid=67&EntryID=200</guid>
		<description><![CDATA[<div>A few months ago, I posted on this blog an explanation of how to use Toad's Code Templates to standardize development and improve productivity. I included an XML document that contains over 20 templates that I thought you might find useful. I also asked my readers to produce XML transformations so that the XML document could be "output" in the format that Toad recognizes (and SQL Navigator as well).</div>
<div> </div>
<div>I am happy to say that Sean Gilbert has done this for Toad 8 and is working on a transformation for Toad 9.</div>
<div> </div>
<div>For more information, check out <a href="https://getonthetrail.blogsite.org/Blog/post/2008/04/Transform-Custom-TOAD-XML-Template-with-XSLT.aspx">https://getonthetrail.blogsite.org/Blog/post/2008/04/Transform-Custom-TOAD-XML-Template-with-XSLT.aspx</a>. </div>
<div> </div>
<div>Thanks, Sean!</div>]]></description>
			<content:encoded><![CDATA[<div>A few months ago, I posted on this blog an explanation of how to use Toad&#8217;s Code Templates to standardize development and improve productivity. I included an XML document that contains over 20 templates that I thought you might find useful. I also asked my readers to produce XML transformations so that the XML document could be &#8220;output&#8221; in the format that Toad recognizes (and SQL Navigator as well).</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/306/feed</wfw:commentRss>
		</item>
		<item>
		<title>OraPerf.com back online</title>
		<link>http://www.sinoptix.ro/archives/223</link>
		<comments>http://www.sinoptix.ro/archives/223#comments</comments>
		<pubDate>Wed, 26 Mar 2008 15:57:20 +0000</pubDate>
		<dc:creator>Doug Burns</dc:creator>
		
		<category><![CDATA[Doug's Oracle Blog]]></category>

		<guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1396-guid.html</guid>
		<description><![CDATA[    
I was just looking up a link to the original YAPP paper so that I could include it in the course notes and then noticed <a href="http://www.oraperf.com/news.php">Anjo Kolk's site</a> is back online. I think it might be a little while before things are back to normal, though - sounds like there's a bit of work to be done ....<br />
 
    ]]></description>
			<content:encoded><![CDATA[<p>I was just looking up a link to the original YAPP paper so that I could include it in the course notes and then noticed <a href="http://www.oraperf.com/news.php">Anjo Kolk&#8217;s site</a> is back online. I think it might be a little while before things are back to normal, though - sounds like there&#8217;s a bit of work to be done &#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/223/feed</wfw:commentRss>
		</item>
		<item>
		<title>ASH and the psychology of Hidden Parameters</title>
		<link>http://www.sinoptix.ro/archives/224</link>
		<comments>http://www.sinoptix.ro/archives/224#comments</comments>
		<pubDate>Tue, 25 Mar 2008 01:48:48 +0000</pubDate>
		<dc:creator>Doug Burns</dc:creator>
		
		<category><![CDATA[Doug's Oracle Blog]]></category>

		<guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1395-guid.html</guid>
		<description><![CDATA[    
Time for a quick break from the final push to complete the course slides. I've (probably foolishly) decided to apply the 10.2.0.4 patch to my test database.<br /><br />As I was confirming the details of when Oracle starts to flush information from the ASH Buffer to the workload repository, I thought I'd check the value as it's defined in a hidden parameter, _ash_eflush_trigger. The default is 66, which means that the flush begins whenever the circular buffer is 66% used, to stop it from wrapping around on itself, or filling up, whichever description you prefer.<br /><br />It also set me thinking that I wonder whether Hidden Parameters will ever stop seeming 'cool' or 'sexy'. Despite the fact that there are very few occasions when they are used, the mere mention of them seems to elicit intense responses as though you're letting people in on some big secret! It made me question what people might want from a course - internals for the sake of it, because they're cool, or maybe just because everyone wants to learn something new - or hopefully they want information that might be useful in their day to day jobs. Frankly, if it's deliberately clever stuff people are looking for, they're going to be disappointed <img src="http://oracledoug.com/serendipity/templates/default/img/emoticons/wink.png" alt=";-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> It's very tempting to write a course to prove how much you know, but I think that's a mistake. <br /><br />Where I think Hidden Parameters are very useful is in understanding how something works and ASH is no exception. Here are a few examples, with their default values on 10.2.0.3<font face="courier new,courier,monospace"><br /><br />_ash_enable=TRUE</font><br /><p><br />Self-explanatory, hopefully, but I wonder if anyone's ever tried using this to switch ASH off, rather than statistics_level=BASIC?<br /><br /><font face="courier new,courier,monospace">_ash_sampling_interval = 1000</font> (milliseconds)</p>This is where the one second sampling is specified. I'm tempted to try to reduce this to a silly level and watch the server fall on it's back-side. I vaguely recall Graham Wood saying during a presentation that it had been tested with double-digit values.<br /><br /><font face="courier new,courier,monospace">_ash_sample_all = FALSE</font><br /><br />Oooh, this one would be fun! Why not sample all sessions include those that aren't Active <img src="http://oracledoug.com/serendipity/templates/default/img/emoticons/wink.png" alt=";-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> (Hint, you would have an enormous growth in the volume of data generated so, again, I'm kidding)<br /><br /><font face="courier new,courier,monospace">_ash_disk_write_enable = TRUE</font><br /><br />Whether samples are flushed to the workload repository or not. Might initially seem a good idea to save space or improve performance a little but (just a guess) I think it would confuse the hell out of ADDM when it couldn't find any ASH samples to correlate with the AWR information.<br /><br /><font face="courier new,courier,monospace">_ash_disk_filter_ratio = 10</font><br /><br />I've seen this question asked in a few Metalink forum postings - why is some of the information missing in DBA_HIST_ACTIVE_SESS_HISTORY? Because only one in 10 samples are written there. If you wanted one-second granularity in AWR as well as in memory, this would need to be set to 1. However, as well as 10 times the space used in AWR, that's ten times as much data to write there, Direct Path Inserts or not!<br /><br />So the usual warning; The parameters are hidden for a reason and you shouldn't tamper with them unless someone in Oracle Support has suggested it. This post is just a bit of interesting fun and anyone who breaks their instance because they tried any of this stuff deserves everything they get.<br /><br />Now my 10.2.0.4 upgrade has just finished, so back to work.<br />
 
    ]]></description>
			<content:encoded><![CDATA[<p>Time for a quick break from the final push to complete the course slides. I&#8217;ve (probably foolishly) decided to apply the 10.2.0.4 patch to my test database.</p>
<p>As I was confirming the details of when Oracle starts to flush information from the ASH Buffer to the workload repository, I thought I&#8217;d check the value as it&#8217;s defined in a hidden parameter, _ash_eflush_trigger. The default is 66, which means that the flush begins whenever the circular buffer is 66% used, to stop it from wrapping around on itself, or filling up, whichever description you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/224/feed</wfw:commentRss>
		</item>
		<item>
		<title>Wierd PL/SQL</title>
		<link>http://www.sinoptix.ro/archives/253</link>
		<comments>http://www.sinoptix.ro/archives/253#comments</comments>
		<pubDate>Mon, 17 Mar 2008 19:57:00 +0000</pubDate>
		<dc:creator>Steven Feuerstein</dc:creator>
		
		<category><![CDATA[Steven Feuerstein's Blog]]></category>

		<guid isPermaLink="false">http://www.toadworld.com/Default.aspx?tabid=67&EntryID=187</guid>
		<description><![CDATA[Collaborate08, annual conference of the International Oracle User Group, and  several other national and international user groups, will be held in Denver  this year, from April 13th to the 16th. I am going to present three  papers, including (for the first time) Weird PL/SQL. I thought you  might enjoy reading about [...]]]></description>
			<content:encoded><![CDATA[<p>Collaborate08, annual conference of the International Oracle User Group, and  several other national and international user groups, will be held in Denver  this year, from April 13th to the 16<sup>th</sup>. I am going to present three  papers, including (for the first time) <em>Weird PL/SQL</em>. I thought you  might enjoy reading about some of the weirdnesses of PL/SQL in my ToadWorld  blog, so here&#8217;s an excerpt from the beginning of my whitepaper.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/253/feed</wfw:commentRss>
		</item>
		<item>
		<title>Optimiser - Upgrading from 9i to 10g</title>
		<link>http://www.sinoptix.ro/archives/166</link>
		<comments>http://www.sinoptix.ro/archives/166#comments</comments>
		<pubDate>Wed, 27 Feb 2008 05:56:36 +0000</pubDate>
		<dc:creator>Doug Burns</dc:creator>
		
		<category><![CDATA[Doug's Oracle Blog]]></category>

		<guid isPermaLink="false">http://www.sinoptix.ro/archives/166</guid>
		<description><![CDATA[    
On the one hand, I regret the fact I seem to be posting a lot of links to other people's work at the moment but I couldn't let this one by, if only for those who don't use OraNA or the like and might miss it.<br /><br />The one consistent message I kept hearing from other attendees at Openworld this year was that a lot of sites seem to have run into performance problems when upgrading from 9i to 10g due to changes in the CBO and DBMS_STATS. Yes, there are some Oracle 9i databases out there, you know.<br /><br />I noticed via the <a href="http://optimizermagic.blogspot.com/2008/02/upgrading-from-oracle-database-9i-to.html">Optimizer Development Group's blog</a> that there's <a href="http://www.oracle.com/technology/products/bi/db/10g/pdf/twp_bidw_optimizer_10gr2_0208.pdf">a white paper on this topic</a> (PDF) on OTN by Maria Colgan which summarises some of the issues in a very readable form. (Well, it could maybe have used one more round of proof-reading for missing words etc., but I'm being picky.) It's not particularly deep but I'm glad to see it, if only to highlight some of the issues that you might face and can then investigate in more depth on your own systems if you think they'll affect you. Even if you know the issues already, it might be useful revision when you're about to upgrade to 10g. I know that I constantly come across people forgetting the automatic GATHER_STATS_JOB when they work with a mixture of versions and as Noons pointed out in the comments on <a href="http://oracledoug.com/serendipity/index.php?/archives/1382-How-useful-are-diagnosticoptimization-tools-Another-View.html">this post</a>, that can really throw things if you're not careful.<br /><br />(Of course, there's a funny side to this too, in that it discusses the new <i>default</i> approach to Histogram generation that caught me out the other day. Well, it wasn't so much the new approach as me being hasty and seeing what I wanted to see, but the article does discuss the difference in Histogram generation using the default METHOD_OPT!)<br /><br />It also mentions the change in the default value of parallel_max_servers that I've seen more than one system suffer from and discusses a SQL Test Case Builder that will be in 10.2.0.4 to help in submitting Metalink SRs. I'll have to play around with that at work because there are times when building a test case has proved a pain in the behind (as I'm sure I remember <a href="http://pjsrandom.wordpress.com/">Peter Scott</a> blogging about in the past). 
    ]]></description>
			<content:encoded><![CDATA[<p> On the one hand, I regret the fact I seem to be posting a lot of links to other people&#8217;s work at the moment but I couldn&#8217;t let this one by, if only for those who don&#8217;t use OraNA or the like and might miss it.</p>
<p>The one consistent message I kept hearing from other attendees at Openworld this year was that a lot of sites seem to have run into performance problems when upgrading from 9i to 10g due to changes in the CBO and DBMS_STATS. Yes, there are some Oracle 9i databases out there, you know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/166/feed</wfw:commentRss>
		</item>
		<item>
		<title>10.2.0.4</title>
		<link>http://www.sinoptix.ro/archives/167</link>
		<comments>http://www.sinoptix.ro/archives/167#comments</comments>
		<pubDate>Sun, 24 Feb 2008 22:53:13 +0000</pubDate>
		<dc:creator>Doug Burns</dc:creator>
		
		<category><![CDATA[Doug's Oracle Blog]]></category>

		<guid isPermaLink="false">http://www.sinoptix.ro/archives/167</guid>
		<description><![CDATA[    Via <a href="http://laurentschneider.com/wordpress/2008/02/oracle-10204.html">Laurent Schneider's blog</a>, it looks like 10.2.0.4 is out.<br /><br />I've just had a quick look on Metalink and unfortunately (but unsurprisingly) it doesn't seem to be available for AIX just yet, just Linux, but it's one we've been waiting for for a while, so it's good to see the first signs.<br />
 
    ]]></description>
			<content:encoded><![CDATA[<p>    Via <a href="http://laurentschneider.com/wordpress/2008/02/oracle-10204.html">Laurent Schneider&#8217;s blog</a>, it looks like 10.2.0.4 is out. I&#8217;ve just had a quick look on Metalink and unfortunately (but unsurprisingly) it doesn&#8217;t seem to be available for AIX just yet, just Linux, but it&#8217;s one we&#8217;ve been waiting for for a while, so it&#8217;s good to see the first signs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sinoptix.ro/archives/167/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
