ALTER SYSTEM
{ DUMP DATAFILE file_id PAGE page_id
| SWITCH LOGFILE
| SET parameter_name = parameter_value [ SCOPE = { MEMORY | PFILE | BOTH } ]
| LOAD DICTIONARY FOR [ schema_name.]object_name
| INIT DICTIONARY
| RELOAD HBA CONFIG
| REFRESH SYSDBA PRIVILEGE
| KILL SESSION ‘session_id,serial’
| RESET STATISTIC
| CHECKPOINT
| { ADD | DELETE } LSNR_ADDR LISTENING_IP
| ADD HBA ENTRY hba_conf_entry
| FLUSH {BUFFER | SQLPOOL}
| DUMP ctrlfile
}
复制
+++ dump 数据文件头
SQL> alter system dump datafile 0 page 1;
Succeed.
SQL> alter system dump datafile 3 page 1;
Succeed.
SQL>
SQL> alter system dump datafile 0 page 7;
GS-00697, Unsupported page type
SQL>
SQL>
SQL> alter system dump datafile 0 page 8;
GS-00697, Unsupported page type
SQL> alter system dump datafile 0 page 9;
GS-00697, Unsupported page type
SQL> alter system dump datafile 0 page 100;
GS-00697, Unsupported page type
SQL> alter system dump datafile 0 page 101;
GS-00697, Unsupported page type
SQL> alter system dump datafile 0 page 30;
GS-00697, Unsupported page type
SQL> alter system dump datafile 0 page 40;
GS-00697, Unsupported page type
复制
—从dump数据文件头部block来看,只能dump前面6个block;后面的无法dump;可能是未格式化或者dump 命令本身支持的block类型有限制。
+++ 如下是sysetm文件的 1-6号block的dump trace内容:
[root@mysqldb trc]# cat 0_1.trc information of page 0-1 lsn: 109214 pcn: 155 size: 8192 type: space_head next_ext: 1023-0 space head information segment_count: 1 datafile_count: 149 free_extents: count 33619968 first 1023-0 last 0-109214 datafile hwms information: 0 0 1023 0 1023 1 2058 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [root@mysqldb trc]# [root@mysqldb trc]#
复制
第一个块是文件头,包含基本的space head/datafile hwms信息.
[root@mysqldb trc]# cat 0_2.trc information of page 0-2 lsn: 19008 pcn: 3 size: 8192 type: heap_segment next_ext: 1023-0 heap segment information uid 0, oid 0, space_id 0 initrans: 2 org_scn: 0 seg_scn: 111140917249 crmode: 0 serial: 0 heap storage information extents: count 1, first 0-2, last 0-2 free_extents: count 1, first 1023-0, last 1023-0 free_ufp: 0-7 data_first: 0-4 data_last: 0-6 cmp_hwm: 1023-0 heap map information tree_info.level: 0 tree_info.root: 0-3 curr_map: 0-3 map_count: 1 list_range: 0 655 2514 4373 6232 8092
复制
第2个block包括了heap segment/head storage/head map 信息。
[root@mysqldb trc]# cat 0_3.trc information of page 0-3 lsn: 55198 pcn: 17 size: 8192 type: heap_map next_ext: 1023-0 map page information map.file 1023, mape.page 0, map.slot 4095 map.list_id 0 hwm: 3 list information on this page lists[0] count: #0 first: 4095 lists[1] count: #2 first: 1 lists[2] count: #0 first: 4095 lists[3] count: #0 first: 4095 lists[4] count: #1 first: 2 lists[5] count: #0 first: 4095 map information on this page nodes[0] file: 0 page: 4 prev: 1 next: 4095 nodes[1] file: 0 page: 5 prev: 4095 next: 0 nodes[2] file: 0 page: 6 prev: 4095 next: 4095
复制
第3个block包含了:map page/list page等信息;这里等list map有点类似oracle 文件头前面等next 分配list信息。
[root@mysqldb trc]# cat 0_4.trc information of page 0-4 lsn: 2569 pcn: 20 size: 8192 type: heap next_ext: 1023-0 heap page information map index info: map 0-3, lid 1, &lenth 0 table info: uid 0, oid 0, org_scn 0, seg_scn 111140917249 page info: next_page 0-5, free_begin 5320, free_end 7460, free_size 2140, first_free_dir 32767 itls 2, dirs 43, rows 43 itl information on this page slot: #0 scn: 132815466497 xmap: 65535-65535 xnum: 4294967295 fsc: 0 is_active: 0 is_owscn: 0 slot: #1 scn: 0 xmap: 0-0 xnum: 0 fsc: 0 is_active: 0 is_owscn: 0 row information on this page slot: #0 offset: 88 scn: 0 is_owscn: 0 undo_page: 0-0 undo_slot: 0 size: 116 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #1 offset: 204 scn: 0 is_owscn: 0 undo_page: 0-0 undo_slot: 0 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #2 offset: 324 scn: 0 is_owscn: 0 undo_page: 0-0 undo_slot: 0 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #3 offset: 444 scn: 0 is_owscn: 0 undo_page: 0-0 undo_slot: 0 size: 116 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #4 offset: 560 scn: 132589953025 is_owscn: 0 undo_page: 3-2105 undo_slot: 3 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #5 offset: 680 scn: 132593995777 is_owscn: 0 undo_page: 3-2121 undo_slot: 3 size: 116 ...... cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #41 offset: 5076 scn: 132810207233 is_owscn: 0 undo_page: 3-2102 undo_slot: 3 size: 116 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #42 offset: 5192 scn: 2 is_owscn: 0 undo_page: 3-2134 undo_slot: 3 size: 128 cols: 27 itl_id: 0 deleted/link/migr/self_chg/changed 0/0/0/0/1 [root@mysqldb trc]# [root@mysqldb trc]# cat 0_5.trc information of page 0-5 lsn: 118101 pcn: 142 size: 8192 type: heap next_ext: 1023-0 heap page information map index info: map 0-3, lid 1, &lenth 1 table info: uid 0, oid 0, org_scn 0, seg_scn 111140917249 page info: next_page 0-6, free_begin 7424, free_end 7508, free_size 2508, first_free_dir 32767 itls 2, dirs 40, rows 40 itl information on this page slot: #0 scn: 17826797113345 xmap: 65535-65535 xnum: 4294967295 fsc: 0 is_active: 0 is_owscn: 0 slot: #1 scn: 0 xmap: 0-0 xnum: 0 fsc: 0 is_active: 0 is_owscn: 0 row information on this page slot: #0 offset: 88 scn: 132839981057 is_owscn: 0 undo_page: 3-2182 undo_slot: 3 size: 124 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #1 offset: 212 scn: 132842340353 is_owscn: 0 undo_page: 3-2190 undo_slot: 0 size: 124 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #2 offset: 336 scn: 132843466753 is_owscn: 0 undo_page: 3-2198 undo_slot: 0 size: 120 ....... slot: #39 offset: 7180 scn: 7789472841729 is_owscn: 0 undo_page: 3-33054 undo_slot: 3 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 [root@mysqldb trc]# cat 0_6.trc information of page 0-6 lsn: 115771 pcn: 52 size: 8192 type: heap next_ext: 1023-0 heap page information map index info: map 0-3, lid 4, &lenth 2 table info: uid 0, oid 0, org_scn 0, seg_scn 111140917249 page info: next_page 1023-0, free_begin 1196, free_end 8068, free_size 7472, first_free_dir 3 itls 2, dirs 5, rows 4 itl information on this page slot: #0 scn: 12945916366849 xmap: 65535-65535 xnum: 4294967295 fsc: 0 is_active: 0 is_owscn: 0 slot: #1 scn: 0 xmap: 0-0 xnum: 0 fsc: 0 is_active: 0 is_owscn: 0 row information on this page slot: #0 offset: 696 scn: 7789811486721 is_owscn: 0 undo_page: 3-48972 undo_slot: 18 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #1 offset: 1052 scn: 2 is_owscn: 0 undo_page: 3-48923 undo_slot: 3 size: 144 cols: 27 itl_id: 0 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #2 offset: 816 scn: 7789842870273 is_owscn: 0 undo_page: 3-52180 undo_slot: 20 size: 124 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #3 offset: 65535 scn: 7785292132353 is_owscn: 0 undo_page: 3-25118 undo_slot: 0 (free_dir) slot: #4 offset: 576 scn: 7785119367169 is_owscn: 0 undo_page: 3-20343 undo_slot: 0 size: 120 cols: 27 itl_id: 255 deleted/link/migr/self_chg/changed 0/0/0/0/1
复制
++++ undo datafile dump
[root@mysqldb trc]# cat 3_1.trc information of page 3-1 lsn: 45226 pcn: 129 size: 8192 type: space_head next_ext: 1023-0 space head information segment_count: 1 datafile_count: 0 free_extents: count 33619971 first 1023-0 last 0-45226 datafile hwms information: 0 0 1023 0 1023 1 53794 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [root@mysqldb trc]# cat 3_2.trc information of page 3-2 lsn: 171131 pcn: 95 size: 8192 type: undo_segment next_ext: 1023-0 undo segment information page lists: count 1616 first 3-4400 last 3-4401 txn_page_count: 64 txn_page information on this page 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 3-12 3-13 3-14 3-15 3-16 3-17 3-18 3-19 3-20 3-21 3-22 3-23 3-24 3-25 3-26 3-27 3-28 3-29 3-30 3-31 3-32 3-33 3-34 3-35 3-36 3-37 3-38 3-39 3-40 3-41 3-42 3-43 3-44 3-45 3-46 3-47 3-48 3-49 3-50 3-51 3-52 3-53 3-54 3-55 3-56 3-57 3-58 3-59 3-60 3-61 3-62 3-63 3-64 3-65 3-66 [root@mysqldb trc]# [root@mysqldb trc]# [root@mysqldb trc]# cat 3_3.trc information of page 3-3 lsn: 139281 pcn: 13 size: 8192 type: txn next_ext: 1023-0 txn page information items[0] xnum: 2 status: IN-ACTIVE scn: 17826481414145 undo_pages: count 1 first 3-17125 last 3-17125 items[1] xnum: 2 status: IN-ACTIVE scn: 56481971081217 undo_pages: count 1 first 3-10746 last 3-10746 items[2] xnum: 0 status: IN-ACTIVE scn: 0 undo_pages: count 0 first 0-0 last 0-0 ...... items[290] xnum: 0 status: IN-ACTIVE scn: 0 undo_pages: count 0 first 0-0 last 0-0 [root@mysqldb trc]#
复制
++++ 普通数据文件dump
[root@mysqldb trc]# cat 4_1 4_10.trc 4_1.trc [root@mysqldb trc]# cat 4_1.trc information of page 4-1 lsn: 158102 pcn: 15 size: 8192 type: space_head next_ext: 1023-0 space head information segment_count: 1 datafile_count: 2 free_extents: count 33619972 first 1023-0 last 0-158102 datafile hwms information: 0 0 1023 0 1023 5 66 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [root@mysqldb trc]# cat 4_2.trc information of page 4-2 lsn: 154994 pcn: 12 size: 8192 type: heap_segment next_ext: 4-26 heap segment information uid 2, oid 0, space_id 3 initrans: 2 org_scn: 12051730546689 seg_scn: 12106582368257 crmode: 1 serial: 0 heap storage information extents: count 4, first 4-2, last 4-50 free_extents: count 4, first 1023-0, last 1023-0 free_ufp: 1023-0 data_first: 4-4 data_last: 4-57 cmp_hwm: 1023-0 heap map information tree_info.level: 0 tree_info.root: 4-3 curr_map: 4-3 map_count: 1 list_range: 0 655 2514 4373 6232 8092 [root@mysqldb trc]# [root@mysqldb trc]# [root@mysqldb trc]# cat 4_3.trc information of page 4-3 lsn: 160259 pcn: 151 size: 8192 type: heap_map next_ext: 1023-0 map page information map.file 1023, mape.page 0, map.slot 4095 map.list_id 0 hwm: 30 list information on this page lists[0] count: #0 first: 4095 lists[1] count: #30 first: 29 lists[2] count: #0 first: 4095 lists[3] count: #0 first: 4095 lists[4] count: #0 first: 4095 lists[5] count: #0 first: 4095 map information on this page nodes[0] file: 4 page: 4 prev: 1 next: 4095 nodes[1] file: 4 page: 5 prev: 2 next: 0 nodes[2] file: 4 page: 6 prev: 3 next: 1 nodes[3] file: 4 page: 7 prev: 4 next: 2 nodes[4] file: 4 page: 8 prev: 5 next: 3 nodes[5] file: 4 page: 9 prev: 8 next: 4 nodes[6] file: 4 page: 26 prev: 10 next: 9 ...... nodes[29] file: 4 page: 57 prev: 4095 next: 27 [root@mysqldb trc]# [root@mysqldb trc]# cat 4_4.trc information of page 4-4 lsn: 160518 pcn: 87 size: 8192 type: pcr_heap next_ext: 1023-0 heap page information map index info: map 4-3, lid 1, &lenth 0 table info: uid 2, oid 0, org_scn 12051730546689, seg_scn 12106582368257 page info: next_page 4-5, free_begin 6780, free_end 7472, free_size 692, first_free_dir 16383 itls 2, dirs 334, rows 334 itl information on this page slot: #0 scn: 12251382804481 xmap: 26-14260 xnum: 1 fsc: 2852 is_active: 0 is_owscn: 0 is_hist: 0 is_fast: 0 slot: #1 scn: 57477074472961 xmap: 27-17169 xnum: 2 fsc: 13382 is_active: 0 is_owscn: 0 is_hist: 0 is_fast: 1 row information on this page slot: #0 offset: 3095269322 size: 28 cols: 2 itl_id: 0 deleted/link/migr/self_chg/changed 0/0/0/0/1 slot: #1 offset: 3095269320 size: 24 cols: 2 itl_id: 0 deleted/link/migr/self_chg/changed 0/0/0/1/1 ...... slot: #333 offset: 3095268656 size: 20 cols: 2 itl_id: 1 deleted/link/migr/self_chg/changed 0/0/0/1/1 [root@mysqldb trc]# cat 4_10.trc information of page 4-10 lsn: 159906 pcn: 28 size: 8192 type: btree_segment next_ext: 4-18 btree segment information index info: uid: 2 table_id: 0 index_id: 0 space_id: 3 tree_info.root: 4-13 tree_info.level: 2 initrans: 2 org_scn: 12945913499649 seg_scn: 12945916116993 btree storage information extents: count 4, first 4-10, last 4-58 ufp_count: 7 ufp_first: 4-59 ufp_extent: 1023-0
复制
这里index page 信息。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
TA的专栏
Roger's Database Notes
收录77篇内容