database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Tutorials 8138 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 8138
Undo Tablespace in Oracle 9i
작성자
정재익(advance)
작성일
2001-10-27 20:49
조회수
9,055

원본출처 : http://www.dbasupport.com/oracle/ora9i/undo.shtml

번역 : 정재익

 

오라클 데이터베이스는 트랜젝션을 commit 하기 전에는 그 동작 과정을 기록한다. 그리고 오라클 이 정보를 데이터베이스를 rollback 또는 undo 하는 과정에 이용하게 된다. 오라클에서 이들 기록들을 Rollback 또는 Undo Records 라고 부른다. 이들 기록들은 rollback 이라는 명령어가 내려지면 트랜젝션을 rollback 하는데 이용되고, 자료의 read consistent view 를 제공하거나 또는 데이터베이스의 복구를 위해서 사용된다.

 

Oracle 8i 까지는, 9i 에서도 마찬가지지만, 오라클은 Undo data 를 다루기 위해서 Rollback Segments 를 사용한다. Oracle 9i 를 시작할때, DBA 는 "Undo Tablespace" 라고 불리는 새로운 사양을 제공해 줘야 하는데, DBA 는 얼마나 긴 Undo 정보를 저장할 것인지 또는 어떤 환경에서는 필요하다면 Rollback segment 의 복잡성을 제거야 할 것인지를 결정해야 한다.

 

9i 를 시작할때, Manual Undo Management Mode 에서는 rollback segment 로서 다루며, 새로운 Automatic Undo Management Mode 에서는 Undo Tablespaces 에서 다룬다. 오라클 9i 에서는 Rollback segment 와 Undo Tablespace 둘다 지원되고 있지만, 둘 다 사용할 수는 없다. System Rollback segment 는 두 모드에서 모두 존재한다. 우리는 manual mode 에 익숙하기 때문에 Automatic Undo Management (Undo Tablespaces) 에 대해서 알아보자.

 

Automatic Undo Management 에서 사용되는 Init.ora 인자들

 

UNDO_MANAGEMENT : 이 인자는 오라클에서 Undo information 을 어디서 취급할 것인지를 설정

 

인자의 기본값은 MANUAL 이며, 그래서 여러분들의 예전의 init.ora 파일들은 변경없이 사용할수 있다. 데이터베이스를 자동 모드로 설정하기 위해서는 이 값을 AUTO 로 설정해 주기 바란다.

 

( UNDO_MANAGEMENT = AUTO )

 

UNDO_TABLE_SPACE : 이 인자는 Undo Tablespace 로서 사용될 tablespace 를 정의한다. 만약 값이 주어지지 않으면, 오라클은 먼저 이용가능한 Undo Tablespace 를 설정하거나 또는 none 이 주어지면, 오라클은 시작시에 system rollback segment 를 사용한다. 이 값은 동적으로 변경될 수 있으며, 온라인상에서 변경할 수도 있다.

 

( UNDO_TABLESPACE = undo_tbs1 )

 

UNDO_RETENTION : 이 값은 Undo 정보가 tablespace 내에 존재할 시간을 명시한다. 이것은 트랜젝션을 commit 또는 uncommit 할때 이용한다. 과거에는 오라클에서 FlashBack Query 사양을 사용할때 데이터의 consistent copy 를 읽거나 또는 생성할 필요가 있었기 때문이다. 기본값은 900 sec 로 설정되어 있다.

 

( UNDO_RETENTION = 500 )

 

UNDO_SUPRESS_ERRORS : 이 것은 manual undo management operation 을 하는 동안에 여러분들의 코드가 alter transaction command 를 가지고 있는 경우 이를 알기에 편리하다. Automated management mode 에서 manual management SQL operation 을 할 경우 에러가 발생하지 않도록 할려면 이것을 true 로 설정하라.

 

( UNDO_SUPRESS_ERRORS = true )

 

Creating and Managing Undo Tablespaces :

 

 

Undo tablespace 를 다루는 명령어는 UNDO 라는 keyword 를 사용하는 것 말고는 일상적인 tablespace 를 다루는 명령어와 유사하다. 이들 tablespaces 는 데이터베이스를 생성하는 동안에 생성할수도 있고, 기존의 존재하는 데이터베이스에 CREATE UNDO TABLESPACE 라는 명령어를 이용하여 추가할 수도 있다.

 

Create DATABASE uday controlfile ...........
UNDO Tablespace undo_tbs0 datafile '/vol1/data/uday/undotbs0.dbf' ...

Create UNDO Tablespace undo_tbs1
datafile '/vol1/data/uday/undotbs1.dbf' size 25m autoextend on;

 

모든 동작은 데이터 파일의 이름을 변경하고, 데이터 파일을 추가하는 것과 동일하고, 일반적인 alter tablespace 명령어에서 Online/Offline 또는 Start Backup/End Backup 스위치를 사용할 수 있다. Automated management mode 에서 모든 다른 동작들은 오라클에 의해서 이루어 진다.

 

Monitoring :

 

V$UNDOSTAT : 이 view 에는 현재의 instance 의 Undo Space 내에서 실행중인 트랜젝션의 모니터링을 위한 정보를 담고 있다. 여기서 공간의 사용 정도, 트랜젝션 동시성 그리고 쿼리의 길이 등등을 알수 있다. 이 view 는 지난 24시간 동안의 정보를 포함하고 있으며, 각각의 row 는 BEGIN_TIME 과 END_TIME 에 명시된 10분간의 자료를 포함하고 있다.

 

 

====================

원문 :

 

Oracle Database keeps records of actions of transactiion, before they are committed and Oracle needs this information to rollback or Undo the Changes to the database. These records in Oracle are called Rollback or Undo Records. These records are used to Rollback transactions when a rollback statement is issued or during recovery of a database or to provide a read consistent view of data.

 

Until Oracle 8i and also in 9i, Oracle uses Rollback Segments to manage the Undo Data. Starting with Oracle 9i, DBA's are provided with some a new feature referred to as "Undo Tablespace" which allows the dba to exert more control on how long Undo information is retained and also eliminates the complexity of managing Rollback Segments in certain environments.

 

Starting with 9i, the rollback segment way is referred to as Manual Undo Management Mode and the new Undo Tablespaces method as the Automatic Undo Management Mode. Although both rollback Segments and Undo Tablespaces are supported in Oracle 9i, Both modes cannot be used. System Rollback segment exists in both the modes. Since we are all familiar with the manual mode, lets look at the features of the Automatic Undo Management (Undo Tablespaces )

 

Init.ora Parameters for Automatic Undo Management

 

UNDO_MANAGEMENT : This parameter sets the mode in which oracle manages the Undo Information.

 

The default value for this parameter is MANUAL so that all your old init.ora files can be used without any changes. To set the database in an automated mode, set this value to AUTO. ( UNDO_MANAGEMENT = AUTO)

 

UNDO_TABLESPACE : This parameter defines the tablespaces that are to be used as Undo Tablespaces. If no value is specified oracle grabs the first available Undo Tablespace or if there are none present, Oracle will use the system rollback segment to startup. This value is dynamic and can be changed online ( UNDO_TABLESPACE = undo_tbs1 )

 

UNDO_RETENTION : This value specifies the amount of time, Undo is kept in the tablespace. This applies to both committed and uncommitted transactions since the introduction of FlashBack Query feature in Oracle needs this information to create a read consistent copy of the data in the past. Default value is 900 Secs ( UNDO_RETENTION = 500)

 

UNDO_SUPRESS_ERRORS : This is a good thing to know about in case your code has the alter transaction commands that perform manual undo management operations. Set this to true to suppress the errors generated when manual management SQL operations are issued in an automated management mode.

 

Creating and Managing Undo Tablespaces :

 

Undo tablespaces use syntax that is similar to regular tablespaces except that they use the keyword UNDO. These tablespaces can be created during the database creation time or can be added to an existing database using the create UNDO Tablespace command

 

Create DATABASE uday controlfile ...........

UNDO Tablespace undo_tbs0 datafile '/vol1/data/uday/undotbs0.dbf' ...

 

Create UNDO Tablespace undo_tbs1

datafile '/vol1/data/uday/undotbs1.dbf' size 25m autoextend on;

 

All operations like Renaming a data file, Adding a datafile, Online /Offline Swith or Start Backup / End Backup Switch can be made using the regular alter tablespace command. All other operations are managed by Oracle in the automated management mode.

 

Monitoring :

 

v$UNDOSTAT : This view contains statistics for monitoring the effects of transaction execution on Undo Space in the current instance. These are available for space usage, transaction concurrency and length of query operations. This view contains information that spans over a 24 hour period and each row in this view contains data for a 10 minute interval specified by the BEGIN_TIME and END_TIME.

[Top]
No.
제목
작성자
작성일
조회
8679오라클 강의록 일부
정재익
2001-12-03
9555
8142XML for Real
정재익
2001-10-27
7146
8139The Power of DECODE()
정재익
2001-10-27
10285
8138Undo Tablespace in Oracle 9i
정재익
2001-10-27
9055
7906테이블 스페이스, 데이타 파일, 익스텐트 , 프리스페이스 관리하기.
정회민
2001-10-12
8774
7706Table 이 차지하는 용량 계산을 어떻게 하면 될까요? [4]
정재익
2001-10-02
11998
7054PHP4 + Oracle 8i + Apache 설정시 주의사항
정재익
2001-09-01
6242
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.027초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다