Oracle8i

RECORD feature of TKPROF

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 …

RECORD feature of TKPROF Read More »

OVERLAPS predicate

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 …

OVERLAPS predicate Read More »

Removing table rows using an inline view

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 …

Removing table rows using an inline view Read More »

How to create an Oracle User to use both OS Authentication and Password Authentication

The initialization parameter REMOTE_OS_AUTHENT offers a trusted authentication model to the network, users can have OS accounts on machines other than the database server and gain access to database, convenience of single sign-on through remote OS authentication REMOTE_OS_AUTHENT accepts BOOLEAN value, FALSE is a default value, which can be altered via ALTER SYSTEM command. This …

How to create an Oracle User to use both OS Authentication and Password Authentication Read More »

OERR: The command line Oracle error code lookup utility

OERR stands for Oracle Error, which is a utility ships with Oracle distribution for Linux and UNIX that helps retrieve messages from message (.msg) files based on the supplied error code. This utility is not available for Windows, but there are variants freely available on the Internet. The error code consists of two parts, facility …

OERR: The command line Oracle error code lookup utility Read More »

Oracle Metadata: PLAN_TABLE

PLAN_TABLE is the default sample output table into which the EXPLAIN PLAN statement inserts rows describing execution plans. This post summarizes the metadata information of this table for Oracle8/8i, 9i, 10g, and 11g;  read post, to know the methods for obtaining the formatted explain plan output from plan_table. Column Datatype Description Notes STATEMENT_ID VARCHAR2(30) Value …

Oracle Metadata: PLAN_TABLE Read More »

Oracle Statistics Package (STATSPACK): A Free Performance Analysis Tool

Statspack is a set of SQL, PL/SQL and SQL*Plus scripts which allow the collection, automation, storage and viewing of performance data.  A user, PERFSTAT, is automatically created by the installation; owns all objects needed by this package.  This user is granted limited query-only privileges on the V$views required for performance tuning. A Statspack report is …

Oracle Statistics Package (STATSPACK): A Free Performance Analysis Tool Read More »

How to identify PL/SQL performance bottlenecks using DBMS_PROFILER

The DBMS_PROFILER package provides an interface to profile existing PL/SQL applications and identify performance bottlenecks. You can then collect and persistently store the PL/SQL profiler data. This package enables the collection of profiler (performance) data for performance improvement or for determining code coverage for PL/SQL applications. Application developers can use code coverage data to focus …

How to identify PL/SQL performance bottlenecks using DBMS_PROFILER Read More »

How to run multiple Oracle database instances on a single server

You can have multiple instances on the same machine, each with their own data files,  either sharing the ORACLE_HOME or each with different ORACLE_HOME. ORACLE_HOME and ORACLE_SID are the key environment variables used by Oracle to identify an instance.  In addition $ORACLE_HOME/bin must be in your PATH environment variable. To check the value of these …

How to run multiple Oracle database instances on a single server Read More »

Tuning SQL statements with AUTOTRACE in SQL*Plus

You can automatically get a report on the execution path used by the SQL optimizer and the statement execution statistics. The report is generated after successful SQL DML (that is, SELECT, DELETE, UPDATE and INSERT) statements. It is useful for monitoring and tuning the performance of these statements. To use this feature, you must create …

Tuning SQL statements with AUTOTRACE in SQL*Plus Read More »