1. Undo Segment¶õ
µ¥ÀÌŸº£À̽º¿¡¼
ÇÁ·Î¼¼½º°¡ µ¥ÀÌŸ¸¦ º¯°æÇÒ ¶§, old value°ªÀ» ÀúÀåÇϱâ À§ÇØ »ç¿ëµÇ´Â °ÍÀ¸·Î,
Transaction
Rollback,
Transaction Recovery, Read Consistency¸¦ À§ÇØ »ç¿ëµÈ´Ù.
2. Undo SegmentÀÇ
ŸÀÔ
Å©°Ô
SYSTEM Undo Segment¿Í Non-SYSTEM Undo Segment·Î ³ª´ ¼ö ÀÖ´Ù.
1)
SYSTEM Unod Segment : µ¥ÀÌŸº£À̽º°¡ ¸¸µé¾î Áú ¶§ SYSTEM Å×ÀÌºí½ºÆäÀ̽º¿¡ ¸¸µé¾îÁö´Â
°ÍÀ¸·Î, ½Ã½ºÅÛ
Å×ÀÌºí½ºÆäÀ̽ºÀÇ
¿ÀºêÁ§Æ®¿¡ ´ëÇÑ change°ªÀ» ÀúÀåÇϱâ À§ÇØ »ç¿ëµÈ´Ù.
2)
Non-SYSTEM Undo Segment :
3. Automatic
Undo Segment
1)
°³³ä : ¿À¶óŬ ¼¹ö´Â undo data¸¦ UNDOÅ×ÀÌºí½ºÆäÀ̽º¸¦ »ç¿ëÇÏ¿© ÀÚµ¿À¸·Î °ü¸®ÇÒ
¼ö ÀÖÀ¸¸ç, ¼¼±×¸ÕÆ®´Â
_SYSSMUn$ÀÇ
Çü½ÄÀ¸·Î ÇÒ´çµÈ´Ù.
2)
ÆĶó¹ÌÅÍ ÆÄÀÏ ¼³Á¤
$vi
initasean3.ora
...
###########################################
#
System Managed Undo and Rollback Segments
###########################################
undo_management=AUTO
undo_tablespace=UNDOTBS1
undo_retention=10800
-->Read
Consistency¸¦ À§ÇØ undo data°¡ ¾ó¸¶³ª ¿À·§µ¿¾È À¯ÁöµÇ¾î¾ß
ÇÏ´ÂÁö¸¦
ÃÊ ´ÜÀ§·Î ³ªÅ¸³»´Â ÆĶó¹ÌÅÍ
...
-
¸¸¾à µ¥ÀÌŸº£À̽º »ý¼º½Ã UNDO_MANAGEMENT=TRUE·Î ¼³Á¤ÇÏ°í UNDO_TABLESPACEÀýÀ»
»ý·«ÇÏ¸é µ¥ÀÌ
Ÿº£À̽º´Â
SYS_UNDOTBS Å×ÀÌºí½ºÆäÀ̽º¿Í 'dbu1<sid>.dbf'µ¥ÀÌŸ ÆÄÀÏÀ» ÀÚµ¿À¸·Î »ý¼ºÇÑ´Ù.
3)
UNDO TablespaceÀÇ ÃÖÀûÀÇ Å©±â °è»ê
SQL>
SELECT (UR*(UPS*DBS))+(DBS*24) FROM
(SELECT VALUE AS UR FROM V$PARAMETER WHERE NAME='undo_retention'),
(SELECT (SUM(undoblks)/SUM(((end_time-begin_time)*86400))) AS UPS FROM
v$undostat),
(SELECT VALUE AS DBS FROM V$PARAMETER WHERE NAME='db_block_size');
(UR*(UPS*DBS))+(DBS*24)
-------------------------
31178159.9
-
À§ °ªÀ» MB·Î ³ªÅ¸³»±â À§ÇØ 1048576À¸·Î ³ª´©¾î ÁÜ
4)
UNDO Tablespace »ý¼º
SQL>CREATE
UNDO TABLESPACE UNDOTBS01
DATAFILE
'/home/ora920/oradata/asean3/undotbs1.dbf' SIZE 30M;
Tablespace
created.
5)
UNDO Tablespace »èÁ¦ : ÇöÀç ÀνºÅϽº¿¡ ÀÇÇØ undo tablespace°¡ »ç¿ëÁßÀ̰ųª,
Æ®·£젹¼ÇÀÌ ÀϾ°í ÀÖÀ»
¶§´Â
»èÁ¦°¡ ¾ÈµÊ.
-
»õ·Î¿î UNDO Tablespace·Î Switch
SQL>
ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS01;
System
altered.
-
ÇöÀçÀÇ ¸ðµç Æ®·¢Á§¼Ç ¿Ï·áÈÄ Å×ÀÌºí½ºÆäÀ̽º »èÁ¦
SQL>
SELECT N.NAME, S.STATUS
FROM V$ROLLNAME N, V$ROLLSTAT S
WHERE N.NAME IN (SELECT SEGMENT_NAME FROM DBA_SEGMENTS WHERE TABLESPACE_NAME='UNDOTBS1')
AND
N.USN=S.USN;
NAME
STATUS
------------------------------
---------------
_SYSSMU1$
PENDING
OFFLINE --> ÇöÀç Æ®·£Á§¼ÇÀÌ È°¼ºÈ
µÇ¾î ÀÖÀ½À» Ç¥½Ã, ¾Æ¹« °ªµµ ¾ø
´Â
°ÍÀº Æ®·£Á§¼Ç ¿Ï·á¸¦ ³ªÅ¸³¿.
SQL>DROP
TABLESPACE UNDOTBS1; -->
À§ÀÇ STATUS°ªÀÌ ¾øÀ» °æ¿ì Å×ÀÌºí½ºÆäÀ̽º »èÁ¦
6)
UNDO Segment Á¤º¸
- DBA_ROLLBACK_SEGS
: offlin»óÅÂÀÎ UNDO SegmentÁ¤º¸±îÁö º¼ ¼ö ÀÖ´Ù.
(ºä¸¦
ÅëÇؼ´Â offlineÁ¤º¸´Â º¼ ¼ö ¾ø´Ù.)
SQL>
SELECT SEGMENT_NAME, OWNER, TABLESPACE_NAME, STATUS
FROM
DBA_ROLLBACK_SEGS;
SEGMENT_NAME
OWNER TABLESPACE_NAME
STATUS
-----------------------------------------------------------------
_SYSSMU9$
PUBLIC
UNDOTBS1 ONLINE
_SYSSMU10$
PUBLIC
UNDOTBS1 ONLINE
_SYSSMU11$
PUBLIC
UNDOTBS01 OFFLINE
-
V$UNDOSTAT : 10ºÐ °£°ÝÀ¸·Î undo segment¿¡ ¼öÁýµÇ´Â µ¥ÀÌŸÀÇ Åë°è¸¦ º¼ ¼ö ÀÖ´Ù.
SQL>SELECT
BEGIN_TIME, END_TIME, UNDOBLKS FROM V$UNDOSTAT;
BEGIN_TIM
END_TIME UNDOBLKS
---------
--------- ----------
02-APR-04
02-APR-04 19
02-APR-04
02-APR-04 19
-
V$ROLLSTAT
Column
Datatype Description
-------------------------------
USN
NUMBER Rollback
segment number
EXTENTS
NUMBER Number of
extents in rollback segment
RSSIZE
NUMBER Size
in bytes of rollback segment.
This
values differs by the number of bytes in one database block from
the
value of the BYTES column of the ALL/DBA/USER_SEGMENTS views.
WRITES
NUMBER Number
of bytes written to rollback segment
XACTS
NUMBER Number
of active transactions
GETS
NUMBER Number
of header gets
WAITS
NUMBER Number
of header waits
OPTSIZE
NUMBER Optimal size
of rollback segment
HWMSIZE
NUMBER High water
mark of rollback segment size
SHRINKS
NUMBER Number of
times the size of a rollback segment decreases
WRAPS
NUMBER Number
of times rollback segment is wrapped
EXTENDS
NUMBER Number of
times rollback segment size is extended
AVESHRINK
NUMBER Average shrink size
AVEACTIVE
NUMBER Current size of active
extents, averaged over time.
STATUS
VARCHAR2(15) Rollback segment status
CUREXT
NUMBER Current
extent
CURBLK
NUMBER Current
block
* iWiz´Ô¿¡ ÀÇÇؼ °Ô½Ã¹° À̵¿µÇ¾ú½À´Ï´Ù (2010-02-03 17:06)
|