A blog about software development, primarily in Java and about web applications.

Monday, February 22, 2010

Oracle SQL Schema and Text Index Size

I recently had to determine the size of my schema and the size of the text indexes used in that schema. These SQL statements got me the results:

SQL> select sum(bytes) from dba_segments where owner='SCHEMA_NAME' and SEGMENT_NAME like '%$%';

SUM(BYTES)
----------
6663307264

SQL> select sum(bytes) from dba_segments where owner='SCHEMA_NAME';

SUM(BYTES)
----------
9464446976

Friday, February 5, 2010

Oracle SQL Developer and Oracle Text

In the SQL Editor in Oracle's excellent SQL Developer tool, if you are running queries using an Oracle Text Index, you will run into issues when using the CONTAINS operator and searching for terms such as ${MySearchTerm}. The dollar-bracket syntax is used to do stemmng, but the SQL editor interprets them as bind variables and prompts you for their value. To turn off the bind variable interpretation you can precede the SQL statement with the following command:

set define off;

You only need to do this once and it will remain in effect for the rest of your usage of that SQL worksheet.