Quantcast
Channel: oracle – Oracle SQL
Browsing all 101 articles
Browse latest View live

How to speed up slow unicode migration of a table with xmltype columns

Recently I have had an issue with slow unicode migration of the database upgraded from 10g to 12.1.0.2. The main problem was a table with xmltype: we spent about 4 hours for this table(~17GB) during...

View Article


Intra-block row chaining optimization in 12.2

I’ve wrote in previous post 4. Next row piece can be stored in the same block only with inserts. When you run update, oracle will place new row piece into another block. But it’s not valid anymore 🙂...

View Article


SQL validation during PL/SQL compilation

A recent posting on SQL.RU asked why Oracle doesn’t raise such errors like “ORA-00979 not a group by expression” during PL/SQL compilation. Since I couldn’t find a link to the answer (though I read...

View Article

Book advice: ORACLE SQL & PL/SQL Golden Diary by Asim Chowdhury

I’ve reviewed this book recently, and I highly recommend it as it has almost all that needed to become strong Oracle developer. You can check at least the table of contents: ORACLE SQL & PL/SQL...

View Article

Simple regexp to check that string contains word1 and word2 and doesn’t...

with tst as ( select 'qwe word1 asd ...............' s from dual union all select 'qwe word1 asd word2 .........' s from dual union all select 'qwe word1 asd word2 zxc word3' s from dual union all...

View Article


Ampersand instead of colon for bind variables

I’ve troubleshooted one query today and I was very surprised that bind variables in this query were specified with &ampersand instead of :colon! I have never seen this before and I couldn’t find...

View Article

How to group connected elements (or pairs)

I see quite often when developers ask questions about connected components: Table “MESSAGES” contains fields “SENDER” and “RECIPIENT”, which store clients id. How to quickly get all groups of clients...

View Article

PL/SQL functions: Iterate and keys for associative arrays

Unfortunately associative arrays still require more “coding”: we still can’t use “indices of” or “values of” in simple FOR(though they are available for FORALL for a long time), don’t have convinient...

View Article


Easy(lazy) way to check which programs have properly configured FetchSize

select s.module ,ceil(max(s.rows_processed/s.fetches)) rows_per_fetch from v$sql s where s.rows_processed>100 and s.executions >1 and s.fetches >1 and s.module is not null and s.command_type...

View Article


Adaptive serial direct path read decision ignores object statistics since 12.1

On versions 11.2.0.2 – 11.2.0.4 Oracle uses objects’ statistics to make direct path reads decision (of course, if “_direct_read_decision_statistics_driven” haven’t changed it to “false”), and we can...

View Article

Image may be NSFW.
Clik here to view.

Triggers and Redo: changes on 12.2

In one of the previous posts I showed How even empty trigger increases redo generation, but running the test from that post, I have found that this behaviour a bit changed on 12.2: In my old test case,...

View Article

Oracle issues after upgrade to 12.2

Sometimes it’s really hard even to create reproducible test case to send it to oracle support, especially in case of intermittent errors. In such cases, I think it would be really great to have access...

View Article

Bug with integer literals in PL/SQL

This interesting question was posted on our russian forum yesterday: We have a huge PL/SQL package and this simple function returns wrong result when it’s located at the end of package body: create or...

View Article


Image may be NSFW.
Clik here to view.

SQL*Plus tips #8: How to read the output of dbms_output without “serveroutput...

When “serveroutput” is enabled, SQL*Plus executes “BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;” after each command. That’s why I don’t like when it is always enabled: it adds extra calls and...

View Article

Image may be NSFW.
Clik here to view.

“Collection iterator pickler fetch”: pipelined vs simple table functions

Alex R recently discovered interesting thing: in SQL pipelined functions work much faster than simple non-pipelined table functions, so if you already have simple non-pipelined table function and want...

View Article


Top N biggest tables (with lobs, indexes and nested table)

with seg as ( select owner,segment_name ,segment_type ,tablespace_name ,sum(blocks) blocks ,sum(bytes) bytes from dba_segments s where segment_type not in ( 'TYPE2 UNDO' ,'ROLLBACK' ,'SYSTEM...

View Article

Docker with Oracle database: install patches automatically

Recently I had to install the patch for fixing cross-platform PDB transport bug onto the docker images with Oracle, so these are easy way how to do it: 1. create directory “patches” and create...

View Article


Top-N again: fetch first N rows only vs rownum

Three interesting myths about rowlimiting clause vs rownum have recently been posted on our Russian forum: TopN query with rownum<=N is always faster than "fetch first N rows only" (ie....

View Article

Image may be NSFW.
Clik here to view.

Android Oracle Client 2.0

I’ve just released new version of my Simple Android Oracle Client. New features: Supported Oracle versions: 11.2, 12.1, 12.2, 18, 19, 20.SQL Templates: now you can save and load own script...

View Article

Simple function returning Parallel slave info

You can add also any information from v$rtsm_sql_plan_monitor if needed create or replace function px_session_info return varchar2 parallel_enable as vSID int; res varchar2(30); begin...

View Article
Browsing all 101 articles
Browse latest View live