The CDB and all pluggable databases (PDBs) share a single database instance composed of the system global area (SGA) and background processes. Because of this sharing of memory resources, it would be desirable to distinguish resource usage among databases sharing the instance. You can use the below script to get it.
SQL> alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> --Date/time of script run
SQL> select sysdate from dual;
SYSDATE
--------------------
11-MAY-2015 12:53:22
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> show con_id
CON_ID
------------------------------
1
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
--------------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
4 PDB2 READ WRITE NO
SQL> --Information About Each Container
SQL> SELECT NAME, CON_ID, OPEN_MODE, RESTRICTED, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;
NAME CON_ID OPEN_MODE RES DBID CON_UID GUID
---------------------- ------ ---------- --- --------------- --------------- --------------------------------
CDB$ROOT 1 READ WRITE NO 1407114582 1 01685D864667499897328284C5680FFA PDB$SEED 2 READ ONLY NO 3047944900 3047944900 DFE989B5D4F4465399522D1DA1BDEBA6
PDBORCL 3 READ WRITE NO 2438717020 2438717020 34E3E0C1A04F4BF197BF9BADFEAE5B25
PDB2 4 READ WRITE NO 1936897034 1936897034 0F9F379EEC1546CAAB35A5F2DFC3D3FF
SQL> --list only large memory allocations over 10M
SQL> compute sum of Mbytes on con_id
SQL> break on con_id skip 4
SQL> select con_id, pool, name, ROUND(bytes/1024/1024,1) as Mbytes from v$sgastat
2 where bytes/1024/1024 > 10 --alter to see smaller/larger allocations
3 order by con_id;
CON_ID POOL NAME Mbytes
------ ------------ ---------------------- ------------
0 buffer_cache 1,440
log_buffer 13
shared_io_pool 96
shared pool free memory 143
large pool free memory 16
java pool free memory 16
****** ------------
sum 1,724
1 shared pool db_block_hash_buckets 11
shared pool XDBSC 14
large pool PX msg pool 15
shared pool SQLA 11
****** ------------
sum 52
10 rows selected.SQL> break on off
No comments:
Post a Comment