How to use dump blocks vs. bbed to view the SCN when the block contrasts database modifications

Source: Internet
Author: User
Tags commit hash first row

Experimental ideas:

The first row of the BYS.A table is updated in the database to find the corresponding file# block#

Then dump this file# block# and view the SCN information

Use bbed dump this file# block# to view SCN information

1. Update a row of the BYS.A table in the database to record the rowid of the row.

19:55:13 bys@ Bys3>select * from A;

B

----------

55

7

3

19:55:15 bys@ bys3>update A set b=0 where b=7;

1 row updated.

19:55:38 bys@ bys3>commit;

Commit complete.

19:55:40 bys@ Bys3>select rowid,b from A; The time of---commit is 19:55:40

ROWID B

------------------ ----------

AAAFOZAAEAAAACSAAA 55

AAAFOZAAEAAAACZAAA 0

AAAFOZAAEAAAACBAAA 3

19:57:15 bys@ Bys3>col object_name for A10

20:01:04 bys@ bys3>select a.rowid,a.object_id,a.file_id,a.block_id,a.row_id,b.object_name,b from (select rowID, Dbms_rowid.rowid_object (ROWID) object_id,dbms_rowid.rowid_relative_fno (ROWID) file_id,dbms_rowid.rowid_block_ Number (ROWID) block_id,dbms_rowid.rowid_row_number (ROWID) row_id,b from BYS.A) a,dba_objects B where a.object_id=                     b.object_id; ---If you use this statement, you only need to modify the name of the table that is marked red, and the field name.

ROWID object_id file_id block_id row_id Object_nam B

------------------ ---------- ---------- ---------- ---------- ---------- ----------

AAAFOZAAEAAAACBAAA 21427 4 0 A 3

AAAFOZAAEAAAACZAAA 21427 4 153 0 A 0

AAAFOZAAEAAAACSAAA 21427 4 146 0 A 55

Through the above statement can query out update a set b=0 where b=7; Modify the block of data is: file#4,block#153

###################################################################

2. Use dump file#4,block#153 data blocks to view this block of related information---primarily the SCN at the time of modification

20:01:36 bys@ bys3>alter System dump datafile 4 block 153;

System altered.

There are three ways to view the trace file location:

Select value from V$diag_info where name like ' default% ';

sys user execution:oradebug setmypid; Oradebug Tracefile_name

Or use Ls-alt directly in the User_dump_dest directory to find recently generated files

20:05:32 bys@ bys3>col name for A10

20:05:40 bys@ bys3>col value for A50

20:05:49 bys@ Bys3>select * from V$diag_info where name like ' default% ';

inst_id NAME VALUE

---------- ---------- --------------------------------------------------

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/storage/

1 Default tr/u01/app/oracle/product/11.2.0/dbhome_1/log/diag/r

Ace File DBMS/BYS3/BYS3/TRACE/BYS3_ORA_17341.TRC

The SCN is: scn:0x0000.00197b75---See the following trace file details from the dump information

Convert to SCN for:

20:19:17 bys@ bys3>select to_number (' 197b75 ', ' xxxxxxxxx ') from dual;

To_number (' 197b75 ', ' xxxxxxxxx ')

-------------------------------

1670005

20:19:38 bys@ bys3>select Scn_to_timestamp (1670005) from dual; -Convert the SCN to time to verify that the SCN matches the UPDATE statement submission.

Scn_to_timestamp (1670005)

---------------------------------------------------------------------------

29-NOV-13 07.55.39.000000000 PM

View the details in bys3_ora_17341.trc as follows: = = = Intercept Block block information:

Start dump data blocks Tsn:4 file#:4 minblk 153 maxblk 153

Block dump from cache:

Dump of buffer cache at level 4 for tsn=4 rdba=16777369

BH (0X22BFAD14) file#: 4 rdba:0x01000099 (4/153) class:1 ba:0x22b9e000

Set:3 pool:3 bsz:8192 bsi:0 sflg:1 pwc:0,0

dbwrid:0 obj:21427 objn:21427 Tsn:4 afn:4 hint:f

Hash: [0X22BFBA7C,0X2879BDD8] LRU: [0X22BFAEA4,0X22BFAC10]

CKPTQ: [NULL] FILEQ: [null] OBJQ: [0x22bfaebc,0x25040784] Objaq: [0x22bfbba8,0x22bfb9f0]

St:xcurrent md:null fpin: ' Kdswh01:kdstgr ' tch:6

Flags:block_written_once Redo_since_read

Lrba: [0x0.0.0] LSCN: [0x0.0] HSCN: [0XFFFF.FFFFFFFF] Hsub: [1]

BH (0X22BFB9F8) file#: 4 rdba:0x01000099 (4/153) class:1 ba:0x22bbc000

Set:3 pool:3 bsz:8192 bsi:0 sflg:1 pwc:0,0

dbwrid:0 obj:21427 objn:21427 Tsn:4 afn:4 hint:f

Hash: [0x2879bdd8,0x22bfad98] LRU: [0X22BFACEC,0X217E4BB8]

Lru-flags:hot_buffer

CKPTQ: [NULL] FILEQ: [null] OBJQ: [null] OBJAQ: [NULL]

ST:CR md:null fpin: ' Kdswh01:kdstgr ' tch:0

CR: [SCN:0X0.197B72],[XID:0X0.0.0],[UBA:0X0.0.0],[CLS:0X0.197B72],[SFL:0X0],[LC:0X0.14DA6C]

Flags:only_sequential_access

Block dump from disk:

Buffer Tsn:4 rdba:0x01000099 (4/153)

Scn:0x0000.00197b75 seq:0x02 flg:0x06 tail:0x7b750602

frmt:0x02 chkval:0xe52c Type:0x06=trans Data

Hex dump of Block:st=0, typ_found=1

Dump of memory from 0xb6c41600 to 0xb6c43600

######################################################### #3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.