Adjust Oracle Portal permissions
declare
v_dn varchar2(2000);
v_id number;
begin
for i in (select ID, OBJECT_TYPE_NAME, OWNER, NAME,
GRANTEE_GROUP_ID, GRANTEE_USER_ID, GRANTEE_TYPE, PRIVILEGE,CREATED_BY_DBUSER,CREATED_BY_USER from PORTAL.WWSEC_SYS_PRIV$
where GRANTEE_GROUP_ID <> 0
) loop
begin
select dn
into v_dn
from wwsec_group$ where id=i.grantee_group_id;
select max(id)
into v_id
from wwsec_group$ where dn = v_dn;
end;
begin
update PORTAL.WWSEC_SYS_PRIV$
set grantee_group_id = v_id
where id=i.id;
exception when others then
dbms_output.put_line('erro '||i.id);
end;
end loop;
commit;
end;