---
title: "oracle 索引出错解决方法"
author: "floydd"
date: "2011-07-27T11:01:00Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2012-01-12T14:19:19Z"
id: 1326343
url: "https://floydd.iteye.com/blog/1326343"
---

【jdbc的错误】ORA-01502: index 'XXXX' or partition of such index is in unusable state

【解决方法】

select index\_name from user\_indexes where status = 'UNUSABLE'

选中结果集，copy到eclipse里，使用正则替换成一下sql

alter index ${index\_name} rebuild

然后执行替换后的语句

PS：参考正则

*regexp*: **^(.\*)$**

*replaceBy*: **alter index $1 rebuild;**