select 'create user ' || a.username || ' identified by "' ||
(select password from sys.user$ b where a.username = b.name) || '" ' ||
chr(10) || ' default tablespace ' || a.default_tablespace ||
chr(10) || ' temporary tablespace ' || a.temporary_tablespace ||
chr(10) || ' profile ' || a.profile || ';'
from dba_users a
union all
select 'grant unlimited tablespace to ' || a.username || ';'
from dba_users a ;
(select password from sys.user$ b where a.username = b.name) || '" ' ||
chr(10) || ' default tablespace ' || a.default_tablespace ||
chr(10) || ' temporary tablespace ' || a.temporary_tablespace ||
chr(10) || ' profile ' || a.profile || ';'
from dba_users a
union all
select 'grant unlimited tablespace to ' || a.username || ';'
from dba_users a ;
select ' grant ' || t.privilege || ' on ' || owner || '.' || table_name ||
' to ' || grantee || case
when grantable = 'YES' then
' with grant option;'
else
';'
end
from dba_tab_privs t
where grantee = 'DMCARR';
' to ' || grantee || case
when grantable = 'YES' then
' with grant option;'
else
';'
end
from dba_tab_privs t
where grantee = 'DMCARR';
SELECT 'grant ' || granted_role || ' to ' || grantee || case
when admin_option = 'YES' THEN
'with admin option;'
ELSE
';'
end,
default_role
FROM DBA_ROLE_PRIVS
WHERE GRANTEE = 'DMCARR'
order by default_role;
select 'grant ' || privilege || ' to ' || grantee || case
when admin_option = 'YES' THEN
'with admin option;'
ELSE
';'
end
from dba_sys_privs
where grantee = 'DMCARR';
when admin_option = 'YES' THEN
'with admin option;'
ELSE
';'
end
from dba_sys_privs
where grantee = 'DMCARR';
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-754483/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/35489/viewspace-754483/
828

被折叠的 条评论
为什么被折叠?



