0

1 つ以上のディメンションで一連の属性のインデックスを作成したとします。インデックスを削除する SQL スクリプトを作成するにはどうすればよいですか。

例:もし私が持っていたら

               index1 created for (Attribute1,Attribute2) of Dimension1
               index2 -> (Attribute3,Attribute4) of Dimension2
               index3 -> (Attribute5,Attribute6) of Dimension3
               ...          ..........              ...
               indexn -> (Attribute2,Attribute3) of Dimensionn

では、index1、index2---indexn を削除するにはどうすればよいでしょうか。何か案は?

4

1 に答える 1

2

匿名の PL/SQL ブロックで、次のようなものを使用できます。

FOR x IN ( SELECT 'drop index ' || index_name stmt
              FROM all_indexes
              where upper(index_name) like ('INDEX%'))
            LOOP
                    EXECUTE IMMEDIATE x.stmt;
            END LOOP;
于 2013-02-13T08:06:53.040 に答える