I want to generate script of all the Indexes in Oracle database (Create Index statements). I am using PL/SQL Developer but can't find any such option.
CodePudding user response:
A simple query like this one will generate DDL for all indexes in the database:
SELECT DBMS_METADATA.GET_DDL ('INDEX', INDEX_NAME, owner) FROM DBA_INDEXES;
CodePudding user response:
I used following query to get user defined Indexes:
select dbms_metadata.get_ddl (object_type, object_name)
from user_objects
where object_type = 'INDEX'