Monday, 20 July 2015

flushing shared pool and sessions querry

shared pool
select * from ( select POOL, NAME, BYTES, BYTES/1048576 as MBytes from v$sgastat where pool='shared pool' order by BYTES desc ) where rownum <= 25;
alter system flush shared_pool;

sessions querry:

select SID, USERNAME, SQL_ADDRESS, MACHINE, PROGRAM, MODULE from v$session where STATUS='INACTIVE';

select SID, USERNAME, SQL_ADDRESS, MACHINE, PROGRAM, STATUS from v$session

select SID, SERIAL# from v$session where STATUS='INACTIVE'AND USERNAME='NIKU_BO';
alter system kill session 'sid,serial#';

ORA-00230: operation disallowed: snapshot control file enqueue unavailable

SELECT s.sid, username AS "User", program, module, action, logon_time "Logon", l.*
FROM v$session s, v$enqueue_lock l
WHERE l.sid = s.sid and l.type = 'CF' AND l.id1 = 0 and l.id2 = 2;

retreive password for users:
select 'alter user '||name||' identified by values '''||password||''';' from user$ where spare4 is null and password is not null
union
select 'alter user '||name||' identified by values '''||spare4||';'||password||''';' from user$ where spare4 is not null and password is not null;

Schema sizes:

select owner,sum(bytes/1024/1024)MB from dba_segments group by owner;

select
   dbms_metadata.get_ddl('USER', username) || '/' usercreate
from
   dba_users
where
   username like '%SITEADMIN%';
select password,spare4 from user$ where name like '%SITEADMIN%';


No comments:

Post a Comment