欢迎关注微信公众号 jiekexu dba 之路
2 / 21
col account_status for a18
select username,account_status,created,profile,default_tablespace from dba_users
where account_status='open' and default_tablespace not in ('system','users','ogg_tbs')
order by created asc;
username account_status created profile
default_tablespace
------------------------------------------------------------------------ ------------------------------
test_py open 25-nov-20 default
test_py_data
dba_bak open 08-jun-22 default
dba_bak_data
select username,account_status,created,profile,default_tablespace from dba_users
where account_status='open' and default_tablespace!='users' order by created asc;
用户权限收集
drop table scott.t_tmp_user_jieke;
create table scott.t_tmp_user_jieke( id number, username varchar2(50), exec_sql varchar2(4000),create_type
varchar2(20) );
drop sequence scott.s_t_tmp_user_jieke;
create sequence scott.s_t_tmp_user_jieke;
begin
for cur in (select d.username,
d.default_tablespace,
d.account_status,
'create user ' || d.username || ' identified by ' ||
d.username || ' default tablespace ' ||
d.default_tablespace || ' temporary tablespace ' ||
d.temporary_tablespace || ';' create_user,
replace(to_char(dbms_metadata.get_ddl('user',d.username)),chr(10),'') create_user1
from dba_users d
--where d.username not in
('anonymous','apex_030200','apex_public_user','appqossys','bi','ctxsys','dbsnmp','dip','dmsys','dvsys','exfsys','flows_files',
文档被以下合辑收录
评论