Thursday 21 June 2018

PDB Tips

List pdbs show pdbs select * from v$pdbs; # All PDB (inc. size) col name for a30 select name, open_mode, total_size/1024/1024 as size_mb from v$pdbs where name like '%'; PDB sessions, pdb connections, pdb sess col name for a20 col username for a32 col machine for a20 select s.inst_id, p.name, s.username, s.machine, count(*) as "SESSION COUNT" from gv$session s, gv$pdbs p where p.con_id = s.con_id and s.inst_id = p.inst_id group by s.inst_id, p.name, s.username, s.machine order by p.name, s.machine; -- List only STG_BIZ_X select s.inst_id, p.name, s.username, s.machine, s.sid, s.serial#, s.status from gv$session s, gv$pdbs p where p.con_id = s.con_id and s.inst_id = p.inst_id and p.name = 'STG_BIZ_X'; INST_ID NAME USERNAME MACHINE SID SERIAL# STATUS ------- ------------- ------------- ------------ --------- ------- -------- 1 STG_BIZ_X SYS ukdevdb017 442 28213 ACTIVE 1 STG_BIZ_X C##JPTADMIN ukdevdb602 777 56244 KILLED 2 STG_BIZ_X C##JPTADMIN ukdevdb601 66 64486 KILLED 2 STG_BIZ_X SYS ukdevdb017 1959 13580 ACTIVE 2 STG_BIZ_X C##JPTADMIN ukdevdb602 1961 46827 KILLED

No comments: