<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/css/atom.xsl" type="text/xsl"?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
    <id>https://www.williamrobertson.net/feed/code-atom.xml</id>
    <updated>2019-08-18T10:00:00.000+00:00</updated>
    <title type='text'>William Robertson code</title>
    <subtitle type='html'>Code, scripts and utilities, mostly for Oracle devlopers</subtitle>
    <link rel='self' type='application/atom+xml' href='https://www.williamrobertson.net/feed/code-atom.xml'/>
    <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/index-code.shtml'/>
    <link rel='https://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.williamrobertson.net/feed/code-atom.xml'/>
    <author>
    <name>William Robertson</name>
    </author>
    <openSearch:totalResults>29</openSearch:totalResults>
    <openSearch:startIndex>1</openSearch:startIndex>
    <openSearch:itemsPerPage>99</openSearch:itemsPerPage>

    <entry>
        <id>http://www.williamrobertson.net/documents/sqlplus-html.shtml</id>
        <published>2005-08-27T16:58:00.000+10:00</published>
        <updated>2018-08-27T16:58:00.000+10:00</updated>
        <title type='text'>SQL*Plus output in your web browser</title>
        <summary type='html'>Tanel Poder's SQL*Plus HTMLiser, prettified.
        </summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/sqlplus-html.shtml' title='SQL*Plus output in your web browser'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
        <id>http://www.williamrobertson.net/documents/refcursor-to-csv.shtml</id>
        <published>2017-07-12T00:07:00.000+00:00</published>
        <updated>2017-07-12T00:08:00.000+00:00</updated>
        <title type='text'>Ref cursor to CSV converter</title>
        <summary type='html'>Plug any SQL query into the &lt;code&gt;cursor()&lt;/code&gt; expression, and get back the results in delimited format.
        </summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/refcursor-to-csv.shtml' title='Ref cursor to CSV converter'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
        <id>http://www.williamrobertson.net/documents/pretty-print-plsql.html</id>
        <published>2015-08-25T19:30:00.000+00:00</published>
        <updated>2015-09-06T11:07:00.000+00:00</updated>
        <title type='text'>Pretty PL/SQL</title>
        <summary type='html'>Presenting PL/SQL code snippets in web pages, complete with syntax highlighting using Google Code Prettifier.
        </summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/pretty-print-plsql.html' title='Presenting PL/SQL code snippets in web pages'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
        <id>http://www.williamrobertson.net/documents/performance-for-sqlid.html</id>
        <published>2015-05-24T16:00:00.000+00:00</published>
        <updated>2015-05-24T17:00:00.000+00:00</updated>
        <title type='text'>Performance analysis for a specified SQL ID</title>
        <summary type='html'>
        How long does it typically take? How often is it called? What is the execution plan? Has it changed recently? Are the stats up to date?
        </summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/performance-for-sqlid.html' title='A set of scripts to check a specified SQL ID'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
        <id>http://www.williamrobertson.net/documents/undo_tracker.shtml</id>
        <published>2014-05-24T11:00:00.000+00:00</published>
        <updated>2014-05-24T11:00:00.000+00:00</updated>
        <title type='text'>undo_tracker.sql - how long will that session take to finish rolling back?</title>
        <summary type='html'>You've cancelled or killed a long-running operation, but the session is still rolling back (you can see this from v$transaction). How much longer will it take?</summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/undo_tracker.shtml' title='Monitor long-running rollback processes'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
        <id>http://www.williamrobertson.net/documents/xplanx.html</id>
        <published>2011-10-16T15:00:00.000+00:00</published>
        <updated>2011-10-16T16:22:00.000+01:00</updated>
        <title type='text'>xplanx.sql - an easier way to call dbms_xplan.display_cursor</title>
        <summary type='html'>Similar to xplan, but calls dbms_xplan.display_cursor instead of Explain Plan.</summary>
        <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/xplanx.html' title='xplanx.sql - an easier way to call dbms_xplan.display_cursor'/>
        <author><name>William Robertson</name><email>william@williamrobertson.net</email></author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/parallel-plsql-launcher.html</id>
       <published>2007-10-21T23:36:00.000+01:00</published>
       <updated>2008-08-01T22:58:49.699+01:00</updated>
       <title type='text'>Parallel PL/SQL launcher</title>
       <summary type='html'>&lt;p&gt;This is an experimental package for submitting PL/SQL calls in parallel using the Oracle SQL Parallel Query mechanism.&lt;/p&gt;&lt;p&gt;Many have complained that PL/SQL has no multi-threading support, as Java (for example) does. The conventional solution is to use DBMS_JOB or DBMS_SCHEDULER, and if necessary write your own wrapper to handle completion status reporting (Has it finished yet? Did it succeed?) - for an example of this approach, see &lt;a href="http://www.williamrobertson.net/documents/job-control-object.html"&gt;job_ot&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;However, SQL does have a parallel threading mechanism, in the form of Parallel Query (PQ). You simply execute your query using a PARALLEL() hint, or against tables with a parallel degree defined - particularly effective with partitioned tables, where partitions are divided among available PQ slave processes depending on resources available, and the results are combined at the end. You can think of this as a PQ controller dividing up the job, handing out tasks to PQ slaves, and collating the results. Meanwhile over in PL/SQL, you can define parallel-enabled pipelined functions that accept a ref cursor. The PQ controller decides how to divide up the ref cursor among available PQ slaves and passes them one function call each, thus invoking multiple instances of the function to handle the cursor.&lt;/p&gt;&lt;p&gt;Now, if you create a table "PQ_DRIVER" with 4 partitions and a parallel degree of 4, with one row in each partition, and you execute a query along the lines of &lt;tt&gt;SELECT&amp;nbsp;/*+&amp;nbsp;PARALLEL(pq,4)&amp;nbsp;*/&amp;nbsp;thread_id&amp;nbsp;FROM&amp;nbsp;pq_driver&amp;nbsp;pq;&lt;/tt&gt; that should persuade the PQ controller to set four PQ slave processes to work on it (one per partition). And if you pass that query as a cursor parameter to a parallel-enabled pipelined function, then shouldn't that create a situation where each row is processed by a separate PQ slave process? So here is a way to use (alright, hack) the PQ engine so that it processes arbitrary PL/SQL procedure calls in parallel.&lt;/p&gt;&lt;pre&gt;Connected to:&lt;br /&gt;&lt;b&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production&lt;/b&gt;&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; set timing on    &lt;br /&gt;SQL&gt; exec exec parallel_launch.test&lt;br /&gt;sid=151 serial#=39222:   Degree of parallelism: requested 4, actual 4: 20:04:16 - 20:04:18&lt;br /&gt;sid=137 serial#=27074:   Degree of parallelism: requested 4, actual 4: 20:04:16 - 20:04:18&lt;br /&gt;sid=146 serial#=33830:   Degree of parallelism: requested 4, actual 4: 20:04:16 - 20:04:18&lt;br /&gt;sid=132 serial#=11582:   Degree of parallelism: requested 4, actual 4: 20:04:16 - 20:04:18&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:03.55&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;&lt;b&gt;Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production&lt;/b&gt;&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&gt; set timing on&lt;br /&gt;SQL&gt; exec parallel_launch.test&lt;br /&gt;sid=123 serial#=21233:   Degree of parallelism: requested 4, actual 2: 06:07:47 - 06:07:49&lt;br /&gt;sid=123 serial#=21233:   Degree of parallelism: requested 4, actual 2: 06:07:49 - 06:07:51&lt;br /&gt;sid=127 serial#=21506:   Degree of parallelism: requested 4, actual 2: 06:07:47 - 06:07:49&lt;br /&gt;sid=127 serial#=21506:   Degree of parallelism: requested 4, actual 2: 06:07:49 - 06:07:51&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:06.83&lt;/pre&gt;&lt;p&gt;The degree of parallelism is lower in 11g than in 10.2 - possibly 11g is more intelligent and decides that four slaves would be excessive for a table with only four rows, especially in my single-processor RAM-starved desktop VM.&lt;/p&gt;&lt;p&gt;I also tested in 10.1.0.3.0:&lt;/p&gt;&lt;pre style="margin-top: 0em; margin-bottom: 0em;"&gt;sid=439 serial#=58467:   Degree of parallelism: requested 4, actual 4: 16:18:57 - 16:18:59&lt;br /&gt;sid=439 serial#=58467:   Degree of parallelism: requested 4, actual 4: 16:18:59 - 16:19:01&lt;br /&gt;sid=439 serial#=58467:   Degree of parallelism: requested 4, actual 4: 16:19:01 - 16:19:03&lt;br /&gt;sid=439 serial#=58467:   Degree of parallelism: requested 4, actual 4: 16:19:03 - 16:19:05&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;I got the four PQ slaves I asked for, but everything was executed by just one of them. What this is really telling me is that I don't fully understand PQ.&lt;/p&gt;&lt;p&gt;This has not been stress tested and I make no promises that it will work. Let me know what you find.&lt;/p&gt;</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/parallel_plsql_launcher.sql' title='Parallel PL/SQL launcher'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/parallel-plsql-launcher.html' title='Parallel PL/SQL launcher'/>
       <author> <name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/sudoku-solver.shtml</id>
       <published>2007-04-22T21:24:00.000+01:00</published>
       <updated>2007-09-10T07:01:45.430+01:00</updated>
       <title type='text'>Sudoku solver</title>
       <summary type='html'>The basic idea behind this was that if the intersect set of {row.freelist, column.freelist, square.freelist} gives only one value, then that must be the value of the cell.
          Now if row, column and square could all be instances of a Sudoku Element object type, and that had a free_list() method, it shouldn't be too hard to write...
          As it's all held in arrays I used the &lt;code&gt;MULTISET INTERSECT&lt;/code&gt; operator, and &lt;code&gt;IS A SET&lt;/code&gt; in the validation step, and while I'm at it
          &lt;code&gt;MEMBER OF&lt;/code&gt; in the "cross hatching" algorithm. I also used some conditional compilation for diagnostic output.&lt;br /&gt;&lt;br /&gt;
          My original idea was to find the intersection of the three sets of free values for each cell - that is, the available values for the row, the column and the box.
          I thought this was pretty neat until I looked up Sudoku-solving and found that it was called "Candidate Elimination"
          (or &lt;a href="http://www.brainbashers.com/sudokuforcedmoves.asp"&gt;"Forced Move"&lt;/a&gt;) and regarded as the most basic approach used by
          beginners on simple puzzles.&lt;br /&gt;&lt;br /&gt;
          I built on this by adding a guessing loop, in which if the elimination approach cannot complete
          the puzzle, it takes each candidate value for each empty cell in turn, plugs that value in and retries the eliminator process.
          It turns out this is another standard technique, known variously as "What If", "Guess-and-Check", "Bifurcation", "Backtracking" or "Ariadne's thread".
          &lt;br /&gt;&lt;br /&gt;Version 4 adds a second deduction approach, in which a possible value for a cell is checked to see if there is anywhere else it
          could go in its row. If not, then it must go in that cell. This seems to be known as "Cross hatching" among Sudoku solvers.&lt;br /&gt;&lt;br /&gt;

          &lt;span style="font-weight: bold;"&gt;Updated:&lt;/span&gt; version 4 now checks the current column and square, and can also eliminate values using a "what if" test, along with some internal refactoring I won't bore you with.&lt;br /&gt;&lt;br /&gt;The next straightforward algorithm I want to add in a future version is "matched groups", described in Wikipedia as follows:&lt;br /&gt;&lt;blockquote&gt;One method works by identifying "matched cell groups". For instance, if precisely two cells within a scope (a particular row, column, or region) contain the same two candidate numerals (p,q), or if precisely three cells within a scope contain the same three candidate numerals (p,q,r), these cells are said to be matched. The placement of those candidate numerals anywhere else within that same scope would make a solution impossible; therefore, those candidate numerals can be deleted from all other cells in the scope.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I also want to add what the Brainbashers page calls &lt;a href="http://www.brainbashers.com/sudokuintersectionremoval.asp"&gt;Intersection Removal&lt;/a&gt;, in which for example you narrow down the location of the 5 within a box to one of two positions, and these fall within the same row or column: now even though you don't know exactly which position it goes in, you still have enough information to exclude the rest of that row or column.&lt;br /&gt;&lt;br /&gt;Now possibly by this point the code will be sufficiently complex that it would be simpler just to focus on a brute-force "check every possible combination" approach, but that seems to me to defeat the purpose - I wanted a solution using logical deduction.&lt;br /&gt;&lt;br /&gt;I should mention that the names in use for sudoku solving techniques seem to vary widely, and I originally made up some of my own before reading up on the subject. The excellent &lt;a href="http://www.brainbashers.com/sudokuhelp.asp"&gt;Brainbashers Sudoku Help&lt;/a&gt; site, for example, uses "Intersections" and "Pinned Squares" for what I call Locations (there is only one place for the 7 to go), "Forced Moves" for what I call Intersection (the only candidate value for the cell is 2), and &lt;a href="http://www.brainbashers.com/sudokulockedsets.asp"&gt;"Locked Sets"&lt;/a&gt; for what Wikipedia (see above) calls "Matched Groups" (actually I quite like this term and might use it myself). I also realise that I've used the word "square" where others have used "region" or "box".&lt;br /&gt;&lt;br /&gt;To install using SQL*Plus, either download &lt;a href="http://www.williamrobertson.net/code/sudoku_mk4.pls"&gt;sudoku-mk4.pls&lt;/a&gt; and run it from the &lt;tt&gt;SQL&gt;&lt;/tt&gt; prompt, or (if you trust me!) paste the following command directly into SQL*Plus:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;@http://www.williamrobertson.net/code/sudoku_mk4.pls&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;To reinstall over an existing version, add the argument "rebuild":&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;@http://www.williamrobertson.net/code/sudoku_mk4.pls &lt;b&gt;rebuild&lt;/b&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;This will cleanly drop all sudoku_* types, avoiding type dependency issues.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/sudoku_mk4.pls' title='Sudoku solver 10g'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/sudoku-solver.shtml' title='Sudoku solver 10g'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/automated-sql-tuning-advice-sqlid.html</id>
       <published>2006-11-15T13:01:00.000Z</published>
       <updated>2007-02-17T18:47:38.329Z</updated>
       <title type='text'>Automatic SQL tuning advice for an SQL ID</title>
       <summary type='html'>Just run:&lt;br&gt;&lt;br&gt;&lt;code&gt;@tune_sql_id [sql-id]&lt;/code&gt; for instant tuning suggestions.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/tune-sqlid.sql' title='DBMS_SQLTUNE tuning advice'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/automated-sql-tuning-advice-sqlid.html' title='DBMS_SQLTUNE tuning advice'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/automated-sql-tuning-advice.html</id>
       <published>2006-11-15T13:01:00.000Z</published>
       <updated>2017-08-31T00:10:38.329Z</updated>
       <title type='text'>Automatic SQL tuning advice</title>
       <summary type='html'>Just type &lt;code&gt;@tune&lt;/code&gt; in SQL*Plus for instant SQL tuning suggestions.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/tune.sql' title='DBMS_SQLTUNE tuning advice'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/automated-sql-tuning-advice.html' title='DBMS_SQLTUNE tuning advice'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/sqlplus-index-report.html</id>
       <published>2006-09-08T00:08:00.000+01:00</published>
       <updated>2019-18-14T00:14:00.000Z</updated>
       <title type='text'>ind.sql - SQL*Plus index report</title>
       <summary type='html'>Specify an index name to see details about (which table, what columns), or a table name to list all its indexes. Allows user.table, or user.index to report on items in other schemas (subject to privileges).</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/ind.sql' title='SQL*Plus Index report'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/sqlplus-index-report.html' title='SQL*Plus Index report'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/utility-assortment.html</id>
       <published>2005-12-03T19:28:00.000Z</published>
       <updated>2005-12-03T19:32:59.240Z</updated>
       <title type='text'>Utility assortment</title>
       <summary type='html'>ECHO (word-wrapper for DBMS_OUTPUT), TO_DECIMAL, TO_BASE (number conversion functions), SEND_MAIL (HTML formatted email), LIST_ELEMENT (string tokeniser), SPLIT, TO_STRING etc, all in one rather arbitrary package.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/utilities.pkg' title='Utility assortment'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/utility-assortment.html' title='Utility assortment'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/exception-object.html</id>
       <published>2005-12-03T18:06:00.000Z</published>
       <updated>2005-12-03T18:15:13.720Z</updated>
       <title type='text'>Exception object</title>
       <summary type='html'>An Exception object you can pass around between procedures. It was a bit of an experiment and I haven't found a real use for it yet, but maybe that's just because I've been working on warehouse systems for a while. Let me know if you find a use for it!</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/exception_ot.typ' title='Exception object'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/exception-object.html' title='Exception object'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/job-control-object.html</id>
       <published>2005-12-03T17:47:00.000Z</published>
       <updated>2005-12-03T20:01:20.136Z</updated>
       <title type='text'>Job control object</title>
       <summary type='html'>Job control modelled on Unix: declare "job" objects, submit them, wait for them to complete. Uses DBMS_JOB to submit tasks, DBMS_ALERT for jobs to pass back status and error messages, so the calling procedure can easily track the background jobs it started.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/job_ot.typ' title='Job control object'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/job-control-object.html' title='Job control object'/>
       <author> <name>William Robertson</name></author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/timer-object.html</id>
       <published>2005-12-03T17:41:00.000Z</published>
       <updated>2005-12-03T20:02:44.643Z</updated>
       <title type='text'>Timer object</title>
       <summary type='html'>Timer object to simplify the routine task of capturing start and end times and displaying formatted results. Includes "stop", "resume", "restart", "elapsed" and "show" methods.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/timer.typ' title='Timer object'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/timer-object.html' title='Timer object'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/avg-and-sum-for-intervals.html</id>
       <published>2005-12-01T00:44:00.000Z</published>
       <updated>2012-11-22T08:22:00.000Z</updated>
       <title type='text'>AVG and SUM for INTERVALs</title>
       <summary type='html'>
          Presumably due to an oversight, Oracle have not yet overloaded the SUM and AVG functions to support the INTERVAL DAY TO SECOND datatype. Here are my AVG_DSINTERVAL and SUM_DSINTERVAL aggregate/analytic functions.
       </summary>
       <link rel='related' href='http://www.williamrobertson.net/code/agg_dsinterval.typ' title='AVG and SUM for INTERVALs'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/avg-and-sum-for-intervals.html' title='AVG and SUM for INTERVALs'/>
       <author><name>William Robertson</name></author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/explain-plan-utility.html</id>
       <published>2005-11-30T18:03:00.000Z</published>
       <updated>2007-09-10T23:51:11.815+01:00</updated>
       <title type='text'>xplan.sql - Explain Plan utility</title>
       <summary type='html'>My handy Explain Plan script for SQL*Plus. Just type:&lt;br /&gt;@xplan</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/xplan.sql' title='xplan.sql - Explain Plan utility'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/explain-plan-utility.html' title='xplan.sql - Explain Plan utility'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/which.html</id>
       <published>2005-11-29T21:34:00.000Z</published>
       <updated>2006-09-03T14:41:40.170+01:00</updated>
       <title type='text'>Which</title>
       <summary type='html'>Resolves an object name following the same resolution path as SQL or PL/SQL:&lt;br /&gt;e.g. given the name "EMP", figure out that it's a public synonym for SCOTT.EMPLOYEES.&lt;br /&gt;&lt;br /&gt;Usage - use any of the following:&lt;br /&gt;@which emp&lt;br /&gt;@which scott.emp&lt;br /&gt;@which em%&lt;br /&gt;&lt;br /&gt;The report is in two parts. First it queries DBA_OBJECTS (or if that is not accessible it will automaticallly switch to ALL_OBJECTS) for any matching objects. The results include whether there is a synonym and whether you have been granted access. Then it calls DBMS_UTILITY.NAME_RESOLVE, which prior to 9i resolved the names of stored code (packages, procedures etc) but in recent versions has been extended to other database objects such as tables.&lt;br /&gt;&lt;br /&gt;If you use a wildcard, the report will stop after querying DBA_OBJECTS.&lt;br /&gt;&lt;br /&gt;It is possible for an object to appear in the first part of the results because it was found in DBA_OBJECTS, but not actually be resolvable, for example because it resides in another schema and you are missing a synonym.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/which.sql' title='Which'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/which.html' title='Which'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/my-sessions.html</id>
       <published>2005-11-28T22:27:00.000Z</published>
       <updated>2005-11-28T00:43:00.420Z</updated>
       <title type='text'>My sessions</title>
       <summary type='html'>A variation of &lt;a href="http://www.williamrobertson.net/code/sessions.sql"&gt;sessions.sql&lt;/a&gt;, but limited to the current OS user account. Handy when there are a lot of sessions and you only want to see your own. I should probably write a generic one that takes parameters...</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/my_sessions.sql' title='My sessions'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/my-sessions.html' title='My sessions'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/sessions.html</id>
       <published>2005-11-28T22:23:00.000Z</published>
       <updated>2005-11-28T00:42:15.140Z</updated>
       <title type='text'>Sessions</title>
       <summary type='html'>List all database sessions. Handy when you don't have TOAD, PL/SQL Developer etc around.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/sessions.sql' title='Sessions'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/sessions.html' title='Sessions'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/dict.html</id>
       <published>2005-11-28T00:34:00.000Z</published>
       <updated>2018-01-03T22:40:00.000Z</updated>
       <title type='text'>Dict</title>
       <summary type='html'>Find Oracle data dictionary information, grouping the results into USER_/ALL_/DBA_/other. e.g. "@dict dict" finds DICT, DICTIONARY, DICT_COLUMNS, GV$LOGMNR_DICTIONARY and V$LOGMNR_DICTIONARY together with their descriptions.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/dict.sql' title='Dict'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/dict.html' title='Dict'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/deps.html</id>
       <published>2005-11-28T00:26:00.000Z</published>
       <updated>2005-11-28T00:27:28.476Z</updated>
       <title type='text'>Deps</title>
       <summary type='html'>Dependency report for specified object (table, package etc) using DBA_DEPENDENCIES view.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/deps.sql' title='Deps'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/deps.html' title='Deps'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/constr.html</id>
       <published>2005-11-28T00:21:00.000Z</published>
       <updated>2005-11-28T00:24:47.823Z</updated>
       <title type='text'>Constr</title>
       <summary type='html'>Database constraints report, for the specified table, e.g. "@constr emp". Requires three stored types, which are included (commented out) within the script.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/constr.sql' title='Constr'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/constr.html' title='Constr'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/cardinality.html</id>
       <published>2005-11-27T19:37:00.000Z</published>
       <updated>2005-11-27T19:42:25.583Z</updated>
       <title type='text'>Cardinality</title>
       <summary type='html'>Reports on how unique a column is. For example, 90% of its values might be unique, with the remaining duplicates appearing in groups of twos and threes. This is useful when investigating a system that doesn't have a full set of unique constraints, or just for analyzing data in general. (I've also implemented this as a PL/SQL Developer right-click option using Browser Extender.)</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/cardinality.sql' title='Cardinality'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/cardinality.html' title='Cardinality'/>
       <author> <name>William Robertson</name>  </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/count.html</id>
       <published>2005-11-27T19:31:00.000Z</published>
       <updated>2005-11-27T19:35:36.036Z</updated>
       <title type='text'>Count</title>
       <summary type='html'>Shows the distinct values of [column] within [table], e.g. "@count object_type all_objects", which is the same as "SELECT object_type, COUNT(*) FROM all_objects GROUP BY object_type", but less typing.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/count.sql' title='Count'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/count.html' title='Count'/>
       <author> <name>William Robertson</name>  </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/most.html</id>
       <published>2005-11-05T19:21:00.000Z</published>
       <updated>2005-11-05T19:25:31.426Z</updated>
       <title type='text'>Most</title>
       <summary type='html'>Find the value that occurs most often in a column. For example, "@most object_type all_objects" reports "VIEW" and the number of occurrences; or "@most object_type all_objects 5" to see the top 5 object types.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/most.sql' title='Most'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/most.html' title='Most'/>
       <author> <name>William Robertson</name>  </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/percent.html</id>
       <published>2005-11-05T19:14:00.000Z</published>
       <updated>2005-11-05T19:18:38.526Z</updated>
       <title type='text'>Percent</title>
       <summary type='html'>Report on the population of [column] within [table]. Shows you how many null values exist in a column.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/percent.sql' title='Percent'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/percent.html' title='Percent'/>
       <author><name>William Robertson</name> </author>
    </entry>

    <entry>
       <id>http://www.williamrobertson.net/documents/biggest.html</id>
       <published>2005-10-22T23:16:00.000+01:00</published>
       <updated>2005-10-22T23:27:38.230+01:00</updated>
       <title type='text'>Biggest</title>
       <summary type='html'>Specify a table and a column name, to find the longest value held in that column. Can be useful when analyzing usage patterns or diagnosing "value too large" errors.</summary>
       <link rel='related' href='http://www.williamrobertson.net/code/biggest.sql' title='Biggest'/>
       <link rel='alternate' type='text/html' href='https://www.williamrobertson.net/documents/biggest.html' title='Biggest'/>
       <author> <name>William Robertson</name> </author>
    </entry>
</feed>
