You are on page 1of 4

PASOS PARA CREAR SNAPSHOT LOG:

1) BASE DIS30 , INSTANCIA QUE SE VA A ACTUALIZAR CON LAS NOVEDADES HACER:

CONNECT DIS30/XXX
CREATE DATABASE LINK TP01 CONNECT TO PREPAGO IDENTIFIED BY XXXXX

2) BASE TP01 , INSTANCIA CON LA TABLA MADRE

CONNECT PREPAGO/XXXX
ALTER USER XXX QUOTA UNLIMITED ON tablespace (privilegio para crear snapshot sobre el
tablespace)
CREATE SNPASHOT LOG ON TABSOSE TABLESPACE DATA1 STORAGE (INITIAL N NEXT N
PCTINCREASE 0 )
GRANT SELECT, UPDATE,DELETE ON MLOG$_TABSOSE TO DIS30
Recomendado:Set PCTFREE to 20 and PCTUSED to 80.
By default, Oracle creates a snapshot log to support primary key snapshots. Therefore, the master table
must contain a valid PRIMARY KEY constraint before you can create a snapshot log.

Name Null? Type


------------------------------- -------- ----
NUM_SOSE CHAR(10)-PK
SNAPTIME$$ DATE
DMLTYPE$$ VARCHAR2(1)
OLD_NEW$$ VARCHAR2(1)
CHANGE_VECTOR$$ RAW(255)

Si no existe primary key , realizarlo por Rowid = 6Bytes.

3) EN LA INSTANCIA DIS30

CONNECT DIS30/XXXX
CREATE SNAPSHOT "DIS30".snap_tabsose
TABLESPACE "DATA03"
PCTFREE 20 INITRANS 2 MAXTRANS 255
STORAGE ( INITIAL 50M NEXT 2M MINEXTENTS 1 MAXEXTENTS UNLIMITED
PCTINCREASE 0)
REFRESH FAST NEXT trunc(sysdate+1,'DD')+21/24
USING LOCAL ROLLBACK SEGMENT R5
WITH PRIMARY KEY
AS select num_sose, num_cuen,num_line,cod_esta,fec_sose,fec_acti,fec_tser,cod_pl
an,cod_orig,cod_promo
from prepago.tabsose@tp01;

CREATE INDEX NUMLIN_IDX ON SNAP$_SNAP_TABSOSE (NUM_LINE)


TABLESPACE INDEX03
PCTFREE 10
STORAGE (INITIAL 5242880 NEXT 10469376 PCTINCREASE 0);
COMMIT;

Espacio ocupados:

Tabla tabblisact

#reg: 98680

SQL> select initial_extent,next_extent,extents,bytes/1024/1024 Mb,max_extents,


2 owner
3 from dba_segments
4 where segment_name='TABBLISACT';

#reg: 486099

INITIAL_EXTENT NEXT_EXTENT EXTENTS MB MAX_EXTENTS


-------------- ----------- ---------- ---------- -----------
OWNER
------------------------------
32768 3440640 13 6.734375 121
DIS30

Snapshop Log :

SQL> select initial_extent,next_extent,extents,bytes/1024/1024 Mb,max_extents,


2 owner
3 from dba_segments
4 where segment_name='MLOG$_TABBLISACT';

INITIAL_EXTENT NEXT_EXTENT EXTENTS MB MAX_EXTENTS


-------------- ----------- ---------- ---------- -----------
OWNER
------------------------------
3145728 5242880 140 46.484375 2147483645
DIS30

#REG: 98378
SQL> select initial_extent,next_extent,extents,bytes/1024/1024 Mb,max_extents
2 ,owner
3 from dba_segments
4 where segment_name='SNAP$_SNAP_TABBLISACT';

INITIAL_EXTENT NEXT_EXTENT EXTENTS MB MAX_EXTENTS


-------------- ----------- ---------- ---------- -----------
OWNER
------------------------------
4194304 311296 6 5.625 2147483645
DIS30

TABSOSE: tiene #reg 646661

SQL> select initial_extent,next_extent,extents,bytes/1024/1024 Mb,max_extents


2 owner
3 from dba_segments
4 where segment_name='TABSOSE';

INITIAL_EXTENT NEXT_EXTENT EXTENTS MB OWNER


-------------- ----------- ---------- ---------- ----------
81920 83886080 15 113.4375 1017

#reg : 5038

SQL> select initial_extent,next_extent,extents,bytes/1024/1024 Mb,max_extents


2 owner
3 from dba_segments
4 where segment_name='MLOG$_TABSOSE';

INITIAL_EXTENT NEXT_EXTENT EXTENTS MB OWNER


-------------- ----------- ---------- ---------- ----------
5242880 5242880 1 5 121

#REG: 645599
INITIAL_EXTENT NEXT_EXTENT EXTENTS MB MAX_EXTENTS
-------------- ----------- ---------- ---------- -----------
OWNER
------------------------------
52428800 2097152 7 62.1875 2147483645
DIS30

Dat Description Column Length and Default


atyp
e
CHA Fixed-length character data of length size bytes. Fixed for every row in the table (with trailing blanks);
R maximum size is 2000 bytes per row, default size is 1
(size) byte per row. Consider the character set (one-byte or
multibyte) before setting size.
VAR Variable-length character data. A maximum Variable for each row, up to 4000 bytes per row. Consider
CHA size must be specified. the character set (one-byte or multibyte) before setting
R2 size.
(size)
NCH Fixed-length character data of length size Fixed for every row in the table (with trailing blanks).
AR(si characters or bytes, depending on the national Column size is the number of characters for a fixed-
ze) character set. width national character set or the number of bytes for a
varying-width national character set. Maximum size is
determined by the number of bytes required to store one
character, with an upper limit of 2000 bytes per row.
Default is 1 character or 1 byte, depending on the
character set.
NVA Variable-length character data of length size Variable for each row. Column size is the number of
RCH characters or bytes, depending on national characters for a fixed-width national character set or the
AR2 character set. A maximum size must be number of bytes for a varying-width national character
(size) specified. set. Maximum size is determined by the number of bytes
required to store one character, with an upper limit of
4000 bytes per row. Default is 1 character or 1 byte,
depending on the character set.
LON Variable-length character data. Variable for each row in the table, up to 2^31 - 1 bytes,
G or 2 gigabytes, per row.
NUM Variable-length numeric data. Maximum Variable for each row. The maximum space required for
BER precision p and/or scale s is 38. a given column is 21 bytes per row.
(p, s)
DAT Fixed-length date and time data, ranging from Fixed at 7 bytes for each row in the table. Default format
E January 1, 4712 BCE to December 31, 4712 CE is a string (such as DD-MON-YY) specified by
("A.D.") NLS_DATE_FORMAT parameter.
RAW Variable-length raw binary data. A maximum Variable for each row in the table, up to 2000 bytes per
(size) size must be specified. row.
LON Variable-length raw binary data. Variable for each row in the table, up to 2^31 - 1 bytes,
G or 2 gigabytes, per row.
RAW
BLO Binary data. Up to 2^32 - 1 bytes, or 4 gigabytes.
B
CLO Single-byte character data. Up to 2^32 - 1 bytes, or 4 gigabytes.
B
NCL Single-byte or fixed-length multibyte national Up to 2^32 - 1 bytes, or 4 gigabytes.
OB character set (NCHAR) data.
BFIL Binary data stored in an external file. Up to 2^32 - 1 bytes, or 4 gigabytes.
E
ROW Binary data representing row addresses. Fixed at 10 bytes (extended ROWID) or 6 bytes
ID (restricted ROWID) for each row in the table.
MLS Trusted Oracle datatype. See your Trusted Oracle documentation.
LAB
EL