Quantcast
Channel: SQL Tuning Blog
Browsing latest articles
Browse All 44 View Live

Before/After Trigger efficiency

Something changes continuously... and trigger efficiency too :). Please compare Oracle statement about triggers (see "Note" about trigger efficiency) Oracle 9i, Oracle 10g and Oracle 11g. I`ve tested...

View Article



ASH buffer size

An undocumented feature is shown in modern Oracle version alert log For example: Active Session History (ASH) performed an emergency flush. This may mean that ASH is undersized. If emergency flushes...

View Article

"PL/SQL lock timer" wait event is not written into ASH...

Recently I investigated some database lock issue by digging into ASH data. I accidentally found that while session is in 'ACTIVE' state and 'WAITING' on "PL/SQL lock timer", no rows is added into ASH....

View Article

SQLPLUS ARRAYSIZE and LOB

SQLPLUS ARRAYSIZE drops to 1 if your query select list contains LOB column(s). Extended SQL Trace file contains following rows for such queries (on my 11.2.0.3 Linux box) FETCH...

View Article

FOR UPDATE SKIP LOCKED

One new thing I`ve learned from recent PL/SQL Challenge quiz is about how SELECT FOR UPDATE SKIP LOCKED works. It does not really lock rows on EXEC phase of query execution (open cursor), when...

View Article


Materialize subquery on Active DataGuard

Due to some bug Oracle can fail to materialize subquery from with ... as clause on Active DataGuard with error ORA-00604: error occurred at recursive SQL level 2 ORA-16000: database open for read-only...

View Article

Do not use instance_id attribute of dbms_scheduler

You must not use dbms_scheduler.set_attribute('YOUR_JOB', 'instance_id', ); for your production system. If DBA makes some maintenance on your job`s RAC node, the job will just not run during that. So,...

View Article

Underscore (hidden) parameters in Multitenant database

It is pretty usual when your application needs some underscore (hidden) parameter to be set. But what can happen in new Multitenant database. [oracle@ora12c ~]$ sqlplus / as sysdba...

View Article


Why you don't want to parse clob using instr/substr functions

A very strange issue we have hit recently with a report which completion time could suddenly rise two or three times and then drop to some normal half an hour. The report is a pretty complex query...

View Article


Including files in SQL*Plus script

Do you know that @ (at sign) can also work as an include directive? Suppose you have a script for getting your session statistics from v$mystat. But you need a particular list of statistics....

View Article

How much redo data does you query generate (not about delayed block cleanup)

I want to show a tiny effect of materializing factored subquery, which can lead to huge redo generation. It is also a good time to taste new feature of defining PL/SQL function in the WITH clause. But...

View Article

How many times is pl/sql function called

Recently, a query caught my eye with some strange overuse of resources (LIO in that case). As usual, there were several calls of pretty complex pl/sql user-defined functions. Also an analytic function...

View Article

Swallowing exceptions

Have you heard about Oracle can hide some exceptions raised from user code? One well-known situation is described here. But there is one more case I've just found. Try this code: create or replace...

View Article


MERGE statement can fail with ORA-00001: unique constraint violated

How can MERGE statement fail with ORA-00001: unique constraint violated if all other things have been done right? I mean both source and target tables have primary key constraints and all columns from...

View Article

Flashback to Guaranteed Restore Points with Flashback Logging Disabled does...

As it appeared, flashback to Guaranteed Restore Points with Flashback Logging Disabled does not require redo logs. Indeed, restore point is made during database is mounted, and it does not need any...

View Article


SQL Monitoring Report History does contain predicate information

It can be extracted pretty easily using the following queries: insert into plan_table   (statement_id, plan_id, timestamp, remarks, operation, options,     object_node, object_name, object_alias, id,...

View Article

How to load big text file into CLOB via SQL*Plus

From time to time a need to load a long text file with XML or even long PL/SQL script arises. And the only tool available is SQL*Plus. As it appeared, it is very simply, if "include script" feature is...

View Article


Not for APEX guru: Select All/Deselect All in APEX 5

Recently I realized that I need to implement Select All/Deselect All feature for some dynamically generated checklist. Google search overwhelmed me with a vast number of inconvenient and unclear...

View Article

Wrong result when hierarchical query uses rownum filter and subquery filter...

Here is a test case to reproduce the issue. It uses well-known EMP and DEPT tables. If you need a script to create and populate it, see sql-script at the end of this article. Additionally, loopback...

View Article

SQLPATH environment variable length limit

I heavily use lots of sql scripts spread across several folders. Recently I started some reorganization of that directories to meet new needs of SQLcl (I'm testing it now in order to put it in my tool...

View Article

Bind variable peeking. Part 2.

As Jonathan Lewis wrote: "bind variable peeking is always done, even if histograms are not generated", so be prepared, your plan can be changed without any warning. Let me show the following example:...

View Article


APPEND hint placement

It is pretty surprising,  that APPEND hint can be placed not only after INSERT keyword but also after SELECT keyword of a subquery. Check these execution plans: SQL> create table tab1 as select *...

View Article


An ORA-07445 troubleshooting case

When somebody adopts fresh Oracle releases, she or he will certainly hit some fresh bug, which no one has registered or described before. And there is no choice except trying to dig deeply into...

View Article

My first ML model

 

View Article

APEX at Always Free Oracle Cloud Tier with Social Sign-on

 There are plenty of articles on the Internet, which describe how to make APEX social. I tried this one for my APEX at an Always Free ATP Database. Of course, I used my domain name to access my APEX...

View Article

Browsing latest articles
Browse All 44 View Live




Latest Images