<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>PHP and Oracle: Christopher Jones</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/opal/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2010:/opal//31</id>
   <updated>2010-02-03T06:35:04Z</updated>
   <subtitle>Notes on the Oracle PHP Apache Linux (&quot;OPAL&quot;) stack, with bits of Python, Perl and Ruby for good luck</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.23-en</generator>


<entry>
   <title>Facebook&apos;s HPHP: Initial Comments</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2010/02/facebooks_hphp_initial_comment.html" />
   <id>tag:blogs.oracle.com,2010:/opal//31.16610</id>
   
   <published>2010-02-02T21:48:09Z</published>
   <updated>2010-02-03T06:35:04Z</updated>
   
   <summary> Facebook have announced a significant project around PHP that I saw previewed at a small tech summit last month. No, Facebook did not announce PHPVille. Facebook announced HPHP, pronounced hip-hop. &quot;HipHop programmatically transforms your PHP source code into highly...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="c" label="c++" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="community" label="community" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="compiler" label="compiler" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="facebook" label="facebook" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="performance" label="performance" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p> Facebook have announced a significant project around PHP that I
saw previewed at a small tech summit last month.  No, Facebook did not
announce <a
href="http://twitter.com/PhilipOlson/statuses/8549466708">PHPVille</a>.</p>

<p>Facebook announced <a
href="http://developers.facebook.com/news.php?blog=1&story=358"
>HPHP</a>, pronounced hip-hop.  "HipHop programmatically transforms
your PHP source code into highly optimized C++".  </p>

<p> Have you hovered over the word 'Facebook' in the copyright banner
of any facebook.com page?  Chances are that it says "HPHP", indicating
that the server handling your request was running it.  Ninety percent
of their web traffic is delivered by it and rollout across their
servers continues.</p>

<p>What do we know about HPHP?  Cherry picking just a few facts from
my notes:</p>

<ul>
  <li>Takes a complete PHP application and generates equivalent C++ code</li>
  <li>For Facebook's (huge) application, they end up with a 1Gb binary</li>
  <li>But this includes a built-in multi-threaded webserver</li>
  <li>No SSL yet</li>
  <li>Has <a href="http://pecl.php.net/package/xhprof">XHProf</a> gatherer built in.  Facebook run this in production with a configurable sampling rate</li>
  <li>All extensions are currently statically linked</li>
  <li>Runs one process multi-threaded</li>
  <li>Has its own configuration file syntax: no .htaccess equivalent, but does support virtual hosts</li>
  <li>The performance benefit of HPHP being quoted is "on average it's
about a 50% CPU saving".  This is with g++ and the <a
href="http://en.wikipedia.org/wiki/Gold_%28linker%29" >Gold
linker</a>.  Database-heavy pages aren't going to benefit as much as PHP-centric pages
</li>
</ul>

<p>Although in the best Silicon Valley spirit HPHP is being called
Beta, I'd say it is at the end of Alpha (or it was when I saw it).
However it would only take tidy-ups to the build infrastructure to
stabilize the experience.</p>

<p> Writing extensions involves starting with an IDL file describing
the extension API that PHP scripts would call.  A template C++ file
with stubs is automatically generated from the IDL file.  After that
it's all your own C++ code.  When HPHP becomes generally available
I'll be interested in digging into this more.</p>

<p>A number of core extensions have been ported.  Some way to use
other existing PHP extensions was high on the summit attendees'
wish-lists.  There are some technical issues with globals and I don't
know if Facebook will spend time on this, since they don't have a
business requirement for it.  </p>

<p>Quality and compatibility of HPHP appears high.  I understood that
a lot of development at Facebook still uses PHP even though the code
is then deployed with HPHP.  Facebook HPHP testing included
comparisons with PHP:</p>

<ul>
  <li>comparing the number of functions being called</li>
  <li>comparing network I/O</li>
  <li>comparing Error Logs</li>
</ul>

<p>Details about which PHP version HPHP is compatible with (PHP 5.2.5)
and what extensions are supported could soon be irrelevant as Facebook
continue working on HPHP and if a community forms around it.  My notes
on Facebook's stated roadmap say:</p>

<ul>
  <li>Make it work with Apache</li>
  <li>Catch up with PHP 5.3</li>
  <li>Minimize differences between HPHP and PHP</li>
</ul>

<p>These indicate recognition that the crux of building a community is
getting adoption.  There have been other re-implementations of PHP in
the past.  Where have they got to?  This new implementation has some
clout behind it and there is vigor to create a community.  Also I
don't doubt Facebook will continue to use and improve HPHP and this
might make it enticing to sites that have issues with capacity.  The
rest is up to you.</p>

<p>Finally, what else was discussed at the summit?  Discussions ranged
from specific implementation details about facebook.com to how
Facebook could work with the PHP community.  There was a significant
exchange of information in both directions.</p>

<p>I'll briefly mention Memcached, which was of particular interest on
the day.  Facebook faced a lot of questions about its use and the
improvements they've made (64-bit, UDP, multi-threading, ethernet
drivers, compression, locking, batching, hashing).  Facebook's <a
href="http://en.wikipedia.org/wiki/User_Datagram_Protocol#Comparison_of_UDP_and_TCP"
>UDP</a> support has been mentioned at PHP conferences and is
something people latch onto as if they had been dreaming of it all
their life.  However it brings complexity and has its own problems
that had to be solved, including issues with handling large objects.
Facebook also found UDP worked well when their datacenters' latencies
were all the same, which is not always true now for them.  Facebook
stated they hope to merge back their useful Memcached changes to the
open source community.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Toolsets and Skillsets. Or Namedropping at Facebook</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2010/01/toolsets_and_skillsets_or_name.html" />
   <id>tag:blogs.oracle.com,2010:/opal//31.16480</id>
   
   <published>2010-01-25T19:18:31Z</published>
   <updated>2010-01-26T05:37:21Z</updated>
   
   <summary>It&apos;s no secret that some North America-based PHP folk met at Facebook&apos;s Menlo Park HQ last week at the invitiation of David Recordon and new-hire Scott MacVicar. To tell the truth, I was honored to be part of what was...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="conference" label="conference" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="skill" label="skill" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="tool" label="tool" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>It's no secret that some North America-based PHP folk met at
Facebook's Menlo Park HQ last week at the invitiation of David
Recordon and new-hire <a
href="http://www.macvicar.net/blog/2009/12/funemployment-part-3-back-to-work.html">Scott
MacVicar</a>.  To tell the truth, I was honored to be part of what was
a wide ranging technical summit.
</p>

<p>Facebook's large open-plan office had an air of enthusiastic intent.
There was some informality too, epitomized by the casual way co-founder
<a href="http://en.wikipedia.org/wiki/Mark_Zuckerberg">Mark
Zuckerberg</a> joined us for lunch in the (noisy) cafeteria on Friday.
</p>

<p>Anyway, enough name dropping.  The summit covered a lot of technology.
One thing touched on briefly was <a href="http://pecl.php.net/xhprof
">XHProf</a>: "XHProf is a function-level hierarchical profiler for
PHP and has a simple HTML based navigational interface".  It was
developed and open-sourced on PECL by Facebook.  We were given a demo
of Facebook's analysis system built on top of XHProf.  It provides a
lot of nice analysis and drill down.  This particular interface is too
Facebook-specific to be opensourced.
</p>

<p>My point here is not how XHProf was developed, nor how it is used at
Facebook - interesting though all that was.  My point is that the
toolset exists and is in use.  Maybe it's because my previous post has
a similar theme that I have this on my mind - again.  I wonder how
much of Facebook's ongoing success is due to making analyis of
performance data easy?
</p>

<p>From programmers to corporations, a good toolset is important.  I've
seen plenty of people display mastery of a personal toolset, from
regular expressions to profilers.  Think of your favorite conference
speaker or blog writer and recall how well they demonstrate tool mastery.  At the
other end of the spectrum, non-technical computer users who work in
isolation are often painful to watch using computers.
</p>

<p>Everyone has their own toolset.  Experts in some things are not always
efficient at other things, so don't think you have to master
everything.  But how efficient is <emphasis>your</emphasis> toolset?
What are you missing that you should learn?
</p>

<p>The Facebook summit provided a free flowing exchange of information.
Meeting and talking is a great way to improve a skillset and learn
about new tools and techniques.  With the northern hemisphere conference
season starting, you should seriously think about attending a
conference this year.
</p>

<p>I guess you want to know more about the summit?  That will have to
wait for other blog posts - or a conference.</p>]]>
      
   </content>
</entry>

<entry>
   <title>The ConFoo.ca &quot;Web Techno&quot; conference is coming soon</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2010/01/the_confooca_web_techno_confer.html" />
   <id>tag:blogs.oracle.com,2010:/opal//31.16385</id>
   
   <published>2010-01-19T20:17:30Z</published>
   <updated>2010-01-19T20:36:02Z</updated>
   
   <summary>Francis Begin reminded me that Québec&apos;s premiere (can I say that?) open source conference is coming sooner than you think: ConFoo.ca is styled as a &quot;Web Techno&quot; conference &quot;with over 130 presentations in 8 rooms&quot;. It takes place in March,...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="conference" label="conference" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="quebec" label="quebec" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>Francis Begin reminded me that Québec's premiere (can I say that?)
open source conference is coming sooner than you think: <a href="http://confoo.ca/en">ConFoo.ca</a> is styled as a "Web Techno" conference "with over 130
presentations in 8 rooms". It takes place in March, which means you need to get your travel plans organized ASAP.</p>

<p>This conference is an evolution of previous PHP successful
conferences.  This year it has grown to include a number of web related
themes and other languages.</p>

<p>Speaking of languages, my multi-lingual colleague Kuassi Mensah
will be presenting at the conference. A lot has happened in the year since he last spoke there.</p>

<p>Early bird pricing is available to January 22nd.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Tracing PHP Oracle Applications, part 1</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2010/01/tracing_php_oracle_application.html" />
   <id>tag:blogs.oracle.com,2010:/opal//31.16382</id>
   
   <published>2010-01-19T19:14:35Z</published>
   <updated>2010-01-19T19:20:30Z</updated>
   
   <summary>(This was an article I wrote for a newsletter). In December 2009, PHP reached the number three position in the TIOBE language index. Analysts are recommending PHP be considered in your technology portfolio. Oracle Enterprise Linux users are well placed...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="attributes" label="attributes" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="code" label="code" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="database" label="database" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="monitoring" label="monitoring" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="performance" label="performance" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="sql" label="sql" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="tracing" label="tracing" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>(This was an article I wrote for a newsletter).</p>

<p>In December 2009, PHP reached the number three position in the <a
href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">TIOBE
language index</a>.  Analysts are recommending PHP be considered in
your technology portfolio. Oracle Enterprise Linux users are well
placed to do this. </p>

<p>Oracle contributes to the PHP project by, among other things,
maintaining the OCI8 extension for the Oracle Database.  It is
available with PHP source code and is also bundled on the PHP
Extension C Library (PECL), where it can be used to update existing
versions of PHP.</p>

<p>OCI8 RPMs for the default Linux PHP are available for <a href="http://linux.oracle.com">Unbreakable Linux Network</a>
subscribers in the "Oracle Software" channel.  However, most users will
want a recent version of PHP.  Our partner, Zend, has worked with
Oracle to make their Zend Server available through ULN.  This product
was highlighted in the November Linux newsleter.  More information is
at: <a href="http://www.oracle.com/technology/tech/php/zend-server.html">http://www.oracle.com/technology/tech/php/zend-server.html</a> </p>

<p>No matter how it was installed, the PHP OCI8 extension provides a
procedural API with familiar calls allowing efficient SQL and PL/SQL
execution.  The extension also supports some advanced Oracle features
such as connection pooling.</p>

<p>Recently some new OCI8 functions were checked into the PHP source
code.  These will become available as the packages pick up the latest
changes.</p>

<p>The new functions include:</p> 

<ul>
  <li>oci_set_module_name</li>
  <li>oci_set_action</li>
  <li>oci_set_client_info</li>
</ul>

<p>These set values that are can be used by the database.  By
transparently "piggy-backing" onto SQL statements sent to the
database, they efficiently provide a way to enhance the tracability,
authentication and auditing of applications.</p>

<p>A quick example using these new functions is:</p> 

<pre>
    &lt;?php 

    $c = oci_connect('hr', 'hrpwd', 'localhost/orcl'); 

    oci_set_client_info($c, 'My Application Version 2'); 
    oci_set_module_name($c, 'Home Page'); 
    oci_set_action($c, 'Friend Lookup'); 

    // Do some action which touches the database 
    // The three attribute values will be "piggy backed" 
    // and sent to the database 
    $s = oci_parse($c, 'select * from dual'); 
    oci_execute($s); 
    oci_fetch_all($s, $res); 

    ?&gt;
</pre>

<p>The values are used in a number of data dictionary views in the
database, such as V$SESSION.  You can also architect your code to make
use of the values.  For example they can be viewed and tested in SQL
queries using the SYS_CONTEXT() function.</p>

<p>One key use for the Module and Action values is to track exactly
what SQL statements each part of your application executes.  These
values are recorded along with the SQL statement in the V$SQLAREA
view the first time a statement is executed:</p>

<pre>
   SQL> select sql_text, module, action 
        from v$sqlarea 
        where module = 'Home Page'; 

   SQL_TEXT                    MODULE          ACTION 
   --------------------------- --------------- ---------------- 
   select * from dual          Home Page       Friend Lookup 
</pre>

<p>This quickly allows you to narrow down problematic statements to
resolve performance issues.</p>

<p>In a future post I'll talk about some of the other changes in OCI8
1.4 and go into more depth on how to use the attributes for
tracing.</p>]]>
      
   </content>
</entry>

<entry>
   <title>PHP Advent 2009</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/12/php_advent_2009.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.15849</id>
   
   <published>2009-12-04T00:53:27Z</published>
   <updated>2009-12-04T00:58:00Z</updated>
   
   <summary>If you don&apos;t follow the PHP press this will be news: PHP Advent is back for 2009! Given the high quality of the previous two years of Advent posts, you&apos;d be crazy not to follow along this year: http://shiflett.org/blog/2009/dec/php-advent-2009...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>If you don't follow the PHP press this will be news: PHP Advent is back for 2009!<br />
<p><br />
Given the high quality of the previous two years of Advent posts, you'd be crazy not to follow along this year: <a href="http://shiflett.org/blog/2009/dec/php-advent-2009">http://shiflett.org/blog/2009/dec/php-advent-2009</a></p>]]>
      
   </content>
</entry>

<entry>
   <title>Zend Server and Oracle Enterprise Linux</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/11/zend_server_and_oracle_enterpr.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.15363</id>
   
   <published>2009-11-04T20:13:31Z</published>
   <updated>2009-11-04T20:21:10Z</updated>
   
   <summary>You can now use Oracle&apos;s free or paid Linux package channels to install Zend Server. In three links: The technical details Wim Coekaerts&apos;s blog gives the background The press release...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
   <category term="enterpriselinux" label="enterprise linux" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="installation" label="installation" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oel" label="oel" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oracle" label="oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="uln" label="uln" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="unbreakablelinuxnetwork" label="unbreakable linux network" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="up2date" label="up2date" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="yum" label="yum" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="zendserver" label="zend server" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>You can now use Oracle's free or paid Linux package channels to install Zend Server. </p><p> In three links:</p>
<p>

<a href="http://www.oracle.com/technology/tech/php/zend-server.html">The technical details</a>
<p>

<a href="http://blogs.oracle.com/wim/2009/11/zend_and_oracle_announced_tigh.html">Wim Coekaerts's blog gives the background</a>

<p>

<a href="http://www.zend.com/en/company/news/press/zend-and-oracle-join-forces-to-deliver-enterprise-class-linux-and-php-solution">The press release</a>]]>
      
   </content>
</entry>

<entry>
   <title>And Now to ZendCon 2009!</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/10/and_now_to_zendcon_2009.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.15104</id>
   
   <published>2009-10-19T20:38:06Z</published>
   <updated>2009-10-19T21:43:37Z</updated>
   
   <summary>Phew! The Oracle OpenWorld conference is: wrapped up. Check me out on video. Now onto ZendCon down at the other end of Silicon Valley. My ZendCon talk is on Tuesday afternoon. In what seems just the last few weeks a...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="book" label="book" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="conference" label="conference" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="packt" label="packt" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="zend" label="zend" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>Phew!  The Oracle OpenWorld conference is: <a
href="http://forums.oracle.com/forums/thread.jspa?threadID=974003">wrapped
up</a>.  Check me out on <a href="http://bit.ly/4iO2kJ">video</a>.</p>

<p>Now onto <a href="http://www.zendcon.com/">ZendCon</a> down at the
other end of Silicon Valley.  </p>

<p> My ZendCon talk is on <a
href="http://entwickler.com/konferenzen/ext_scripts/v2/php/sessions-popup.php?module=zendconf09&id=11828">Tuesday
afternoon</a>. In what seems just the last few weeks a new version of
the Oracle Database (version 11.2) and <a
href="http://pecl.php.net/package/oci8/1.4.0">OCI8 1.4 Alpha</a> have
been released.  After imparting the secrets of my hard-won, insiders
tips on best practices, I have a section on the new changes and
interesting things you can (and maybe should) now do.  I'll also tell
you where we are heading.  </p>

<p> Conveniently Packt have just sent me a few copies of <a
href="http://www.packtpub.com/PHP-Oracle-Web-Development-XML-Ajax-Open-Source
">PHP Oracle Web Development</a> by Yuli Vasiliev.  I'll have one as a
door prize at my session.  (Another copy of the book and some PHP
ElePHPants are headed to the <a href="http://phpconference.es/">PHP
Barcelona</a> conference at the end of the month).  Thanks <img
width="35" src="http://www.packtpub.com/images/PacktLogoSmall.png">
for the books.
]]>
      
   </content>
</entry>

<entry>
   <title>Raimonds Simanovskis: Developer of the Year, 2009</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/10/raimonds_simanovskis_developer.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.15101</id>
   
   <published>2009-10-19T20:19:49Z</published>
   <updated>2009-10-19T20:25:10Z</updated>
   
   <summary> Check out the Oracle Magazine Editors&apos; Choice Awards 2009. Raimonds was at the Oracle OpenWorld Conference last week. He seemed to be everywhere: I bumped into him numerous times and got to see one of his talks. He was...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="ruby" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="2009" label="2009" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="award" label="award" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="developer" label="developer" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oracle" label="oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="rails" label="rails" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p><br />
Check out the Oracle Magazine <a href="http://www.oracle.com/technology/oramag/oracle/09-nov/o69awards.html#simanovskis">Editors' Choice Awards 2009</a>.</p>

<p>Raimonds was at the Oracle OpenWorld Conference last week.  He seemed to be everywhere: I bumped into him numerous times and got to see one of his talks. He was always thinking of an interesting problem or great technical challenge to solve.</p>

<p>Congratulations Raimonds!<br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Oracle OpenWorld starts today!</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/10/oracle_openworld_starts_today.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14902</id>
   
   <published>2009-10-11T14:28:30Z</published>
   <updated>2009-10-11T14:51:43Z</updated>
   
   <summary>If you have an interest in dynamic language programming here are the Oracle sessions to attend. There are also unconference sessions happening - check out the OTN area for details on each day. Conference Sessions S311373 Agile Web Development: Ruby/Rails...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="python" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="ruby" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="oow09" label="#oow09" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="conference" label="conference" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="openworld" label="openworld" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="programming" label="programming" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="python" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="sessions" label="sessions" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>If you have an interest in dynamic language programming here are the Oracle sessions to attend.  There are also unconference sessions happening - check out the OTN area for details on each day.<p>

<h2>Conference Sessions</h2>

<p>S311373 <b>Agile Web Development: Ruby/Rails and Python/Django with Oracle Database 11g</b>, Sun 10:30-11:30 Hilton Hotel Golden Gate 1 <br />
S311371 <b>Best Practices for High-Performance Applications with Oracle Database 11g</b>, Mon  17:30-18:30 Hilton Hotel Golden Gate 1<br />
S311381 <b>Developing & Deploying the Largest Web-sites using PHP and Oracle Database 11g</b>,	Tues  16:00-17:00 Hilton Hotel Golden Gate 2 <br />
S311643 <b>Oracle Net Services Best Practices for Database Performance and Scalability</b>, Thur  10:30-11:30 Moscone South Room 305</p>

<p>The Best Practice talk covers the impact to the database that your programs have, and what to do about it</p>

<p>The Oracle Net talk will also help the DBA/Developer who needs to get best performance from any system.</p>

<h2>Hands-On Lab Sessions</h2>

<p>S312331 <b>Develop Painless Enterprise Web Applications using Python/Django and Oracle Database 11g</b>, Sun 13:15-14:15 Hilton Hotel Continental Parlor 1/2/3 <br />
S312331 <b>Develop Painless Enterprise Web Applications using PHP and Oracle Database 11g</b>, Sun 14:30-15:30 Hilton Hotel Continental Parlor 1/2/3 <br />
S312328 <b>Develop C/C++ Applications with Oracle DB 11g using Oracle Call Interface, Pro*C, ODBC</b>, Mon  14:30-15:30 Hilton Hotel Continental Parlor 1/2/3<br />
S312327 <b>Develop Painless Enterprise Web Applications using Ruby/Rails and Oracle DB 11g</b>, Tues  14:30-15:30 Hilton Hotel Continental Parlor 1/2/3</p>

<p>The Hands-on-Labs are self paced tutorials with the experts on hand to assist and answer questions - directly or indirectly related to the actual content.
The C/C++ lab is the practical side the the "Best Practice" talk above. It covers concepts and tools that will help  programming in any of the dynamic languages (p.s. in the C/C++ session you choose which of  the APIs - OCI/Pro*C/ODBC - you want to learn about: you don't have to do all).

<h2>DEMOgrounds</h2>

<p>The Dynamic Languages booth is W-006, which is at the front left as you enter the Moscone West exhibition hall. The general hours are:</p>

<ul>
<li>Monday   	10:30 - 18:30
<li>Tuesday  	10:30 - 18:30 
<li>Wednesday  9:15 - 17:15 
</ul>

<p>I'll do my shifts on Monday morning and all Wednesday - see you there!</p>
]]>
      
   </content>
</entry>

<entry>
   <title>PHP OCI8 1.4.0 Alpha is now available</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/10/php_oci8_140_alpha_is_now_avai.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14796</id>
   
   <published>2009-10-07T05:27:44Z</published>
   <updated>2009-10-07T05:29:45Z</updated>
   
   <summary>I just released an Alpha version of PECL OCI8 1.4 on http://pecl.php.net/package/oci8 The code is also merged to what will eventually be the PHP 5.3.2 and PHP 6.0 releases. Documentation will appear on http://www.php.net/manual/en/ref.oci8.php in the next few days, if...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="11gr2" label="11gR2" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oci8" label="oci8" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="release" label="release" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>I just released an Alpha version of PECL OCI8 1.4 on <a href="http://pecl.php.net/package/oci8">http://pecl.php.net/package/oci8</a><br />
The code is also merged to what will eventually be the PHP 5.3.2 and PHP 6.0 releases.</p>

<p>Documentation will appear on http://www.php.net/manual/en/ref.oci8.php<br />
in the next few days, if all goes according to plan.</p>

<p>From the Changelog:</p>

<p>1. Introduce connection attribute functions:</p>

<p>oci_set_module_name<br />
oci_set_action<br />
oci_set_client_info<br />
oci_set_client_identifier</p>

<p>These set values that are visible/used by the database. They<br />
are useful for tracing, authentication and auditing.</p>

<p>2. Introduce connection attribute function:</p>

<p>oci_set_edition</p>

<p>Oracle 11g R2 "editions" allow multiple versions of DB objects<br />
to exist at one time. By setting different editions, two<br />
different versions of an application can run concurrently,<br />
making upgrading easier and faster.</p>

<p>3. Set the DRIVER_NAME attribute of Oracle Database 11gR2<br />
connections to aid application tracing. The value used is<br />
"PHP OCI8" followed by the OCI8 version number. Note the<br />
version number may get truncated in DB views such as<br />
v$session_connect_info.</p>

<p>4. Allow the oci_set_prefetch value to be 0. This is important in<br />
some cases using REF CURSORS in Oracle 11gR2.</p>

<p>5. Introduce OCI_NO_AUTO_COMMIT as an alias for the OCI_DEFAULT<br />
constant (which is not the default value) used by oci_execute().</p>

<p>6. Generate an error if an invalid resource type is used in<br />
oci_bind_by_name</p>]]>
      
   </content>
</entry>

<entry>
   <title>New Article &quot;Using PHP with Oracle HTTP Server 11g&quot;</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/09/new_article_using_php_with_ora.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14400</id>
   
   <published>2009-09-14T20:13:05Z</published>
   <updated>2009-09-14T20:16:40Z</updated>
   
   <summary>Our Application Server team have put together a new article on installing PHP to use with the latest version of &quot;Oracle HTTP Server&quot; from our Fusion Middleware suite. The article is at: http://www.oracle.com/technology/products/ias/ohs/htdocs/php_ohs.htm....</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="applicationserver" label="application server" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="install" label="install" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ohs" label="ohs" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>Our Application Server team have put together a new article on installing PHP to use with the latest version of "Oracle HTTP Server" from our Fusion Middleware suite.  The article is at: <a href="http://www.oracle.com/technology/products/ias/ohs/htdocs/php_ohs.htm">http://www.oracle.com/technology/products/ias/ohs/htdocs/php_ohs.htm</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Come to PHP Code|Works - you&apos;ll regret missing it</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/09/come_to_php_codeworks_-_youll.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14351</id>
   
   <published>2009-09-11T18:11:06Z</published>
   <updated>2009-09-11T18:15:42Z</updated>
   
   <summary>Hey there! Kuassi Mensah and I will be presenting at the upcoming PHP Code|Works conference tour, which kicks off later this month. Code|Works is the latest generation of conference from the folk who, amongst other things, present the excellent PHP|Tek...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="conference" label="conference" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oracle" label="oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>Hey there!  Kuassi Mensah and I will be presenting at the upcoming PHP
<a href="http://cw.mtacon.com/" >Code|Works</a> conference tour, which kicks off
later this month.
</p>
<p>
Code|Works is the latest generation of conference from the folk who,
amongst other things, present the excellent PHP|Tek conference and
publish php|architect magazine.
</p>
<p>

There are some hot speakers presenting and since each city stop packs
so much into the alloted two days, you will get absolutely great
value.  The pricing is extremely attractive too.
</p>
<p>

Our Oracle talk is about best practices for using PHP with the Oracle
Database and also shows off some of the excellent new features of the
recent "Oracle Database 11g Release 2".  Full session details are on <a href="http://cw.mtacon.com/schedule/talk/oracle">http://cw.mtacon.com/schedule/talk/oracle
</a>. We'll be at the Dallas, Atlanta, Washington and New York venues.
</p>

<p>

And now for the good news: Oracle readers can get a $50 discount by
using the special promo code ENQJ-Q1LV-Z05X at checkout (valid until
Sept 15)
</p>
<p>

If you miss us at Code|Works, the next time to catch us is at Oracle's
huge <a href="http://www.oracle.com/openworld/index.html" >OpenWorld
conference</a> in San Francisco (see <a
href="http://db360.blogspot.com/2009/08/oracle-open-world-2009-java-jdbc-cc-oci.html">Kuassi's
list of sessions</a>). The following week I'll also be presenting at <a
href="http://zendcon.com/">ZendCon</a> in San Jose, California.  A
busy time!  </p>]]>
      
   </content>
</entry>

<entry>
   <title>Upgrading PHP Web Applications with Minimum Downtime using Oracle Editioning</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/09/upgrading_php_web_applications.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14154</id>
   
   <published>2009-09-02T05:31:11Z</published>
   <updated>2009-09-10T21:58:40Z</updated>
   
   <summary> Introduction The Edition-Based Redefinition (EBR) feature of Oracle Database 11gR2 is ideal for web sites that aim for no downtime when releasing application enhancements. Editioning allows certain database objects to have multiple versions all available at the same time....</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="11gr2" label="11gR2" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="edition" label="edition" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="editionbasedredefinition" label="edition-based redefinition" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oracle" label="oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="upgrade" label="upgrade" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[
<h2>Introduction</h2>

<p>The Edition-Based Redefinition (EBR) feature of Oracle Database 11gR2 is ideal for web sites
that aim for no downtime when releasing application enhancements.
Editioning allows certain database objects to have multiple versions
all available at the same time.  Applications can decide at runtime
which version of the objects should be used.
</p>
<p>
In this example I show how Oracle editioning can be used to upgrade a
"live" PHP application.  The changes can be made and tested on the
production database and then enabled for all users with a one keyword
change to the application.
</p>
<p>
The objects that can be editioned by Oracle are:
</p>
<ul>
 <li>synonyms
 <li>views
 <li>PL/SQL object types:
 <ul>
    <li> function
    <li> library
    <li> package and package body
    <li> procedure
    <li> trigger
    <li> type and type body
 </ul>
</ul>
<p>
Tables themselves can't be editioned but there is support for moving
and viewing data across editions.  
</p>
<p>

<h2>The Initial PHP Application</h2>

<p>
To start the example, run SQL*Plus as the user SYSTEM and grant
edition access to the application user CJ:
</p>
<pre>  sqlplus system/systempassword
  grant create any edition to cj;
  alter user cj enable editions;
</pre>
<p>
As the user CJ create a table of employees for the application:
</p>
<pre>  sqlplus cj/cj
  drop table myemp;
  create table myemp (name varchar2(10), hoursworked number);
  insert into myemp (name, hoursworked) values ('alison', 200);
  insert into myemp (name, hoursworked) values ('kris',   200);
  insert into myemp (name, hoursworked) values ('wenji',  200);
  commit;
</pre>
<p>
Now create the stored function that calculates the number of days of
vacation an employee is eligible for.  This function is stored in the
database so all Oracle applications can reuse the same logic:
</p>
<pre>  create or replace function 
            vacationdaysleft(p_name in varchar2) return number as
    vdl number;
  begin
   -- For every 40 hours worked, you get 1 day of vacation
   select floor(hoursworked / 40) into vdl 
     from myemp 
     where myemp.name = p_name;
   return vdl;
  end;
  /
</pre>
<p>
Test the function in SQL*Plus by calling:
</p>
<pre>  select name, vacationdaysleft(name) from myemp;
</pre>
<p>
This returns:
</p>
<pre>  NAME                           VACATIONDAYSLEFT(NAME)
  ------------------------------ ----------------------
  alison                                              5
  kris                                                5
  wenji                                               5
</pre>
<p>
In PHP OCI8 1.3 the function could be used in an example file,
vacation.php:
</p>
<pre>  &lt;?php

  $c = oci_connect('cj', 'cj', 'localhost/orcl');

  $s = oci_parse($c, 'alter session set edition = ora$base');
  oci_execute($s);

  $s = oci_parse($c, "begin :vdl := vacationdaysleft(:name); end;");
  oci_bind_by_name($s, ":vdl", $vdl, 10);
  oci_bind_by_name($s, ":name", $name, 10);
  $name = 'alison';
  oci_execute($s);

  echo "$name has ".$vdl." days vacation left" . PHP_EOL;

  ?&gt;
</pre>
<p>
This makes a simple call to the stored function and returns in $vdl
the number of days vacation for person $name.
</p>
<p>
Note the ALTER SESSION call.  I've added it because I know I'll be
using the editioning feature.  The 'ora$base' token means to use the
root or first edition of objects, i.e. the PL/SQL function
vacationdaysleft() we just created.  The ALTER statement should appear
pretty much immediately after the connection is made - you don't want
parts of the application to be using the wrong edition.
</p>
<p>
The PHP script produces output like:
</p>
<pre>  $ php vacation.php
  alison has 5 days vacation left
</pre>
<p>
This is good.  We put the application into production and employees
start using it.  All is well for a while.
</p>

<h2>Enhancing the Application</h2>

<p>
Now assume the rate used to calculate vacation hours needs to be
changed so that now for every 30 hours worked, employees get one day
of vacation.  Also we want the calculation to include how many days
vacation they have already taken.
</p>
<p>
First, we need a new column to store the vacation they have taken.
Adding this column won't affect the running PHP application since it
doesn't know about it (this is a good reminder never to do "select *"
in an application).  The new column is:
</p>
<pre>  alter table myemp add daysvacationtaken number;
</pre>
<p>
We need to populate that column manually, here with values I've
invented:
</p>
<pre>  update myemp set daysvacationtaken = 2 where name = 'alison';
  update myemp set daysvacationtaken = 3 where name = 'kris';
  update myemp set daysvacationtaken = 0 where name = 'wenji';
  commit;
</pre>
<p>
For more complex scenarios the editioning feature has CROSSEDITION
triggers and editioning views to help ensure the appropriate data is
available and used correctly in the old and new editions of the
application.  Remember our current and future enhanced versions of the
PL/SQL function can be accessing the same table concurrently - only
the PL/SQL code has multiple versions.
</p>
<p>
Now we need to create the new version of the PL/SQL function.  In
SQL*Plus create a new edition and set it to be in use for this
session:
</p>
<pre>  sqlplus cj/cj
  create edition e2;
  alter session set edition = e2;
</pre>
<p>
Now create the updated version of the procedure.  Because the SQL*Plus
session is in edition 'e2' this won't affect the PHP application which
runs using edition 'ora$base'.  The enhanced function can be created
with:
</p>
<pre>  create or replace function 
            vacationdaysleft(p_name in varchar2) return number as
    vdl number;
  begin
   -- For every 30 hours worked, you get 1 day of vacation
   select floor(hoursworked / 30) - daysvacationtaken into vdl 
     from myemp 
     where myemp.name = p_name;
   return vdl;
  end;
  /
</pre>
<p>
Querying it shows the updated values:
</p>
<pre>  select name, vacationdaysleft(name) from myemp;

  NAME                           VACATIONDAYSLEFT(NAME)
  ------------------------------ ----------------------
  alison                                              4
  kris                                                3
  wenji                                               6
</pre>
<p>
This is all done while users continue to use the PHP application live
and get the original results.  You can check that the script still
returns the "old" value:
</p>
<pre>  $ php vacation.php
  alison has 5 days vacation left
</pre>
<p>
Now edit vacation.php and change the ALTER SESSION statement to the
new edition:
</p>
<pre>  $s = oci_parse($c, 'alter session set edition = e2');
</pre>
<p>
When run, the script output now shows the updated calcuation of
vacation time:
</p>
<pre>  $ php vacation.php
  alison has 4 days vacation left
</pre>
<p>
You can see that the roll out of application updates can be made
faster and have more thorough testing, increasing the availability and
reliability of web sites.
</p>

<h2>Summary</h2>

<p>
Oracle Database 11g Release 2 Editioning helps PHP web sites meet the
goals of minimal downtime with the frequent upgrade cycle needed by
modern web applications.  It allows PHP applications, their often
complex stored business logic, and large data sets to be updated ready
for going live in production without impacting the operation of
existing users.
</p>
<p>
After setting up the edition objects, the simple process of rolling
out a new PHP script with the updated edition name allows application
upgrades to occur rapidly.
</p>
<p>
The <a href="http://www.oracle.com/pls/db112/homepage">Oracle manuals</a> have more information about using and managing
editions.
</p>
]]>
      
   </content>
</entry>

<entry>
   <title>Oracle Database 11gR2 Enhancements for PHP</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/09/oracle_database_11gr2_enhancem.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.14150</id>
   
   <published>2009-09-02T00:26:55Z</published>
   <updated>2009-09-08T21:22:48Z</updated>
   
   <summary>Oracle Database 11g Release 2 is now available for download. It&apos;s a great feeling to see this major release available to customers. Lots of hard work has gone into it and my thanks go to all those folk at Oracle...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="11gr2" label="11gR2" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="database" label="database" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="release" label="release" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p>Oracle Database 11g Release 2 is now available for download.
</p><p>
It's a great feeling to see this major release available to customers.  Lots of hard work has gone into it and my thanks go to all those folk at Oracle who have made it possible.
</p><p>
Currently Linux 32 and 64 bit software is on the Oracle Database <a href="http://www.oracle.com/technology/software/products/database/index.html">Software Downloads</a> page.
</p><p>
There are many new database features.  Various <a href="http://www.oracle.com/technology/products/database/oracle11g/index.html">whitepapers</a> and the <a href="http://www.oracle.com/technology/documentation/database.html">documentation</a> discuss them in detail.
</p><p>
In this post, I want to mention some of the new features useful for PHP OCI8 applications.  They include enhancements that let online production applications be upgraded with minimal downtime, and also features improving existing important capabilities introduced in Oracle 11gR1 such as DRCP connection pooling and the Client Query Result Cache.
</p><p>
The new features in Oracle Database 11g Release 2 that I want to highlight are:
</p>
<ul>
  <li><p>A new Database Resident Connection Pool (DRCP) dynamic performance view V$CPOOL_CONN_INFO.  There is a GV$ counterpart for Oracle RAC.
</p><p>
    DRCP is a connection pooling solution that allows web applications to use database server connection resources very efficiently.  At the upper end, it lets web applications scale to tens of thousands of connections on commodity hardware.
    </p><p>
    The new view displays information about each connection to the DRCP Connection Broker.  This gives more insight into client processes that are connected, making it easier to monitor and trace applications that are currently using pooled servers or are idle.  (PHP/Apache processes that are idle retain a lightweight connection to the DRCP Connection Broker.)
</p><p>
    Existing DRCP views are unchanged from Oracle 11gR1. (Update: DBA_CPOOL_INFO now has NUM_CBROK and MAXCONN_CBROK columns, equivalent to the pool configuration option parameters of the same names)
</p>
</li>
  <li><p>The Oracle 11g Client Query Result Cache (CQRC) is supported with DRCP connections.
</p><p>
    The CQRC is a result cache storing the results of queries in the PHP/Apache process memory.  When queries are executed repeatedly, the results can be retrieved directly from the cache, resulting in faster query response time.  The results in the cache are automatically marked invalid when data in the database objects being accessed by the query is modified.</p>
</li>
  <li><p>Table Annotations are supported for CQRC, making it easier for existing applications to get performance benefits from result caching.  Previously queries had to be modified to include the "/*+ result_cache */" hint.  In Oracle Database 11gR2 a DBA can now create or annotate a table as being a candidate for CQRC:

  <pre>       ALTER TABLE sales RESULT_CACHE (MODE FORCE);  </pre>
    <p>The application code does not need to change.</p>
</li>
  <li><p>The prefetching of rows from REF CURSORs (aka Cursor Variables) is supported in Oracle Database 11gR2, greatly increasing performance when Oracle PL/SQL stored procedures and functions are used to encapsulate business logic.
</p><p>
    REF CURSORS are like pointers to result sets.  Typically queries are performed in PL/SQL and a REF CURSOR is returned to PHP so the results can be processed.
</p><p>
    Prefetching minimizes database server round-trips by returning batches of rows to an Oracle-managed cache each time a request is made to the database.  Prefetching was previously only supported for queries.
</p><p>
    With Oracle Database 11gR2, the default REF CURSOR prefetch row count size is the value of oci8.default_prefetch in php.ini, i.e. 100 in PHP OCI8 1.3.  The size can be explicitly changed for a REF CURSOR.  For example, to increase the prefetch size of a REF CURSOR to 200:
</p>
  <pre>	$stid = oci_parse($c, "call myproc(:rc)");
	$refcur = oci_new_cursor($c);
	oci_bind_by_name($stid, ':rc', $refcur, -1, OCI_B_CURSOR);
	oci_execute($stid);
	oci_set_prefetch($refcur, 200);
	oci_execute($refcur);
        oci_fetch_all($refcur, $res);
  </pre>
<p>
    Setting the prefetch count on the "parent" resource $stid does not change the prefetch size for $refcur.
</p><p>
    REF CURSOR prefetching can be used when connected to previous database versions so taking advantage of the new feature can be as simple as relinking PHP with Oracle 11.2 client libraries.
</p><p>
    Prefetching also now works for nested cursor columns:
</p>
<pre>       select department_name, 
              cursor(select manager_id 
                     from employees
                     where employees.employee_id = departments.department_id)
       from departments;
</pre>
<p>
    Nested cursor prefetching requires both the Oracle client libraries linked with PHP and the database to be Oracle Database 11gR2.</p>
</li>
</ul>
<p>
Many other new Oracle Database 11gR2 features will benefit web applications.  Here are just two of those features:</p>

<ul>
  <li><p>Edition-base redefinition makes it safer and easier to do web application upgrades.  This feature enables database components of an application to be upgraded and tested while the old version continues to be used.  When the changes are complete, an upgraded application using the new database objects can be made available to all users.
</p><p>
    I'll give an example of this in my next blog post since this is exciting stuff.</p>
</li>
    <li><p>RAC One Node has been introduced.  This bundling is perfect for sites that need high availability but currently run well with a single database server.</p>
</li>
</ul>

<p>The PHP OCI8 1.2.5 and 1.3 extensions compile and run against Oracle Database 11gR2 without modification.  PHP OCI8 1.3 is available with PHP 5.3.  It is recommended to upgrade to OCI8 1.3 for PHP 5.2 and earlier versions of PHP.  It can be installed from <a href="http://pecl.php.net/package/oci8">PECL</a>.</p>
]]>
      
   </content>
</entry>

<entry>
   <title><![CDATA[PyOhio - Python in Ohio, 25 &amp; 26 July 2009]]></title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/opal/2009/07/pyohio_python_in_ohio_25_26_ju_1.html" />
   <id>tag:blogs.oracle.com,2009:/opal//31.13341</id>
   
   <published>2009-07-14T17:29:41Z</published>
   <updated>2009-09-08T18:38:50Z</updated>
   
   <summary>PyOhio &quot;The Free Ohio-based Python Miniconference&quot; is on Saturday &amp; Sunday July 25-26 at Ohio State University. On Sunday Catherine Devlin and Oracle Technology Network&apos;s Todd Trichler will have an Oracle/Python/Linux Tutorial. This will have something interesting for everyone. Even...</summary>
   <author>
      <name>christopher.jones</name>
      
   </author>
   
      <category term="python" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="python" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/opal/">
      <![CDATA[<p><a href="http://www.pyohio.org/Home">PyOhio</a> "The Free Ohio-based Python Miniconference" is on Saturday & Sunday July 25-26 at Ohio State University.  On Sunday <a href="http://catherinedevlin.blogspot.com/">Catherine Devlin</a> and Oracle Technology Network's Todd Trichler will have an Oracle/Python/Linux Tutorial.  This will have something interesting for everyone.  Even if you don't want to attend the tutorial fulltime, you can jump in for the bits important to you.</p>

<p>Want to learn more about Python and Oracle, or ask questions about best Python practices - then attend Catherine's Python section and ask questions.  Want to know what Oracle database is about to understand its possibilities - then attend the installation part.  Want to learn more about Linux and Virtualization - Todd is great on this.</p>

<p>Wish I was going. Send me a postcard!<br />
</p>]]>
      
   </content>
</entry>

</feed>
