<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel>
    <title>vsbabu.org : oracle</title>
    <link>http://vsbabu.org/mt/archives/categories/oracle/</link>
    <description>Gluing passing thoughts to foregone conclusions</description>
    <dc:language>en-us</dc:language>
    <dc:creator>vsbabu@gmail.com</dc:creator>
    <dc:rights>Copyright 2009</dc:rights>
    <dc:date>2009-08-21T20:52:54+05:00</dc:date>
    <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.661" />
    <admin:errorReportsTo rdf:resource="mailto:vsbabu@gmail.com"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>

    <item>
      <title>Useful SQL*Plus headers</title>
      <link>http://vsbabu.org/mt/archives/2009/08/21/useful_sqlplus_headers.html</link>
      <description>Quick stuff that I seem to be repeating to quite a lot of people!</description>
      <guid isPermaLink="false">1041@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
So who knows, it might be worth noting down!
</p>
<ul>
	<li><code>SET FEEDBACK ON</code> - show records that got affected</li>
	<li><code>SET TERMOUT ON</code> - show terminal output</li>
	<li><code>SET ECHO ON </code>- display the command that is about to be run</li>
	<li><code>SET TIMING ON</code> - print the time taken for each command to run</li>
	<li><code>SET VERIFY ON</code> - show variable substitutions</li>
</ul>
Additionally, you might want to put the following in login.sql to ensure you are connected to the right schema.
<blockquote>
<pre><code>SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER &gt; "</code></pre>
</blockquote>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2009-08-21T20:52:54+05:00</dc:date>
    </item>
    <item>
      <title>Dino eats frog</title>
      <link>http://vsbabu.org/mt/archives/2005/12/29/dino_eats_frog.html</link>
      <description>Confused? It is about Oracle.</description>
      <guid isPermaLink="false">1020@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
I downloaded <a href="http://www.oracle.com/technology/products/database/project_raptor/index.html">Oracle Raptor</a> early adopter release. Nice idea. Stripped down jDeveloper, for accessing and working on Oracle DBs. I used to use free version of <a href="http://www.toadsoft.com/">TOAD</a> some years back -- with Raptor, I don't miss TOAD anymore. Raptor is better than any of the free Eclipse plugins or free JDBC based offerings.
</p>
]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2005-12-29T18:07:05+05:00</dc:date>
    </item>
    <item>
      <title>Oracle with Active Record</title>
      <link>http://vsbabu.org/mt/archives/2005/07/19/oracle_with_active_record.html</link>
      <description>Thanks to ActiveRecord, it is a breeze to program Oracle using Ruby. Here&apos;s a quick note about how to do this on MS Windows.</description>
      <guid isPermaLink="false">1011@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<ol>
<li><a href="http://rubyforge.org/frs/?group_id=167">Install Ruby</a></li>
<li>Install Active Record. Open a DOS shell and run <tt>gem install activerecord</tt>.</li>
<li>Install OCI8 driver for Ruby. Download <a href="http://rubyforge.org/projects/ruby-oci8/">ruby-oci8-mswin</a>
      and double click it.
</li>
</ol>

<p>
Assuming you've standard <tt>scott/tiger</tt> schema on some Oracle
connection (the <tt>TNSNAMES.ORA</tt> entry in the example below is named
as <tt>development</tt>), here is a small sample script that shows how to manipulate
the data in one table.
</p>]]></content:encoded>
      <dc:subject>ruby</dc:subject>
      <dc:date>2005-07-19T13:50:42+05:00</dc:date>
    </item>
    <item>
      <title>When is he free?</title>
      <link>http://vsbabu.org/mt/archives/2004/04/30/when_is_he_free.html</link>
      <description>I thought this will be simple. I ended up with a pretty big SQL. Is there a simpler way?</description>
      <guid isPermaLink="false">989@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Here's the problem. A scheduling application has a table where
everyone's tasks are recorded with starting time and ending time. Further,
there is a limitation that you should start or end tasks either at the beginning of the hour or at the middle of the hour (makes our life a bit easier).  The normal working hours are from 8:30am to 12:30pm and from 1:30pm to 6:00pm. <strong>Given an employee id, and a date range (doesn't have time component), what are the free time slots the person has?</strong> We would also like to aggregate adjacent time slots to one record. ie., If a person is free from 9:00-9:30 and 9:30-10:30, then we need one record that says 9:00-10:30.
</p>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-04-30T08:41:11+05:00</dc:date>
    </item>
    <item>
      <title>Gentle dive into analytic functions</title>
      <link>http://vsbabu.org/mt/archives/2004/04/29/gentle_dive_into_analytic_functions.html</link>
      <description>A small example to illustrate using analytic functions to solve a (silly) query requirement.</description>
      <guid isPermaLink="false">988@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Oracle introduced analytic functions in Release 2 of 8i. These functions greatly
aide in solving some common query scenarios using straight SQL, that previously demanded procedural processing. Read <a href="http://www.revealnet.com/newsletter-v3/0402_D.htm">Introduction to 8i Analytic Functions</a> to get an idea on what these are.
</p>

<p>
Naturally, you will have situations where you have to write SQL for not so sensible business (or database design) situations. I will try to post more such samples. Here's one to ponder.
</p>
]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-04-29T15:26:29+05:00</dc:date>
    </item>
    <item>
      <title>Pivoting for dates - summary</title>
      <link>http://vsbabu.org/mt/archives/2004/04/19/pivoting_for_dates_summary.html</link>
      <description>Collection of interesting questions readers asked about newbie SQL on Oracle.</description>
      <guid isPermaLink="false">986@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
My notes <a href="http://vsbabu.org/mt/archives/2002/10/25/newbie_sql_current_week_range.html">newbie SQL for week ranges</a>
and <a href="http://vsbabu.org/mt/archives/2003/12/27/pivoting_on_all_objects.html">pivoting on ALL_OBJECTS</a>
resulted in several interesting questions from readers.
</p>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-04-19T16:42:46+05:00</dc:date>
    </item>
    <item>
      <title>On-line discussion on Larry Ellison</title>
      <link>http://vsbabu.org/mt/archives/2004/02/26/online_discussion_on_larry_ellison.html</link>
      <description>With the author of the book &quot;SOFTWAR: An Intimate Portrait of Larry Ellison and Oracle&quot;</description>
      <guid isPermaLink="false">982@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Got this mail from <a href="http://www.washingtonpost.com/wp-dyn/technology/columns/filter/">Ms. Cynthia Webb of The Washington Post</a>. I'm in India now and can't participate. In any case, I've not read this book and the title smacks of sensationalism that there is little chance that I will read it.
</p>

<p>
Summary: On 02/26/2004, 12 EST, participate in the <a href="http://discuss.washingtonpost.com/zforum/04/submit_sp_technews_symonds022604.htm">on-line discussion with Matthew Symonds</a>.
</p>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-02-26T09:10:19+05:00</dc:date>
    </item>
    <item>
      <title>Jython is great</title>
      <link>http://vsbabu.org/mt/archives/2004/02/24/jython_is_great.html</link>
      <description>Long overdue note on the ease and elegance of Jython.</description>
      <guid isPermaLink="false">981@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
    <a href="http://www.jython.org/">Jython</a> is a great time saver. It is a small
    download and installation is a very easy. It actually makes Java a bit more
    pleasing.
</p>

<p>
    Some quick uses I've found so far include:
</p>

<ol>
    <li>Making quick test scripts to integrate different Java components.</li>
    <li>Adding such scripts write into an Ant task.</li>
    <li>Using the great <a href="http://vsbabu.org/mt/archives/2003/02/13/joy_of_python_dir_help_and_pprint.html">pprint and dir</a>
        functions to dive into Java classes and methods much faster than API documentation.</li>
</ol>

<p>
    I am sure there are many more ways Jython can be used. For example, I checked in one old script
    that took about 15 minutes to write -- it provides a <a href="http://vsbabu.org/tmp/jyqlp.jy">rudimentary interactive sql shell</a>.
    The code couldn't be simpler! A while back, I needed to access an Oracle database. SQL*Plus
    was not installed in the client machine and the installer was not available either. This script
    came in handy then.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2004-02-24T12:13:48+05:00</dc:date>
    </item>
    <item>
      <title>Quick Links</title>
      <link>http://vsbabu.org/mt/archives/2004/01/18/quick_links.html</link>
      <description>Links I didn&apos;t want to forget later -- well, it is a Sunday morning after all.</description>
      <guid isPermaLink="false">977@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<ul>
<li><a href="http://www.petefinnigan.com/orasec.htm">Puget Sound OUG</a> presents triggers mela with easy to peruse references on <a href="http://www.psoug.org/reference/table_trigger.html">table triggers</a>, <a href="http://www.psoug.org/reference/system_trigger.html">system triggers</a>, <a href="http://www.psoug.org/reference/ddl_trigger.html">ddl triggers</a> and <a href="http://www.psoug.org/reference/instead_of_trigger.html">INSTEAD OF triggers</a> in their <a href="http://www.psoug.org/reference/">references section</a>. <tt>wget -nH -r -l 1 -k http://www.psoug.org/reference/</tt> <em>to download all of them.</em></li>
<li><a href="http://www.psoug.org/links.html">PSOUG's  Oracle links</a>.</li>
<li><a href="http://www.petefinnigan.com/orasec.htm">Links and articles by Pete Finnigan on Oracle security</a>.</li>
<li><a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:4875372619971188908::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:11744722468429,">Tom Kyte on setting up Oracle development environment</a>.</li>
</ul>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-01-18T09:43:31+05:00</dc:date>
    </item>
    <item>
      <title>Oracle 9i skills and DB2</title>
      <link>http://vsbabu.org/mt/archives/2004/01/10/oracle_9i_skills_and_db2.html</link>
      <description>Leveraging your Oracle 9i skills to learn DB2 UDB for Linux, UNIX and Windows V8</description>
      <guid isPermaLink="false">970@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
<a href="http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0401gupta/index.html?ca=dgr-lnxw12Oracle9iSkills">IBM dW has an excellent article</a>:
</p>

<blockquote>
    If you're a database specialist interested in growing your DB2 Universal Database skills, there's a good chance that you've already developed database skills with another relational database product somewhere along the way. This article shows you how to use your current knowledge of Oracle 9i to quickly gain skills in DB2 UDB for Linux, UNIX, and Windows Version 8.
</blockquote>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-01-10T18:37:18+05:00</dc:date>
    </item>
    <item>
      <title>Preventing duplicates in VARRAY columns</title>
      <link>http://vsbabu.org/mt/archives/2004/01/04/preventing_duplicates_in_varray_columns.html</link>
      <description>Today, I got an interesting question from a visitor to my site.</description>
      <guid isPermaLink="false">962@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>Question: 
<q>A table has a VARRAY column to store phone numbers. How can you
create a trigger to ensure that no duplicate values are stored in that
column?</q>
</p>

<p>
Generally, I tend not to use Oracle's extensions - for portability.
But this was an interesting question.
</p>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2004-01-04T14:04:33+05:00</dc:date>
    </item>
    <item>
      <title>Pivoting on ALL_OBJECTS</title>
      <link>http://vsbabu.org/mt/archives/2003/12/27/pivoting_on_all_objects.html</link>
      <description>Tom Kyte takes ROWNUM to make some very slick queries.</description>
      <guid isPermaLink="false">956@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Some times, in the RDBMS world, you need to generate rows from a SQL where
not enough rows exist in relevant tables. For examples, you might want to 
print a range of numbers like 1-10, 11-20, 21-30 and so on, and show the records from another table that falls in these ranges (eg: number of students in a class).
</p>

<p>
A classic solution is using a dummy table that has one column with many records with values say 1 to 1000. This is often called a <a href="http://otn.oracle.com/oramag/oracle/02-sep/o52sql.html">pivot table</a>.
</p>

<p>
With Oracle 8i and above, you can use sub-queries in FROM clauses and even in SELECT lists. This way, you don't really need to maintain a pivot table, as Oracle Guru <a href="http://asktom.oracle.com/">Tom Kyte</a> illustrates in two solutions this week.
</p>]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2003-12-27T21:44:55+05:00</dc:date>
    </item>
    <item>
      <title>PCTUSELESS</title>
      <link>http://vsbabu.org/mt/archives/2003/12/15/pctuseless.html</link>
      <description>I had an epiphany today. Analogous to Oracle&apos;s storage parameters, here is how it looks.</description>
      <guid isPermaLink="false">949@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Oracle adds records to Blocks, which are grouped into Extents, in turn grouped into Segments. 
And Segments are in Tablespaces. Records get filled into Blocks according to storage parameters,
viz., <code>PCTUSED</code> and <code>PCTFREE</code>. Consider the hypothetical values of
<code>PCTUSED=40, PCTFREE=20</code>.
</p>

<p>
This means that 20% of each block is reserved for future updates:
When the block gets filled(used) to 80%, the block is no longer available
for more inserts. As records get deleted from the block, the used
space in the block decreases. When the used space gets below PCTUSED, the block becomes
available for new insert. This process repeats itself over and over again.
</p>

<p>
Similar thing happens when you have management processes defined by a committee that
doesn't consider how people work in real life. That can be very easily depicted
by using a parameter called <code>PCTUSELESS</code>.
</p>]]></content:encoded>
      <dc:subject>project_management</dc:subject>
      <dc:date>2003-12-15T08:00:00+05:00</dc:date>
    </item>
    <item>
      <title>LEAD over rows</title>
      <link>http://vsbabu.org/mt/archives/2003/12/10/lead_over_rows.html</link>
      <description>Another useful Oracle SQL function that makes getting data out using queries much more easier.</description>
      <guid isPermaLink="false">948@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Yesterday, I had to solve a problem using Python for data coming
from an Access database. Had the data been in Oracle (8i or above), this
could have been solved at the SQL level. Essentially, I needed to jump ahead
in a query and display values from future records, in the current
record. You can think of this like converting row information into column
information.
</p>

]]></content:encoded>
      <dc:subject>oracle</dc:subject>
      <dc:date>2003-12-10T08:21:42+05:00</dc:date>
    </item>
    <item>
      <title>Respecting SQL</title>
      <link>http://vsbabu.org/mt/archives/2003/10/13/respecting_sql.html</link>
      <description>SQL is getting unfashionable among Java crowd. It doesn&apos;t have to be - you get reliability, maturity and familiarity with your data, using SQL.</description>
      <guid isPermaLink="false">915@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
<a href="http://www.devx.com/dbzone/article/17520">Jack D. Herrington</a>: <q>Have a Little Respect for SQL Databases
As we race towards better object technology, some people seem content to put relational database systems out to pasture—for no good reason. </q>
</p>

<p>
Via <a href="http://weblog.cemper.com/a/200310/12-have-a-little-respect-for-sql-databases.php">Christoph C. Cemper</a>
</p>]]></content:encoded>
      <dc:subject>dbms</dc:subject>
      <dc:date>2003-10-13T16:14:37+05:00</dc:date>
    </item>


  </channel>
</rss>


