user_taşıma


Declare
Mystr varchar2(250);
begin
for i in
(
select username,'create user '||username||' identified by values '''||password||''' default tablespace '||default_tablespace||' temporary tablespace '||temporary_tablespace as mystr from
(
select * from dba_users@postpaid where account_status='OPEN' and username in (select username from users@postpaid)
minus
select * from dba_users
)
)
loop
dbms_output.put_line(i.mystr||';');
--execute immediate i.mystr;
for j in (select 'GRANT '||granted_role||' TO '||i.username as mystr2 from dba_role_privs where grantee = i.username)
loop
dbms_output.put_line(j.mystr2||';');
--execute immediate j.mystr2;
end loop;
mystr:='ALTER USER '||i.username||' DEFAULT ROLE ALL';
--execute immediate mystr;
dbms_output.put_line(mystr||';');
end loop;
end;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: