[ORACLE] DUMP the redo log, undo and table sections, and redoundo

Source: Internet
Author: User

[ORACLE] DUMP the redo log, undo and table sections, and redoundo
1.1 Use oradebug

-- Start the task

Oradebug setmypid

-- Set the dump file name

Alter session set tracefile_identifier = undo

-- View the dump file

SQL> oradebug tracefile_name;

C: \ opt \ oracle \ product \ 10.2.0 \ admin \ rundb \ udump \ rundb_ora_6660_pra1.trc

-- Set permissions

Oradebug unlimit

-- View the dump list:

SQL> oradebug dumplist

EVENTS

TRACE_BUFFER_ON

TRACE_BUFFER_OFF

-- Oradebug dump command

(1) oradebug dump buffers 1

Dump buffer information: 1 = buffer header only

1.2 use alter system dump redo logs

-- Dump redo log

Alter system dump logfile 'C: \ OPT \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ RUNDB \ REDO02.LOG ';

1.3 Use alter system dump table data blocks

-- View the location of the scott. stu table:

Select HEADER_FILE, HEADER_BLOCK, BYTES, BLOCKS, INITIAL_EXTENT, EXTENTS, NEXT_EXTENT from dba_segme

CNT where segment_type = 'table' and owner = 'Scott 'and segment_name = 'stu ';

 

HEADER_FILE HEADER_BLOCK bytes blocks INITIAL_EXTENT EXTENTS

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

NEXT_EXTENT

-----------

4 203 65536 8 65536 1

// Scott. stu is located in datafile 4 block 203, which occupies a total of 8 blocks and is in an exntents continuous space.

-- Dump header information

Alter system dump datafile 4 block 203;

-- Dump all data blocks (8) of all tables

Alter system dump datafile 4 block min 203 block max 210;

1.4 Use alter system dump undo segment information and undo record information 1.4.1 dump undo segment header information

--- View undo segments_name

SQL> select segment_name from dba_segments where segment_type = 'type2 UNDO ';

 

SEGMENT_NAME

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

_ SYSSMU1 $

_ SYSSMU2 $

_ SYSSMU3 $

_ SYSSMU4 $

.....

Or SQL> select segment_id, segment_name, block_id, status from dba_rollback_segs;

SEGMENT_ID SEGMENT_NAME BLOCK_ID STATUS

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

0 SYSTEM 9 ONLINE

1 _ SYSSMU1 $9 ONLINE

2 _ SYSSMU2 $25 ONLINE

......

 

---- Dump undo Header

SQL> alter system dump undo header '_ SYSSMU1 $ ';

1.4.2 undo Record Based on xid dump

-- Query xid: undo field number, slot number, and wrap Value

SQL> select trunc (id1/65536) usn, mod (id1, 65536) slot, id2 wrap, lmode from v $ lock where type = 'tx ';

 

USN SLOT WRAP LMODE

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

2 43 313 6

 

-- Dump unod record

Alter system dump undo Block' _ SYSSMU2 $ 'xid 2 43 313

1.5 dump information of a data block in the stu segment table (segment)

-- Data block information:

Buffer tsn: 4 rdba: 0x00000cc (4/204)

Itl Xid Uba Flag Lck Scn/Fsc

0x01 0x0006. 012.0000013b 0x00800127. 011a. 01 -- U-1 fsc 0x0000. 000c44bc

0x02 0x0000. 000.00000000 0x00000000. 0000.00 ---- 0 fsc 0x0000.00000000

Block_row_dump:

Tab 0, row 0, @ 0x1f85

Tl: 19 fb: -- H-FL -- lb: 0x1 cc: 4

Col 0: [2] c1 06

Col 1: [3] c2 15 09

Col 2: [5] 73 6d 69 74 68

Col 3: [2] c1 1a

End_of_block_dump

 

// Itl transaction list index. This value is used for row lock byte: lb: displays the transaction lock.

// Xid: the transaction ID in undo,

// Uba: The undo record address generated by the transaction

// Flag: the transaction status. -- U-upper limit commit; c ------ submit clearly;

Lck: the number of lines locked by the transaction in the block.

 

 

_________________________________________________________________________________

Http://blog.csdn.net/clark_xu Xu changliang column original

__________________________________________________________________________________

 

Related Article

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.