lunes, 9 de julio de 2012

ORACLE-DBA-borrar tablespaces indexados.

Cuando se necesita borrar un tablespace y aparece el siguiente error:
ERROR at line 1: ORA-14405: partitioned index contains partitions in a different tablespace 

Ejecutar la siguiente query:
SQL>SELECT a.index_name, a.partition_name, a.status, a.tablespace_name, a.initial_extent, a.next_extent, a.pct_increase, a.num_rows FROM dba_ind_partitions a WHERE a.tablespace_name='tbs_name' ORDER BY a.index_name, a.partition_name; 


Reemplazando el nombre del tablespace. 

 INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME INITIAL_EXTENT NEXT_EXTENT PCT_INCREASE NUM_ROWS ------------------------------ ------------------------------ -------- ------------------------------ -------------- ----------- ------------ ---------- IX_LALA_01 PR_LALA_20120701 USABLE TBS_I_LALA_201207 122683392 495992 

cuando se identifican los nombres de los indices, borrar usando el siguiente comando:
drop index .
 ejemplo:
 SQL> drop index esquema.IX_LALA_01; 


 Ahora si se puede borrar el tablespace corrrectamente. 

SQL> DROP TABLESPACE TBS_I_LALA_201207 INCLUDING CONTENTS AND DATAFILES;

No hay comentarios:

Publicar un comentario