说明:AWR不在此文范围,这里只说一些思路
一 对free list的思路
从v$session_wait里取p1,p2,关联dba_data_files,以p1=file_id取出DBA地址,再alter system dump file_id,dba取出等待的对象,当然11G里直接取v$session里取row_wait_obj#也可以。
二尽量使用临时表
1 select uername from dba_users where username not in (select grantee from dba_role_privs);
2 drop table temp1
create table temp1 as select distinct grantee from dba_role_privs;
select username from dba_users where username not in (select grantee from temp1);
可以对比下两种写法的效率。