查看: 108|回复: 1

作业二、描述在IMU下Redo log产生的过程(实验步骤)

[复制链接]
论坛徽章:
1
Oracle研习者高级
日期:2019-07-25 14:10:03
发表于 2019-6-13 15:12 | 显示全部楼层 |阅读模式

SQL RAC DBA

SQL> alter system set "_in_memory_undo"=true scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>startup

SQL> @?/rdbms/admin/show_parameter.sql
Enter value for p: in_memory_undo
old  11: and upper(i.ksppinm) like upper('%&p%')
new  11: and upper(i.ksppinm) like upper('%in_memory_undo%')

P_NAME           P_VALUE      ISDEFAULT ISMODIFIED ISADJ P_DESCRIPTION
---------------------------------------- ------------------------------ --------- ---------- ----- --------------------------------------------------
_in_memory_undo        TRUE       FALSE   FALSE      FALSE Make in memory undo for top level transactions

SQL> drop table hdb.t1;

Table dropped.

SQL> create table hdb.t1 (id int,name varchar2(10));

Table created.

insert into hdb.t1 values(1,'AAAAA');
insert into hdb.t1 values(2,'BBBBB');

1 row created.

SQL>
1 row created.

SQL> commit;

Commit complete.

SQL> select GROUP#,status,members from v$log;

    GROUP# STATUS               MEMBERS
---------- ---------------- ----------
         1 INACTIVE                     1
         2 INACTIVE                     1
         3 CURRENT                     1

SQL> alter system switch logfile;

System altered.

SQL> select GROUP#,status,members from v$log;

    GROUP# STATUS               MEMBERS
---------- ---------------- ----------
         1 CURRENT                     1
         2 INACTIVE                     1
         3 ACTIVE                     1

update hdb.t1 set name='aaaaa' where name='AAAAA';

1 row updated.

SQL> update hdb.t1 set name='bbbbb' where name='BBBBB';

1 row updated.

SQL> commit;

Commit complete.

SQL> alter system dump logfile '/u01/app/oracle/oradata/orcl/redo01.log';

System altered.

SQL> select tracefile from v$process where addr in (select paddr from v$session where sid in (select sid from v$mystat));

TRACEFILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_20364.trc


-- 一个redo record
--CHANGE #1  OP:11.19 更新数据 col  1: [ 5]  61 61 61 61 61
--CHANGE #2  OP:5.2   在undo中申请事务表信息等
--CHANGE #3  OP:11.19 更新数据 col  1: [ 5]  62 62 62 62 62
--CHANGE #4  OP:5.4   提交事务
--CHANGE #5  OP:5.1   将原来的数据copy到undo中 col  1: [ 5]  41 41 41 41 41
--CHANGE #6  OP:5.1   将原来的数据copy到undo中 col  1: [ 5]  42 42 42 42 42
REDO RECORD - Thread:1 RBA: 0x000025.00000002.0010 LEN: 0x0374 VLD: 0x0d
SCN: 0x0000.001681c8 SUBSCN:  1 06/13/2019 14:29:16
(LWN RBA: 0x000025.00000002.0010 LEN: 0002 NST: 0001 SCN: 0x0000.001681c7)
CHANGE #1 TYP:2 CLS:1 AFN:4 DBA:0x0101621f OBJ:91145 SCN:0x0000.001681a8 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x11  ver: 0x01  
compat bit: 4 (post-11) padding: 1
op: F  xid:  0x0006.00b.00000539    uba: 0x00c0015d.0147.2e
Block cleanout record, scn:  0x0000.001681c4 ver: 0x01 opt: 0x02, entries follow...
  itli: 1  flg: 2  scn: 0x0000.001681a8
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 2 ckix: 12
ncol: 2 nnew: 1 size: 0
KDO Op code:  21 row dependencies Disabled
  xtype: XAxtype KDO_KDOM2 flags: 0x00000080  bdba: 0x0101621f  hdba: 0x0101621a
itli: 2  ispac: 0  maxfr: 4858
vect = 3
col  1: [ 5]  61 61 61 61 61
CHANGE #2 TYP:0 CLS:27 AFN:3 DBA:0x00c000d0 OBJ:4294967295 SCN:0x0000.001680bc SEQ:1 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x000b sqn: 0x00000539 flg: 0x0012 siz: 168 fbi: 0
            uba: 0x00c0015d.0147.2e    pxid:  0x0000.000.00000000
CHANGE #3 TYP:0 CLS:1 AFN:4 DBA:0x0101621f OBJ:91145 SCN:0x0000.001681c8 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x02  ver: 0x01  
compat bit: 4 (post-11) padding: 1
op: C  uba: 0x00c0015d.0147.2f
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 2 ckix: 12
ncol: 2 nnew: 1 size: 0
KDO Op code:  21 row dependencies Disabled
  xtype: XAxtype KDO_KDOM2 flags: 0x00000080  bdba: 0x0101621f  hdba: 0x0101621a
itli: 2  ispac: 0  maxfr: 4858
vect = 3
col  1: [ 5]  62 62 62 62 62
CHANGE #4 TYP:0 CLS:27 AFN:3 DBA:0x00c000d0 OBJ:4294967295 SCN:0x0000.001681c8 SEQ:1 OP:5.4 ENC:0 RBL:0
ktucm redo: slt: 0x000b sqn: 0x00000539 srt: 0 sta: 9 flg: 0x2 ktucf redo: uba: 0x00c0015d.0147.2f ext: 4 spc: 2576 fbi: 0
CHANGE #5 TYP:0 CLS:28 AFN:3 DBA:0x00c0015d OBJ:4294967295 SCN:0x0000.001680bb SEQ:2 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 168 spc: 2872 flg: 0x0012 seq: 0x0147 rec: 0x2e
            xid:  0x0006.00b.00000539  
ktubl redo: slt: 11 rci: 0 opc: 11.1 [objn: 91145 objd: 91145 tsn: 4]
Undo type:  Regular undo        Begin trans    Last buffer split:  No
Temp Object:  No
Tablespace Undo:  No
             0x00000000  prev ctl uba: 0x00c0015d.0147.2c
prev ctl max cmt scn:  0x0000.00167c9b  prev tx cmt scn:  0x0000.00167ca6
txn start scn:  0x0000.00000000  logon user: 0  prev brb: 12583260  prev bcl: 0 BuExt idx: 0 flg2: 0
KDO undo record:
KTB Redo
op: 0x03  ver: 0x01  
compat bit: 4 (post-11) padding: 1
op: Z
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 12
ncol: 2 nnew: 1 size: 0
KDO Op code:  21 row dependencies Disabled
  xtype: XAxtype KDO_KDOM2 flags: 0x00000080  bdba: 0x0101621f  hdba: 0x0101621a
itli: 2  ispac: 0  maxfr: 4858
vect = 3
col  1: [ 5]  41 41 41 41 41
CHANGE #6 TYP:0 CLS:28 AFN:3 DBA:0x00c0015d OBJ:4294967295 SCN:0x0000.001681c8 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 124 spc: 2702 flg: 0x0022 seq: 0x0147 rec: 0x2f
            xid:  0x0006.00b.00000539  
ktubu redo: slt: 11 rci: 46 opc: 11.1 objn: 91145 objd: 91145 tsn: 4
Undo type:  Regular undo       Undo type:  Last buffer split:  No
Tablespace Undo:  No
             0x00000000
KDO undo record:
KTB Redo
op: 0x02  ver: 0x01  
compat bit: 4 (post-11) padding: 1
op: C  uba: 0x00c0015d.0147.2e
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 0 ckix: 12
ncol: 2 nnew: 1 size: 0
KDO Op code:  21 row dependencies Disabled
  xtype: XAxtype KDO_KDOM2 flags: 0x00000080  bdba: 0x0101621f  hdba: 0x0101621a
itli: 2  ispac: 0  maxfr: 4858
vect = 3
col  1: [ 5]  42 42 42 42 42

回复

使用道具 举报

论坛徽章:
6
kettle徽章
日期:2015-08-06 17:02:17数据陷阱解读徽章
日期:2015-08-13 15:21:46投资理财徽章
日期:2015-11-12 14:25:33R研习者中级
日期:2015-12-17 11:38:03投资理财徽章
日期:2015-12-24 15:51:21Oracle研习者高级
日期:2019-07-25 14:10:03
发表于 2019-6-16 20:39 | 显示全部楼层
谢谢楼主的分享,按照你的步骤,我顺利完成。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

 

GMT+8, 2019-9-20 11:49 , Processed in 0.128781 second(s), 31 queries .

关闭

扫一扫加入
本版微信群