Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: creating indexes script
Eric W. Worden wrote:
>
> anyone have any experience rebuilding their indexes into other
> tablespaces? i'm working on a script, but i'm stuck when it comes to
> composite indexes and how to populate the columns' field in the create
> index statement. this is going to come in handy for 800 indexes.
>
> appreciate the help.
>
> script:
>
> select 'create index ' || U.index_name || ' on ' || U.table_name || ' ('
> ||
> column_name || ', ) ' || 'tablespace MY_INDEXES '
> from user_indexes U, user_ind_columns C
> where U.index_name = C.index_name
>
> --
>
> +------------------------------+
> + Eric Worden +
> + eworden_at_worldramp.net +
> + +
> + 407-306-1343 +
> +------------------------------+
Run an export of the schema with ROWS=N and INDEXES=Y. Then run an import with INDEXFILE=schema_ddl. It's now a simple matter of a little vi and grep to modify the file.
Ed
-- ~~~~~~~~~~~~~~~~~~~~~~~~~ jenningse_at_mindspring.comReceived on Thu May 08 1997 - 00:00:00 CDT
![]() |
![]() |