This just a short note to point out that the below SQL*Plus commands are deprecated as of Oracle 11g R2, but available in the current release of SQL*Plus for backward compatibility. The documentation states that this may only be available by setting the SQLPLUSCOMPATIBILITY variable in the future releases. You should modify scripts using obsolete [...]
This is just a short note the point out that RECORD option of TKPROF is extremely useful in recording and capturing the non-recursive SQL statements in the order of execution from the SQL trace file. I have not had a requirement to use it until—today—one of my developers lost the original test script used when [...]
SET TIMING—one of the most frequently used commands—displays timing statistics on each SQL command or PL/SQL block. What if you want to collect timing statistics for multiple group of statements? TIMING command becomes handy in such situation—one of things that I knew and have forgotten over time. It can be used to collect data to do [...]
I noticed a strange behavior—a SQL statement, which used to return no rows in the past, started returning rows in an environment where the test data set has not changed. I performed a code comparison and observed a difference in the order of a table in FROM clause. After looking through, I found a bug entry on MOS [...]
Last fall, I posted a note about Oracle Database 11g Architecture and Background Processes. This post is just a short note to point out that last week, Oracle University has made Oracle Database 11g Interactive Quick Reference available to public for download; it is a flash application, available for offline use in compressed file (.ZIP) [...]
Earlier I posted a list of operations and options available in Oracle database as of 11g R2, you should note that not all options are available for each operation. This post covers, over 200, commonly observed row source operations—unique combination of operations and options—each post contains a sample script to produce the operation and some may contain hints and [...]
The row source tree is the core of the execution plan. It contains the sequence of operations that the database performs to run the statement; each operation may have options associated with it. The operation in execution plan is also known as row source operator. If you look at the below example, TABLE ACCESS operation [...]
OVERLAPS predicate is a useful feature, which is not available in most SQL implementations that can help to determine whether the two periods overlap each other. If two periods overlap then the predicate evaluates to TRUE otherwise FALSE. Let us create a test table with three rows – one with overlapping dates, second with non-overlapping [...]
The SQL standard allows you to use an inline view in a DELETE statement, see the pseudo form below – If a condition such as key-preserved table is not met then it will result in error, “ORA-01752: cannot delete from view without exactly one key-preserved table.” I would like to show you the caveat of [...]
Joins A join is a query that combines rows from two or more tables. Oracle performs a join whenever multiple tables appear in the FROM clause of the query. Below is a SQL join statement, legacy syntax and ANSI/ISO syntax (also referred as new join syntax, was first introduced in Oracle 9i release) in a [...]