Reputation: 15
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
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.
Upvotes: 2