Prakhar Agrawal
Prakhar Agrawal

Reputation: 15

ORA-01031: insufficient privileges while using online in create index

in below procedure when I am using online then during execution this is giving error "ORA-01031: insufficient privilege" while running without online it is running fine.

CREATE OR REPLACE procedure p_temp_1 is
begin
execute immediate 'CREATE INDEX pp_temp1  ON p_temp  (access_no) online ';
end;

which privileges i need to give ?

Upvotes: 0

Views: 1971

Answers (1)

vvg
vvg

Reputation: 6385

Checked for the privilege and the user was granted “CREATE TABLE” but from within RESOURCE role.Stored PL/SQL requires a direct grant and therefore the procedure fails with ‘insufficient privileges’. So granted ‘CREATE TABLE’ system privilege directly to the user, after which the index got created.

From here

Upvotes: 2

Related Questions