- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
4#
发表于 2013-5-19 20:35:30
SQL> create table test_dc_histogram tablespace users as select * from dba_objects;
Table created.
SQL> exec dbms_stats.gather_table_stats(user,'TEST_DC_HISTOGRAM', method_opt=>'FOR ALL COLUMNS SIZE 5');
PL/SQL procedure successfully completed.
SQL> select obj#,name from obj$ where name='TEST_DC_HISTOGRAM';
OBJ# NAME
---------- ------------------------------
18000 TEST_DC_HISTOGRAM
SQL> select * from test_dc_histogram where object_id=10;
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump row_cache 10;
Statement processed.
18000 =》4650
BUCKET 63289:
row cache parent object: address=0x900e3838 cid=16(dc_histogram_defs)
hash=1fddf738 typ=11 transaction=(nil) flags=00000002
own=0x900e3900[0x900e3900,0x900e3900] wat=0x900e3910[0x900e3910,0x900e3910] mode=S
status=VALID/-/-/-/-/-/-/-/-
request=N release=FALSE flags=8
instance lock=QQ 1fddf738 acf324a4
set=0, complete=FALSE
set=1, complete=FALSE
data=
00004650 00000009 00000005 78010006 09130571 00000317 00000000 407cf000
97c59ee6 3f726e84 9b96981d 47489c9c 99969823 47491818 00000000 00000000
00000000 407cf000 00000000 40d12d00 00000014 37393931 2d34302d 313a3231
39353a32 0030303a 00000000 00000000 00000000 30320013 302d3331 39312d35
3a38303a 333a3132 00000033 00000000 00000000 00130000 00000006 00000000
00000009 00000000 00000000 1fddf738 900e3838 00000000 9392b3a0 00000000
9392b3a0 00000000 00000000 00000000 d72e6ac0 00007fc6 00000000 00000000
00000000 00000000 900e3838 00000000 900e3a20 00000000 900e3a20 00000000
900e3a48 00000000 00000008 1fddf738 acf324a4 00000000 00000101 00000000
0000011d 00000000 96af1bd8 00000000 978a1c90 00000000 900e7308 00000000
900e1090 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 96bd4090 00000000 00000001 00000095
00030308 08910321 900e3ab8 00000000 900e3ab8 00000000 00000000 00000000
d72e6ae0 00007fc6 96bd40d8 00000000 96bd40d8 00000000 00000000 00000000
06c25c14 00000000 d72e6ae0 00007fc6 96af1bd8 00000000 900e1130 00000000
900e73a8 00000000 97a84cc8 00000000 00000000 00000015 900e3b28 00000000
900e3b28 00000000 00000000 00000000 00000000 00000000 900e3b48 00000000
900e3b48 00000000 900e3b58 00000000 900e3b58 00000000 900e3b68 00000000
900e3b68 00000000 00000000 00000000 d72e6ac8 00007fc6 00000000 00000000
00000000 00000000 900e3b98 00000000 900e3b98 00000000 00000000 00000000
00000000 00000000 02609720 00007fff 10600160 00000100 00000001 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
00014c26 00000000 900e3900 00000000
row cache subordinate object:
address=0x8e3ac218 cid=16(dc_histogram_data_values) set=1 parent=0x900e3838 typ=12
status=VALID/-/-/-/-
data=
00000000 00000000 00000001 00000002 00000003 00000004 00000005 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 9b96981d 47489c9c
99169824 47491818 99169824 47491818 99169824 47491818 99169824 47491818
99969823 47491818 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000009 00000000
37393931 2d34302d 313a3231 39353a32 0030303a 00000000 00004000 00000000
32313032 2d35302d 303a3032 36343a37 0038343a 00000000 88250670 00000000
32313032 2d35302d 303a3032 37343a37 ae31343a 00007fff 06c1c985 00000000
32313032 2d35302d 303a3032 39343a37 0b39353a 00000000 00000000 00000000
32313032 2d35302d 303a3032 34353a37 0032303a 00000000 978a7888 00000000
33313032 2d35302d 303a3931 31323a38 0033333a 4051157c 00000000 00000000
0b7c010c 00007fb7 33333333 415819c7 33333333 415819c7 00002000 00000000
00000000 00000000 0b812d00 00007fb7 00000000 00000000 000003f0 00000000
0baf3fa0 00000000 0b7c00c0 00007fb7 00000000 00000000 00000000 00000000
900e3900 00000000 900e3910 00000000 00000001 00000000 047ebd3c 00000000
00000000 00000000 093205df 00000000 93f39be8 00000000 00000000 00000000
00000000 00000000 9392b3a0 00000000 ae478410 00007fff ae478490 00007fff
913af018 00000000 0b812d10 00007fb7 00000178 00000000 00000178 00007fb7
00000001 00007fb7 00000000 00007fff 00000000 00000000 047ebd3c 00000000
00000000 00000000 0932aec8 00000000 0b7c00c0 00007fb7 00000000 00000000
095e85dc 00000000 00000000 00000000 0baf4150 00000000 ae478478 00007fff
0b7c1660 00007fb7 0b7c17e8 00007fb7 93f39be8 00000000 943b8cc8 00000000
00000000 00000000 00000000 00000000 900e3870 00000000 090dc805 00000000
ae478290 00007fff 0208e25f 00000000 00000000 00000000 00000001 00000000
ae478290 00007fff 091d1c82 00000000 8e3ac218 00000000 00000000 00000000
13131313 00b71313 000000d0 718b0000 00000001 00000000
BUCKET 63289 total object count=1
SQL> select * from test_dc_histogram where owner='MLFDSSDF';
no rows selected
使用owner 查询 时出现新的dc_histogram_defs 信息包括col#=0000000e
BUCKET 61491:
row cache parent object: address=0x900ec1c8 cid=16(dc_histogram_defs)
hash=66a7f032 typ=11 transaction=(nil) flags=00000002
own=0x900ec290[0x900ec290,0x900ec290] wat=0x900ec2a0[0x900ec2a0,0x900ec2a0] mode=S
status=VALID/-/-/-/-/-/-/-/-
request=N release=FALSE flags=8
instance lock=QQ 66a7f032 b3da4caa
set=0, complete=FALSE
set=1, complete=FALSE
data=
00004650 0000000e 00000005 78010003 09130571 00000317 00000000 40300000
SQL> exec dbms_stats.gather_table_stats(user,'TEST_DC_HISTOGRAM', method_opt=>'FOR ALL COLUMNS SIZE 254');
PL/SQL procedure successfully completed.
SQL> alter system flush shared_pool;
System altered.
SQL> /
System altered.
SQL> /
System altered.
select * from test_dc_histogram where object_id=10;
SQL> select count(*) from dba_tab_histograms where table_name='TEST_DC_HISTOGRAM' and column_name='OBJECT_ID';
COUNT(*)
----------
255
SQL> oradebug setmypid
Statement processed.
SQL>
SQL> oradebug dump row_cache 10;
Statement processed.
SQL> oradebug tracefile_name
/s01/diag/rdbms/prod/PROD1/trace/PROD1_ora_4369.trc
BUCKET 63289:
row cache parent object: address=0x91d90b60 cid=16(dc_histogram_defs)
hash=1fddf738 typ=11 transaction=(nil) flags=00000002
own=0x91d90c28[0x91d90c28,0x91d90c28] wat=0x91d90c38[0x91d90c38,0x91d90c38] mode=S
status=VALID/-/-/-/-/-/-/-/-
request=N release=FALSE flags=8
instance lock=QQ 1fddf738 acf324a4
set=0, complete=FALSE
set=1, complete=FALSE
data=
00004650 00000009 000000fe 780b00d4 09130571 00000d1f 00000000 407cf000
911d84fb 3f6c114f 9b96981d 47489c9c 99969823 47491818 00000000 00000000
[oracle@maclean1 ~]$ grep "dc_histogram_data_values" /s01/diag/rdbms/prod/PROD1/trace/PROD1_ora_4369.trc|grep parent=0x91d90b60
address=0x91d90730 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x91d90300 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x91d8fed0 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x903808c8 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x90380498 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x90380068 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x9037fc38 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x9037f808 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x882c53d8 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x882c4fa8 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
address=0x882c4b78 cid=16(dc_histogram_data_values) set=1 parent=0x91d90b60 typ=12
|
|