如下代码在存储过程中执行时报错误:ORA-01031: insufficient privileges
create or replace procedure DBA_REBUILD_INDEX
As
Begin
execute immediate 'alter index PK_DUBAI_STORAGE_OUT_MANIFEST rebuild online';
execute immediate 'alter index WATERGAUGE_PK rebuild online';
Return;
end DBA_REBUILD_INDEX;
查找资料后发现,在存储过程中添加如下内容即可:Authid Current_User,修改后的存储过程结构如下
create or replace procedure DBA_REBUILD_INDEX Authid Current_User
As
Begin
execute immediate 'alter index PK_DUBAI_STORAGE_OUT_MANIFEST rebuild online';
execute immediate 'alter index WATERGAUGE_PK rebuild online';
Return;
end DBA_REBUILD_INDEX;
posted on 2015-12-10 09:12
Glorin 阅读(716)
评论(0) 编辑 收藏