Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Nov 17, 2011

Invisible Indexes

This is a really nice feature, particulary for me, a development DBA. Essentially you can make an index invisible so the optimizer doesn't use this index. This is excellent testing new indexes. You don't need to spend the time waiting for an index to be recreated each time you want to compare the differences.

To make an index invisable then run:
sql> alter index <index name> INVISIBLE;

To make an index visible:
sql> alter index <index name> VISIBLE;

You can also make the optimizer use all invisible indexes by for the current session by:
sql> alter session set optimizer_use_invisible_indexes = true ;

Dec 4, 2009

EXIT from PL/SQL procedure block

A simple method to EXIT from a PL/SQL block is to use the RETURN keyword. You should also be able to return an EXIT status.

So if we run something like -

1 BEGIN
2 dbms_output.put_line('one.');
3 return;
4 dbms_output.put_line('two.');
5* end;
n990538@edrtst> /
one.

PL/SQL procedure successfully completed.