Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to create an index on GTT after populating data

Filipe RBApr 23 2018 — edited Apr 24 2018

Hi,

DB: 12.2

I am no able to create an index on a GTT, could you please provide some advise ?

1 - I am creating the GTT with CTAS:

CREATE GLOBAL TEMPORARY TABLE PL_TMP_RESULT_SET_01_X

  ON COMMIT PRESERVE ROWS TABLESPACE TBS_TMP_16KB

  AS SELECT .....

2 - I have tried both statements below but they are ginving an error (ORA-14450: attempt to access a transactional temp table already in use)

alter table PL_TMP_RESULT_SET_01_X add constraint pk_RESULT_SET_01_HIGHEVEN primary key(HIGHEVEN);

CREATE INDEX IDX$$_RESULT_SET_01_HIGHEVEN ON PL_TMP_RESULT_SET_01_X("HIGHEVEN") ONLINE;

How do you create an index on GTT created from CTAS ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2018
Added on Apr 23 2018
27 comments
4,396 views