RDBMS/Oracle

Unusable index

KSerin 2021. 1. 28. 16:16
728x90
	SELECT *
	FROM dba_ind_partitions   -- 그냥 index면 dba_indexes
	WHERE index_owner = 'AAA'
	AND status = 'UNUSABLE'
	
	--ALTER INDEX AA_IDX REBUILD  PARTITION SYS_P313859;
	--ALTER INDEX AA_IDX2 REBUILD PARTITION P2019_07 ONLINE PARALLEL 32 NOLOGGING


	SELECT 'ALTER INDEX ' || index_name || ' REBUILD PARTITION '|| PARTITION_NAME || ';' AS ALTER_STMT
	FROM dba_ind_partitions  -- 그냥 index면 dba_indexes
	WHERE index_owner = 'AAA'
	AND status = 'UNUSABLE'
	;

 

728x90

'RDBMS > Oracle' 카테고리의 다른 글

Tablespace sql  (0) 2021.01.28
User&privilege  (0) 2021.01.28
RAC DB 시작/종료(startup/stop  (0) 2021.01.28
temp tablespace  (0) 2021.01.28
undo tablespace  (0) 2021.01.28