????????????????????redo log? RVWR( Recovery Writer)?3s??flashback generate buffer??block before image?????????? ?????block change???RVWR??block before
image ?flashback log?
?????????,Oracle???????????before image????????,????????flashback database logs????? ???????????,?????
??????????????????,???????????before image?????shared pool??flashback log buffer?,RVWR??????flashback log buffer??????????? ?DBWR???????????????,DBWR?????buffer header??FBA(Flashback Byte Address)?flashback log buffer?????????? ???? ?????? ???
????????????? , RVWR???????????(flashback markers)?flashback database logs?? ????(flashback markers)?????????????Oracle??flashback ?????????? ??????????, Oracle ??????(flashback markers)????????????flashback database log???????????block image; ??Oracle ???????(forward recovery)?????????????????SCN??????
flashback markers for example:
**** Record at fba: (lno 1 thr 1 seq 1 bno 4 bof 8184) ****
RECORD HEADER:
Type: 3 (Skip) Size: 8132
RECORD DATA (Skip):
**** Record at fba: (lno 1 thr 1 seq 1 bno 4 bof 52) ****
RECORD HEADER:
Type: 7 (Begin Crash Recovery Record) Size: 36
RECORD DATA (Begin Crash Recovery Record):
Previous logical record fba: (lno 1 thr 1 seq 1 bno 3 bof 316)
Record scn: 0x0000.00000000 [0.0]
**** Record at fba: (lno 1 thr 1 seq 1 bno 3 bof 8184) ****
RECORD HEADER:
Type: 3 (Skip) Size: 7868
RECORD DATA (Skip):
**** Record at fba: (lno 1 thr 1 seq 1 bno 3 bof 316) ****
RECORD HEADER:
Type: 2 (Marker) Size: 300
RECORD DATA (Marker):
Previous logical record fba: (lno 0 thr 0 seq 0 bno 0 bof 0)
Record scn: 0x0000.00000000 [0.0]
Marker scn: 0x0000.0060e024 [0.6348836] 06/13/2012 15:56:35
Flag 0x0
Flashback threads: 1, Enabled redo threads 1
Recovery Start Checkpoint:
scn: 0x0000.0060e024 [0.6348836] 06/13/2012 15:56:12
thread:1 rba:(0x80.180.10)
Flashback thread Markers:
Thread:1 status:0 fba: (lno 1 thr 1 seq 1 bno 2 bof 8184)
Redo Thread Checkpoint Info:
Thread:1 rba:(0x80.180.10)
**** Record at fba: (lno 1 thr 1 seq 1 bno 2 bof 8184) ****
RECORD HEADER:
Type: 3 (Skip) Size: 8168
RECORD DATA (Skip):
End-Of-Thread reached
????????????????block change ????before image????????flashback log?? ?????block change???flashback log record ????????? redo log???!????flashback log ???????before
image ? redo log??? change vector ? Oracle?????????????????????????????????????,??????I/O??????????????:
??hot block??,Oracle???????????block image?????; Oracle ?????????(flashback barriers)???????????????,flashback barriers???????(???15??),??????????(flashback barriers)????(flashback markers)?????????
????, ??????change?????, ???????????????????????????, ?15????????????????????flashback log????????before image?????????????,?????????????????????,?????????????? ????????,??????????????(flashback barriers), flashback barriers???????,?????15????? ?????flashback barriers????????(flashback markers)???????????????,???????????????????(????barriers?????)??????block
image ,?????????????????????????????????
??????????flashback log????redo log????!
????,????????????????, ??????????
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
www.oracledatabase12g.com
SQL> create table flash_maclean (t1 varchar2(200)) tablespace users;
Table created.
SQL> insert into flash_maclean values('MACLEAN LOVE HANNA');
1 row created.
SQL> commit;
Commit complete.
SQL> startup force;
ORACLE instance started.
Total System Global Area 939495424 bytes
Fixed Size 2233960 bytes
Variable Size 713034136 bytes
Database Buffers 218103808 bytes
Redo Buffers 6123520 bytes
Database mounted.
Database opened.
SQL> update flash_maclean set t1='HANNA LOVE MACLEAN';
1 row updated.
commit;
Commit complete.
SQL> alter system checkpoint;
System altered.
SQL> select dbms_rowid.rowid_block_number(rowid),dbms_rowid.rowid_relative_fno(rowid) from flash_maclean;
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)
------------------------------------ ------------------------------------
140431 4
datafile 4 block 140431 ??RDBA rdba: 0x0102248f (4/140431)
SQL> ! ps -ef|grep rvwr|grep -v grep
oracle 26695 1 0 15:56 ? 00:00:00 ora_rvwr_G11R23
SQL> oradebug setospid 26695
Oracle pid: 20, Unix process pid: 26695, image:
[email protected] (RVWR)
SQL> ORADEBUG DUMP FBTAIL 1;
Statement processed.
To dump the last 2000 flashback records , ??ORADEBUG DUMP FBTAIL 1????????2000??????
SQL> oradebug tracefile_name
/s01/orabase/diag/rdbms/g11r23/G11R23/trace/G11R23_rvwr_26695.trc
? TRACE?????????block? before
image
**** Record at fba: (lno 1 thr 1 seq 1 bno 55 bof 2564) ****
RECORD HEADER:
Type: 1 (Block Image) Size: 28
RECORD DATA (Block Image):
file#: 4 rdba: 0x0102248f
Next scn: 0x0000.00000000 [0.0]
Flag: 0x0
Block Size: 8192
BLOCK IMAGE:
buffer rdba: 0x0102248f
scn: 0x0000.00609044 seq: 0x01 flg: 0x06 tail: 0x90440601
frmt: 0x02 chkval: 0xc626 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x00002B1D94183C00 to 0x00002B1D94185C00
2B1D94183C00 0000A206 0102248F 00609044 06010000 [.....$..D.`.....]
2B1D94183C10 0000C626 00000001 00014AD4 0060903A [&........J..:.`.]
2B1D94183C20 00000000 00320002 01022488 00090006 [......2..$......]
2B1D94183C30 00000CC8 00C00340 000D0542 00008000 [
[email protected].......]
2B1D94183C40 006040BC 000F000A 00000920 00C002E4 [.@`..... .......]
2B1D94183C50 0017048F 00002001 00609044 00000000 [..... ..D.`.....]
2B1D94183C60 00000000 00010100 0014FFFF 1F6E1F77 [............w.n.]
2B1D94183C70 00001F6E 1F770001 00000000 00000000 [n.....w.........]
2B1D94183C80 00000000 00000000 00000000 00000000 [................]
Repeat 500 times
2B1D94185BD0 00000000 00000000 2C000000 4D120102 [...........,...M]
2B1D94185BE0 454C4341 4C204E41 2045564F 4E4E4148 [ACLEAN LOVE HANN]
2B1D94185BF0 01002C41 43414D07 4E41454C 90440601 [A,...MACLEAN..D.]
Block header dump: 0x0102248f
Object id on Block? Y
seg/obj: 0x14ad4 csc: 0x00.60903a itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1022488 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0006.009.00000cc8 0x00c00340.0542.0d C--- 0 scn 0x0000.006040bc
0x02 0x000a.00f.00000920 0x00c002e4.048f.17 --U- 1 fsc 0x0000.00609044
bdba: 0x0102248f
data_block_dump,data header at 0x2b1d94183c64
===============
tsiz: 0x1f98
hsiz: 0x14
pbl: 0x2b1d94183c64
76543210
flag=--------
ntab=1
nrow=1
frre=-1
fsbo=0x14
fseo=0x1f77
avsp=0x1f6e
tosp=0x1f6e
0xe:pti[0] nrow=1 offs=0
0x12:pri[0] offs=0x1f77
block_row_dump:
tab 0, row 0, @0x1f77
tl: 22 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [18] 4d 41 43 4c 45 41 4e 20 4c 4f 56 45 20 48 41 4e 4e 41
end_of_block_dump
SQL> select dump('MACLEAN LOVE HANNA',16) from dual;
DUMP('MACLEANLOVEHANNA',16)
--------------------------------------------------------------------
Typ=96 Len=18: 4d,41,43,4c,45,41,4e,20,4c,4f,56,45,20,48,41,4e,4e,41
???????????????????????,??flashback log??before image?????????
create table flash_maclean1 (t1 int) tablespace users;
SQL> select vs.name, ms.value
2 from v$mystat ms, v$sysstat vs
3 where vs.statistic# = ms.statistic#
4 and vs.name in ('redo size','db block changes');
NAME VALUE
---------------------------------------------------------------- ----------
db block changes 0
redo size 0
SQL> select name,value from v$sysstat where name like 'flashback log%';
NAME VALUE
---------------------------------------------------------------- ----------
flashback log writes 49
flashback log write bytes 9306112
SQL> begin
2 for i in 1..5000 loop
3 update flash_maclean1 set t1=t1+1;
4 commit;
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select vs.name, ms.value
2 from v$mystat ms, v$sysstat vs
3 where vs.statistic# = ms.statistic#
4 and vs.name in ('redo size','db block changes');
NAME VALUE
---------------------------------------------------------------- ----------
db block changes 20006
redo size 3071288
SQL> select name,value from v$sysstat where name like 'flashback log%';
NAME VALUE
---------------------------------------------------------------- ----------
flashback log writes 52
flashback log write bytes 10338304
??????????? ??hot block,???20006 ?block changes???? ??? 3000k ?redo log ? ??1000k? flashback log ?