Wednesday, June 13, 2007

Replication and LOB

ISSUE
=====
During conversion test on MYDBQA/QB the SYSTEM tablespace got extended to ~ 5G. Try to understand the reason.


RESEARCH
=========

1. issue following query against MYDBP and MYDBQA

col owner format a14
col segment_name format a27
col table_name format a18
col column_name format a20


select a.owner, a.segment_name, a.bytes/1024/1024 "size (M)",
b.table_name, b.column_name
from dba_segments a, dba_lobs b
where a.tablespace_name='SYSTEM'
and a.segment_type='LOBSEGMENT'
and a.segment_name=b.segment_name
order by 3


system@MYDBQA> /

OWNER SEGMENT_NAME size (M) TABLE_NAME
COLUMN_NAME
--------------- --------------------------- ----------
------------------ --------------------
SYS SYS_LOB0000000270C00002$$ .0234375 KOTTD$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000274C00002$$ .0234375 KOTTB$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000278C00002$$ .0234375 KOTAD$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000282C00002$$ .0234375 KOTMD$
SYS_NC_ROWINFO$
SYSTEM SYS_LOB0000002394C00012$$ .0625 AQ$_QUEUES
SUBSCRIBERS
SYSTEM SYS_LOB0000002590C00002$$ .0625 DEF$_TEMP$LOB
TEMP$CLOB
SYSTEM SYS_LOB0000002590C00003$$ .0625 DEF$_TEMP$LOB
TEMP$NCLOB
SYSTEM SYS_LOB0000002590C00001$$ .0625 DEF$_TEMP$LOB
TEMP$BLOB
SYSTEM SYS_LOB0000002581C00005$$ .0625 DEF$_LOB
NCLOB_COL
SYSTEM SYS_LOB0000002581C00004$$ 2.3125 DEF$_LOB
CLOB_COL
SYSTEM SYS_LOB0000002581C00003$$ 3241 DEF$_LOB
BLOB_COL


system@MYDBP> /

OWNER SEGMENT_NAME size (M) TABLE_NAME
COLUMN_NAME
---------- --------------------------- ---------- ------------------
--------------------
SYS SYS_LOB0000000270C00002$$ .0234375 KOTTD$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000274C00002$$ .0234375 KOTTB$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000278C00002$$ .0234375 KOTAD$
SYS_NC_ROWINFO$
SYS SYS_LOB0000000282C00002$$ .0234375 KOTMD$
SYS_NC_ROWINFO$
SYSTEM SYS_LOB0000002394C00012$$ .0625 AQ$_QUEUES
SUBSCRIBERS
SYSTEM SYS_LOB0000002590C00002$$ .0625 DEF$_TEMP$LOB
TEMP$CLOB
SYSTEM SYS_LOB0000002590C00003$$ .0625 DEF$_TEMP$LOB
TEMP$NCLOB
SYSTEM SYS_LOB0000002590C00001$$ .0625 DEF$_TEMP$LOB
TEMP$BLOB
SYSTEM SYS_LOB0000002581C00005$$ .0625 DEF$_LOB
NCLOB_COL
SYSTEM SYS_LOB0000002581C00004$$ 2.3125 DEF$_LOB
CLOB_COL
SYSTEM SYS_LOB0000002581C00003$$ 640.625 DEF$_LOB
BLOB_COL


Note: the last LOGSEGMENT has size of 3.2G in MYDBQA versus 640 M in MYDBP


CONCLUSIONS
===========
It can be inferred that there are significant DMLs on LOB type columns
during conversion

From Oracle Doc:
=================
( http://www.csee.umbc.edu/help/oracle8/server.815/a67791/ch9.htm#1420 )


DEFLOB View of Storage for RPC

Oracle stores internal LOB parameters to deferred RPCs in a side table that is referenced only by way of a synonym. This gives the you flexibility for storage parameters and the containing schema. The following shows the default storage table for LOB parameters.

CREATE TABLE system.def$_lob(
id RAW(16) CONSTRAINT def$_lob_primary PRIMARY KEY,
deferred_tran_db VARCHAR2(128), -- origin db
deferred_tran_id VARCHAR2(22), -- transaction id
blob_col BLOB,
clob_col CLOB
nclob_col NCLOB)
/
-- make deletes fast
CREATE INDEX system.def$_lob_n1 ON system.def$_lob(
deferred_tran_db,
deferred_tran_id)
/
-- use a synonym in case underlying table is moved
CREATE SYNONYM sys.def$_lob FOR system.def$_lob
/
CREATE OR REPLACE VIEW DefLOB AS SELECT * FROM sys.def$_lob
/
CREATE PUBLIC SYNONYM DefLOB FOR DefLOB
/

No comments: