I discovered a simple way and without connection to a database to extract the definitions of indexes from an export file of an ORACLE database running on AIX 6.1
grep "CREATE INDEX" export_file.dmp > indexes_files.sql
This unix command will extract the indexes definition from the export file export_file.dmp and save it in a sql file indexes_files.sql
After that i needed to reformat the sql file and include a slash (/) after every definition in the file
cat achats_indexes.sql | awk '$0=$0 " \n/" {print $0}' >> output_indexes_files.sql
That's all, you can combine these two commands to create a shell script to extract indexes definition from oracle export files, taking 2 parameters : the export file and the sql output file.
No comments:
Post a Comment