sk0227
asked on
export only indexes of a schema as sql file
Hello Experts,
i have a requirement to extract DDL of all indexes of a schema as a sql file.
by using this file i am need to create indexes.
here is my requirement :
i need to to extract index DDL table by table(one sql file for each table ). i have around 5000+ tables. is there any quickest way to get all Index ddl.
Thanks,
#! Kumar
i have a requirement to extract DDL of all indexes of a schema as a sql file.
by using this file i am need to create indexes.
here is my requirement :
i need to to extract index DDL table by table(one sql file for each table ). i have around 5000+ tables. is there any quickest way to get all Index ddl.
Thanks,
#! Kumar
...or TOAD if you have it.
ASKER
Thanks for quick response...
how does toad /sql developer will give all index ddl of a scham?
how does toad /sql developer will give all index ddl of a scham?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Easier way is to use statement:
select DBMS_METADATA.GET_DDL('IND EX','<inde x_name>') from DUAL;
And best to combine with SELECT INDEX_NAME FORM USER_INDEXES ...
select DBMS_METADATA.GET_DDL('IND
And best to combine with SELECT INDEX_NAME FORM USER_INDEXES ...
>>Easier way is to use statement:
Did I not already mention this?
Did I not already mention this?
Easiest: follow slightwv's suggestion of using the old "exp"ort utility with rows=no, but instead of creating the index file, download and use http://www.ddlwizard.com/ (free) which will create formatted separate files for your ddl.
Good luck!
Good luck!
Yes You did slightwv. SOme how I missed or different time zone we live in.
Minutes I quite near to each other.
Any way sorry if I missed.
Minutes I quite near to each other.
Any way sorry if I missed.
ASKER
Thanks for solutions. i have done this task with datapump..
here is what i did with datapump. below parameter file will create index create file.
directory=MY_DIR
parallel=4
remap_schema=SCOTT:MY_SOCT T
sqlfile=indexes.sql
logfile=IMP_20121030.LOG
dumpfile=MYDUMPS%U.DMP
INCLUDE=INDEX
here is what i did with datapump. below parameter file will create index create file.
directory=MY_DIR
parallel=4
remap_schema=SCOTT:MY_SOCT
sqlfile=indexes.sql
logfile=IMP_20121030.LOG
dumpfile=MYDUMPS%U.DMP
INCLUDE=INDEX
:p