I created manually and granted manually the DBA role to an user named pta. Then I connected to pta. I created a stored procedure in the pta schema :
create or replace procedure create_user(login varchar2)
is
begin
execute immediate 'create user ' || login || ' identified by 1';
end;
/
When I executed the stored procedure :
SQL> execute create_user('xxx');
then I got ORA-01031: insufficient privileges
Although when I wrote
SQL> create user xxx identified by 1;
then the user is created successfully.
So what is wrong ?