... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2005-06-06

Oracle

Here is an Oracle SQL statement that will return a script to convert all LONG columns into CLOBs:

select 'alter table '||table_name||' modify ('||column_name||' clob);'
from user_tab_columns
where data_type='LONG';

Doing this might invalidate some indexes, reported by a message such as:

ORA-01502: index 'SOME_SCHEMA.SOME_INDEX' or partition of
such index is in unusable state

Here is a statement that will create a script to rebuild all invalid indexes:

select 'alter index '||index_name||' rebuild;'
from user_indexes
where status<>'VALID';

Blog Archive