備忘録

備忘録

SQLエラー: ORA-14452: すでに使用されている一時表で索引を作成、変更または削除しようとしました

環境

Oracle Database 11g

エラー全文

SQLエラー: ORA-14452: すでに使用されている一時表で索引を作成、変更または削除しようとしました
14452. 00000 -  "attempt to create, alter or drop an index on temporary table already in use"
*Cause:    An attempt was made to create, alter or drop an index on temporary
           table which is already in use.
*Action:   All the sessions using the session-specific temporary table have
           to truncate table and all the transactions using transaction
           specific temporary table have to end their transactions.

原因

一時表を作成後、
一時表のデータを削除(TRUNCATE TABLE)せずに、
一時表の表の作成、変更または削除を実行したから。

解決方法

TRUNCATE TABLE TMP_TABLE_NAME;
/* DROP TABLE TMP_TABLE_NAME; */