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

Little script for finding tables for which dynamic sampling was used

You can always download latest version here: http://github.com/xtender/xt_scripts/blob/master/dynamic_sampling_used_for.sql Current source code: col owner for a30; col tab_name for a30; col top_sql_id...

View Article


Image may be NSFW.
Clik here to view.

Just a couple of screenshots of sqlplus+rlwrap+cygwin+console

I previously wrote that I peeped the idea about showing the session information in terminal title from Timur Akhmadeev’s screenshots, and Timur wrote: I’m using (a bit modified) Tanel Poder’s login.sql...

View Article


Image may be NSFW.
Clik here to view.

Simple Android Oracle client

I am happy to announce, that I’ve just published my first android app – Simple oracle client for android! Since this is only the first version, I’m sure that it contains various UI bugs, so I’ll wait...

View Article

INDEX FULL SCAN (MIN/MAX) with two identical MIN()

I’ve just noticed an interesting thing: Assume, that we have a simple query with “MIN(ID)” that works through “Index full scan(MIN/MAX)”: SQL> explain plan for 2 select 3 min(ID) as x 4 from tab1 5...

View Article

select * from table where rownum=1

I never thought I would have to optimize so simple query as select col1, col2, col4, col7 from table where rownum=1 (even though I read recently “SELECT * FROM TABLE” Runs Out Of TEMP Space) But a few...

View Article


Easy quiz: rownum < NaN

As you know, NaN is a “Not a Number”. How do you think, what would be the result of the following query? (0f/0 == NaN) select count(*) cnt from dual where rownum < 0f/0; Spoiler:: Answer...

View Article

12c: Little test of “TABLE ACCESS INMEMORY FULL” with count stopkey

The table has 9M rows: SQL> with function f return int is 2 begin 3 for r in (select value from v$mystat natural join v$statname where name like 'IM scan rows') loop 4 dbms_output.put_line(r.value);...

View Article

Image may be NSFW.
Clik here to view.

Little quiz: Ordering/Grouping – Guess the output

How many times have you guessed the right answer? 1 select * from dual order by -1; select * from dual order by 0; [collapse] 2 select * from dual order by -(0.1+0/1) desc; select 1 n,0 n,2 n,0 n,1 n...

View Article


SQL*Plus tips #7: How to find the current script directory

You know that if we want to execute another script from the current script directory, we can call it through @@, but sometimes we want to know the current path exactly, for example if we want to spool...

View Article


A function gets called twice if the result_cache is used

Recently I showed simple example how result_cache works with non-deterministic functions and observed strange behaviour: a function gets fired once in the normal query, but twice with the result_cache...

View Article

Image may be NSFW.
Clik here to view.

RESULT_CACHE: run-time dependency tracking

As you know, since 11.2 “relies_on” clause was deprecated and oracle tracks dependencies at runtime now. Test function and tables create or replace function f_without_deps(p_tab varchar2) return...

View Article

12c: New SQL PLAN OPERATIONS and HINTS

This post is just a compilation of the links to other people’s articles and short descriptions about new SQL PLAN OPERATIONS and HINTS with a couple little additions from me. th.c_operation_name {...

View Article

Image may be NSFW.
Clik here to view.

Very simple oracle package for HTTPS and HTTP

I don’t like to import certificates, so i cannot use httpuritype for HTTPS pages and I decided to create package which will work with https as http. It was pretty easy with java stored procedures...

View Article


Image may be NSFW.
Clik here to view.

Oracle Database Developer Choice Awards: Up-Voters list

It’s very easy to get and analyze voters list using my new XT_HTTP package We can get up-voters list by the URL:...

View Article

Oracle package for HTTPS/HTTP[version 0.2]

A couple days ago i created simple package for HTTPS/HTTP, but I’ve decided now to improve it: Timeout parameter – it would be better to control connection time; Simple page parsing with PCRE regular...

View Article


Image may be NSFW.
Clik here to view.

Thanks to all #odevchoice voters!

And special thanks to all the great people who voted for me! I want to list all voters for all nomenees in one page: http://orasql.org/odevchoice/all-the-voters.html The query (using xt_http of course...

View Article

WINDOW NOSORT STOPKEY + RANK()

Recently I found that WINDOW NOSORT STOPKEY with RANK()OVER() works very inefficiently: http://www.freelists.org/post/oracle-l/RANKWINDOW-NOSORT-STOPKEY-stopkey-doesnt-work The root cause of this...

View Article


8 queens chess problem: solution in Oracle SQL

This is just another solution of this problem for a chessboard, but you can choose any size of the checkerboard: with t as (select level i, cast(level as varchar2(1)) c from dual connect by...

View Article

How even empty trigger increases redo generation

Very simple example: Test case set feed on; -- simple table: create table xt_curr1 as select level a,level b from dual connect by level<=1e4; -- same table but with empty trigger: create table...

View Article

row pieces, 255 columns, intra-block row chaining in details

You may know about Intra-block row chaining, that may occur when the number of columns in a table is more than 255 columns. But do you know that intra-block chaining works with inserts only? not...

View Article
Browsing all 101 articles
Browse latest View live