Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
pros and cons (now: KEEP INDEX)

pros and cons (now: KEEP INDEX)

2004-04-01       - By Jacques Kilchoer
Reply:     1     2     3  

> -- --Original Message-- --
> Connor McDonald
>
> Has anyone come up with a reason why you 'd want the concept
> of a KEEP INDEX option?


I can always think of a hypothetical.
e.g.
I have a table with a PK. I want to load data in the table, and the data may violate the PK (nulls in PK columns). I disable the constraint but keep the index; I then use "enable constraint exceptions into ... " to find the rows that violate the constraint and process those rows. Finally I enable the constraint again and don 't have to rebuild the index.

proof of concept
SQL > create table t (id number, name varchar2 (10),
2 constraint t_pk primary key (id)) ;
Table créée.

SQL > insert into t (id, name) values (1, 'ONE ') ;
1 ligne créée.
SQL > insert into t (id, name) values (2, 'TWO ') ;
1 ligne créée.
SQL > commit ;
Validation effectuée.

SQL > alter table t disable constraint t_pk keep index ;
Table modifiée.

SQL > insert into t (id, name) values (3, 'THREE ') ;
1 ligne créée.
SQL > ---- inserting row that violates constraint
SQL > insert into t (id, name) values (null, 'FOUR ') ;
1 ligne créée.
SQL > commit ;
Validation effectuée.

SQL > -- -- find rows that violate constraint
SQL > alter table t enable constraint t_pk exceptions into my_exceptions ;
alter table t enable constraint t_pk exceptions into my_exceptions
*
ERREUR ? la ligne 1 :
ORA-02437 (See ORA-02437.ora-code.com): cannot validate (JRK.T_PK) - primary key violated


SQL > -- -- process rows that violate constraint
SQL > delete from t where rowid in (select row_id from my_exceptions) ;
1 ligne supprimée.
SQL > commit ;
Validation effectuée.

SQL > alter table t enable constraint t_pk exceptions into my_exceptions ;
Table modifiée.

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --