Â¥Ö÷: solearn

Drop columnʱΪʲôҪÓÐundo data?

[¸´ÖÆÁ´½Ó]
ÂÛ̳»ÕÕÂ:
14
°ÂÔË»á¼ÍÄî»ÕÕÂ:×ÔÐгµ
ÈÕÆÚ:2008-04-25 21:00:142013Äêдº¸£ÕÂ
ÈÕÆÚ:2013-02-25 14:51:24ITPUB 11ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-10-10 13:11:14°ÂÔË»á¼ÍÄî»ÕÕÂ:Ƥ»®Í§¼¤Á÷»ØÐý
ÈÕÆÚ:2012-08-13 10:25:38ÏÊ»¨µ°
ÈÕÆÚ:2012-02-10 11:40:172010дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2010-03-01 11:04:58ÊÚȨ»áÔ±
ÈÕÆÚ:2010-01-12 09:40:47ITPUBÔªÀÏ
ÈÕÆÚ:2010-01-12 09:33:092009дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2009-01-04 14:52:28°ÂÔË»á¼ÍÄî»ÕÕÂ:È­»÷
ÈÕÆÚ:2008-10-24 13:22:33
21#
 Â¥Ö÷| ·¢±íÓÚ 2006-7-14 14:19 | Ö»¿´¸Ã×÷Õß
×î³õÓÉ Yong Huang ·¢²¼
[B]

If I implied that system rollback segment was only meant for Oracle's internal operation (i.e. recursive SQL), I was wrong. Oracle decides which rollback segment to use based on a set of rules. I remember seeing all the rules in Rama Velpuri's book "Oracle Backup and Recovery" (probably within the first 50 pages). System rollback segment is way down the list. It's NOT exclusively used to record data dictionary changes (i.e. recursive calls).

Yong Huang [/B]


Did you mean that the system rollback segment may be involved in saving data block undo?

In this case, I did not see 'writes' for system rollback segment which contains dictionary (that is, definition for table). And obviously, this operation definitely changes the table and column information. So I was wondering why no signs of change on system rollback segment.

To extend this issue, how DDLs activities can be discovered? search the redo and undo block dump? or any other views?

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
1
ITPUBÐÂÊ×Ò³ÉÏÏß¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2007-10-20 08:38:44
22#
·¢±íÓÚ 2006-7-14 22:50 | Ö»¿´¸Ã×÷Õß
SQL> create table test_droptable (a char(10),b number);

Table created.

SQL> insert into test_droptable values('1',1);

1 row created.

SQL> insert into test_droptable values('2',2);

1 row created.

SQL> commit ;

Commit complete.

SQL> select dbms_rowid.rowid_block_number(rowid),b from test_droptable;

DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)          B
------------------------------------ ----------
                                 432          1
                                 432          2
SQL> select HEADER_FILE,HEADER_BLOCK from dba_segments ds where ds.segment_name='TEST_DROPTABLE' ;

HEADER_FILE HEADER_BLOCK
----------- ------------
         11          427


SQL> alter system dump datafile 11 block 432;

System altered.

SQL> alter table test_droptable drop column b;

Table altered.

SQL> alter system dump datafile 11 block 432;

System altered.


ÎÒÃǶԱÈǰºóµÄtrace file :

ǰ:

** 2006-07-14 22:16:48.000
Start dump data blocks tsn: 12 file#: 11 minblk 432 maxblk 432
buffer tsn: 12 rdba: 0x02c001b0 (11/432)
scn: 0x0000.0124a9c4 seq: 0x01 flg: 0x02 tail: 0xa9c40601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump:  0x02c001b0
Object id on Block? Y
seg/obj: 0x76ef  csc: 0x00.124a9c0  itc: 2  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x2c001a9 ver: 0x01
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0009.023.00003ea4  0x0080008e.080f.23  --U-    2  fsc 0x0000.0124a9c4
0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000

data_block_dump,data header at 0xb0f1064
===============
tsiz: 0x1f98
hsiz: 0x16
pbl: 0x0b0f1064
bdba: 0x02c001b0
     76543210
flag=--------
ntab=1
nrow=2
frre=-1
fsbo=0x16
fseo=0x1f76
avsp=0x1f60
tosp=0x1f60
0xeti[0]        nrow=2        offs=0
0x12ri[0]        offs=0x1f87
0x14ri[1]        offs=0x1f76
block_row_dump:
tab 0, row 0, @0x1f87
tl: 17 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [10]  31 20 20 20 20 20 20 20 20 20
col  1: [ 2]  c1 02
tab 0, row 1, @0x1f76
tl: 17 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [10]  32 20 20 20 20 20 20 20 20 20
col  1: [ 2]  c1 03
end_of_block_dump
End dump data blocks tsn: 12 file#: 11 minblk 432 maxblk 432


ºó:

*** 2006-07-14 22:17:57.000
Start dump data blocks tsn: 12 file#: 11 minblk 432 maxblk 432
buffer tsn: 12 rdba: 0x02c001b0 (11/432)
scn: 0x0000.0124b0d1 seq: 0x01 flg: 0x02 tail: 0xb0d10601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump:  0x02c001b0
Object id on Block? Y
seg/obj: 0x76ef  csc: 0x00.124b0ce  itc: 2  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x2c001a9 ver: 0x01
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0009.023.00003ea4  0x0080008e.080f.23  C---    0  scn 0x0000.0124a9c4
0x02   0x0009.002.00003ea6  0x0080008f.080f.3c  --U-    2  fsc 0x0006.0124b0d1

data_block_dump,data header at 0xb0f1064
===============
tsiz: 0x1f98
hsiz: 0x16
pbl: 0x0b0f1064
bdba: 0x02c001b0
     76543210
flag=--------
ntab=1
nrow=2
frre=-1
fsbo=0x16
fseo=0x1f76
avsp=0x1f60
tosp=0x1f66
0xeti[0]        nrow=2        offs=0
0x12ri[0]        offs=0x1f87
0x14ri[1]        offs=0x1f76
block_row_dump:
tab 0, row 0, @0x1f87
tl: 14 fb: --H-FL-- lb: 0x2  cc: 1
col  0: [10]  31 20 20 20 20 20 20 20 20 20
tab 0, row 1, @0x1f76
tl: 14 fb: --H-FL-- lb: 0x2  cc: 1
col  0: [10]  32 20 20 20 20 20 20 20 20 20
end_of_block_dump
End dump data blocks tsn: 12 file#: 11 minblk 432 maxblk 432

ÎÒÃÇÊÇ·ñ¿ÉÒԶ϶¨:drop ºódump ³öµÄtrace file ÒѾ­²»´æÔÚcol 1 ,ÄÇôҲ¾Í¿ÉÒԶ϶¨¿é·¢ÉúÁ˸ıä,Ò²¾ÍÊÇÒª²úÉúundo record ,ÓÃÀ´½øÐÐrollback ÒÔ¼°consistent reads£¡

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
47
ÃÉÆæ¡¤D¡¤Â··É
ÈÕÆÚ:2017-03-27 08:04:23ÂíÉÏÓгµ
ÈÕÆÚ:2014-02-18 16:41:112014Äêдº¸£ÕÂ
ÈÕÆÚ:2014-02-18 16:41:11Ò»Æû
ÈÕÆÚ:2013-09-01 20:46:27¸´»îµ°
ÈÕÆÚ:2013-03-13 07:55:232013Äêдº¸£ÕÂ
ÈÕÆÚ:2013-02-25 14:51:24ITPUB 11ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-10-09 18:03:322012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:202012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:202012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:20
23#
·¢±íÓÚ 2006-7-14 23:20 | Ö»¿´¸Ã×÷Õß
×î³õÓÉ solearn ·¢²¼
[B]

Did you mean that the system rollback segment may be involved in saving data block undo? ...
[/B]


No. I meant the opposite! I said that the system rollback segment is not special in the sense that it's used to store data dictionary undo. Not at all. Instead, it's special in the sense that its usage is very low in priority. That is, if no non-system rollback segments are available to use, then it will be considered. The exact consideration order is in Rama Velpuri's book and may also be in some Metalink document.

Also see my old message where I recalled what I read from Rama's book:
http://www.lazydba.com/oracledba.pl?0::6301:g

Yong Huang

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
3
2010дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2010-03-01 11:07:27ITPUB9ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2010-10-08 09:28:52
24#
·¢±íÓÚ 2006-7-15 14:22 | Ö»¿´¸Ã×÷Õß
ѧϰÁË

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
14
°ÂÔË»á¼ÍÄî»ÕÕÂ:×ÔÐгµ
ÈÕÆÚ:2008-04-25 21:00:142013Äêдº¸£ÕÂ
ÈÕÆÚ:2013-02-25 14:51:24ITPUB 11ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-10-10 13:11:14°ÂÔË»á¼ÍÄî»ÕÕÂ:Ƥ»®Í§¼¤Á÷»ØÐý
ÈÕÆÚ:2012-08-13 10:25:38ÏÊ»¨µ°
ÈÕÆÚ:2012-02-10 11:40:172010дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2010-03-01 11:04:58ÊÚȨ»áÔ±
ÈÕÆÚ:2010-01-12 09:40:47ITPUBÔªÀÏ
ÈÕÆÚ:2010-01-12 09:33:092009дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2009-01-04 14:52:28°ÂÔË»á¼ÍÄî»ÕÕÂ:È­»÷
ÈÕÆÚ:2008-10-24 13:22:33
25#
 Â¥Ö÷| ·¢±íÓÚ 2006-7-17 09:51 | Ö»¿´¸Ã×÷Õß
×î³õÓÉ SONGHEFEI ·¢²¼
[B]

SQL> alter system dump datafile 11 block 432;

System altered.

SQL> alter table test_droptable drop column b;

Table altered.

SQL> alter system dump datafile 11 block 432;

System altered.



ÎÒÃÇÊÇ·ñ¿ÉÒԶ϶¨:drop ºódump ³öµÄtrace file ÒѾ­²»´æÔÚcol 1 ,ÄÇôҲ¾Í¿ÉÒԶ϶¨¿é·¢ÉúÁ˸ıä,Ò²¾ÍÊÇÒª²úÉúundo record ,ÓÃÀ´½øÐÐrollback ÒÔ¼°consistent reads£¡ [/B]


лл´ð¸´£¡

´ÓÄãµÄʵÑéÖпÉÒÔ¿´µ½£¬oracle¸ÄдÁËÐеÄÄÚÈÝ£¬Éú³ÉÁËÏàÓ¦µÄundo£¨ÓеãÀàËÆÓÚupdate£©¡£Í¬Ê±drop columnÊǸöDDLÓï¾ä£¬Ó¦¸Ã¸üÐÂÁËÊý¾Ý×ֵ䡣

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
14
°ÂÔË»á¼ÍÄî»ÕÕÂ:×ÔÐгµ
ÈÕÆÚ:2008-04-25 21:00:142013Äêдº¸£ÕÂ
ÈÕÆÚ:2013-02-25 14:51:24ITPUB 11ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-10-10 13:11:14°ÂÔË»á¼ÍÄî»ÕÕÂ:Ƥ»®Í§¼¤Á÷»ØÐý
ÈÕÆÚ:2012-08-13 10:25:38ÏÊ»¨µ°
ÈÕÆÚ:2012-02-10 11:40:172010дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2010-03-01 11:04:58ÊÚȨ»áÔ±
ÈÕÆÚ:2010-01-12 09:40:47ITPUBÔªÀÏ
ÈÕÆÚ:2010-01-12 09:33:092009дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2009-01-04 14:52:28°ÂÔË»á¼ÍÄî»ÕÕÂ:È­»÷
ÈÕÆÚ:2008-10-24 13:22:33
26#
 Â¥Ö÷| ·¢±íÓÚ 2006-7-17 10:16 | Ö»¿´¸Ã×÷Õß
×î³õÓÉ Yong Huang ·¢²¼
[B]

No. I meant the opposite! I said that the system rollback segment is not special in the sense that it's used to store data dictionary undo. Not at all. Instead, it's special in the sense that its usage is very low in priority. That is, if no non-system rollback segments are available to use, then it will be considered. The exact consideration order is in Rama Velpuri's book and may also be in some Metalink document.

Also see my old message where I recalled what I read from Rama's book:
http://www.lazydba.com/oracledba.pl?0::6301:g

Yong Huang [/B]


Could you offer any other links? I can't get the right docs from http://www.lazydba.com/oracledba.pl?0::6301:g and have no metalink access. Thanks.

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´
ÂÛ̳»ÕÕÂ:
47
ÃÉÆæ¡¤D¡¤Â··É
ÈÕÆÚ:2017-03-27 08:04:23ÂíÉÏÓгµ
ÈÕÆÚ:2014-02-18 16:41:112014Äêдº¸£ÕÂ
ÈÕÆÚ:2014-02-18 16:41:11Ò»Æû
ÈÕÆÚ:2013-09-01 20:46:27¸´»îµ°
ÈÕÆÚ:2013-03-13 07:55:232013Äêдº¸£ÕÂ
ÈÕÆÚ:2013-02-25 14:51:24ITPUB 11ÖÜÄê¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-10-09 18:03:322012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:202012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:202012дº¼ÍÄî»ÕÕÂ
ÈÕÆÚ:2012-02-13 15:13:20
27#
·¢±íÓÚ 2006-7-17 10:32 | Ö»¿´¸Ã×÷Õß
×î³õÓÉ solearn ·¢²¼
[B]

Could you offer any other links? I can't get the right docs from http://www.lazydba.com/oracledba.pl?0::6301:g and have no metalink access. Thanks. [/B]


Sorry for that link. I think it worked the other day. Try this:
http://www.lazydba.com/oracle/0__6281.html

I just pulled the book off my shelf. If you have it, it's on p.57.

Yong Huang

ʹÓõÀ¾ß ¾Ù±¨

»Ø¸´

ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | ×¢²á

±¾°æ»ý·Ö¹æÔò ·¢±í»Ø¸´

TOP¼¼Êõ»ý·Ö°ñ ÉçÇø»ý·Ö°ñ »ÕÕ ÍÅ¶Ó Í³¼Æ ֪ʶË÷ÒýÊ÷ »ý·Ö¾ºÅÄ Îı¾Ä£Ê½ °ïÖú
  ITPUBÊ×Ò³ | ITPUBÂÛ̳ | Êý¾Ý¿â¼¼Êõ | ÆóÒµÐÅÏ¢»¯ | ¿ª·¢¼¼Êõ | ΢Èí¼¼Êõ | Èí¼þ¹¤³ÌÓëÏîÄ¿¹ÜÀí | IBM¼¼ÊõÔ°µØ | ÐÐÒµ×ÝÏòÌÖÂÛ | ITÕÐÆ¸ | ITÎĵµ
  ChinaUnix | ChinaUnix²©¿Í | ChinaUnixÂÛ̳
CopyRight 1999-2011 itpub.net All Right Reserved. ±±¾©Ê¢ÍØÓÅѶÐÅÏ¢¼¼ÊõÓÐÏÞ¹«Ë¾°æÈ¨ËùÓС¡ÁªÏµÎÒÃÇ Î´³ÉÄêÈ˾ٱ¨×¨Çø¡¡
¾©ICP±¸16024965ºÅ-8 ¡¡±±¾©Êй«°²¾Öº£µí·Ö¾ÖÍø¼àÖÐÐı¸°¸±àºÅ£º11010802021510¡¡¹ã²¥µçÊÓ½ÚÄ¿ÖÆ×÷¾­ÓªÐí¿ÉÖ¤£º±àºÅ£¨¾©£©×ÖµÚ1149ºÅ
  
¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí