1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Managing Undo Data docx

22 356 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Managing undo data
Trường học Oracle Corporation
Thể loại tài liệu
Năm xuất bản 2002
Định dạng
Số trang 22
Dung lượng 285,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

After completing this lesson, you should be able to do the following: • Describe the purpose of undo data • Implement Automatic Undo Management • Create and configure undo segments • Obt

Trang 1

Managing Undo Data

Trang 2

After completing this lesson, you should be able to do the following:

Describe the purpose of undo data

Implement Automatic Undo Management

Create and configure undo segments

Obtain undo segment information

Trang 3

Managing Undo Data

There are two methods for managing undo data:

Automatic Undo Management

Manual Undo Management

The term undo was known as rollback in previous versions.

Trang 4

Undo Segment

Update transaction

Old image

New image Undo segment

Table

Trang 5

Undo Segments: Purpose

Transaction rollback Transaction

recovery Undo segment Read consistency

Trang 7

Types of Undo Segments

SYSTEM: Used for objects in the SYSTEM tablespace

Non-SYSTEM: Used for objects in other tablespaces:

Auto mode: Requires an UNDO tablespace

Manual mode:

Private: Acquired by a single instance Public: Acquired by any instance

Deferred: Used when tablespaces are taken offline immediate,

temporary, or for recovery

Trang 8

Automatic Undo Management: Concepts

Undo data is managed using an UNDO tablespace.

You allocate one UNDO tablespace per instance with enough space for the workload of the instance.

The Oracle server automatically maintains undo data within the UNDO tablespace.

Trang 9

Automatic Undo Management: Configuration

Configure two parameters in the initialization file:

Trang 10

Automatic Undo Management:

Trang 11

Automatic Undo Management:

UNDO Tablespace

Create the UNDO tablespace with the database by

adding a clause in the CREATE DATABASE command:

Or create it later by using the CREATE UNDO

CREATE DATABASE db01

.

UNDO TABLESPACE undo1

DATAFILE '/u01/oradata/undoldb01.dbf' SIZE 20M AUTOEXTEND ON

CREATE UNDO TABLESPACE undo1

DATAFILE '/u01/oradata/undo1db01.dbf'

Trang 12

Automatic Undo Management:

Altering an UNDO Tablespace

The ALTER TABLESPACE command can make changes to UNDO

tablespaces.

The following example adds another data file to the UNDO tablespace:

ALTER TABLESPACE undotbs

ADD DATAFILE '/u01/oradata/undotbs2.dbf'

SIZE 30M

AUTOEXTEND ON;

Trang 13

Automatic Undo Management:

Switching UNDO Tablespaces

You can switch from using one UNDO tablespace to another.

Only one UNDO tablespace can be in assigned to a database at a time.

More than one UNDO tablespace may exist within an instance, but only one can be active.

Use the ALTER SYSTEM command for dynamic switching between UNDO tablespaces.

ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS2;

Trang 14

Automatic Undo Management:

Dropping an UNDO Tablespace

The DROP TABLESPACE command drops an UNDO tablespace.

An UNDO tablespace can only be dropped if it is currently not in use by any instance.

To drop an active UNDO tablespace:

Switch to a new UNDO tablespace.

Drop the tablespace after all current transactions are

complete.

DROP TABLESPACE UNDOTBS2;

Trang 15

Automatic Undo Management:

Other Parameters

UNDO_SUPPRESS_ERRORS parameter:

Set to TRUE, this parameter suppresses errors while attempting to execute manual operations in AUTO mode.

UNDO_RETENTION parameter:

This parameter controls the amount of undo data to

retain for consistent read.

Trang 16

Undo Data Statistics

SELECT end_time,begin_time,undoblks

FROM v$undostat;

END_TIME BEGIN_TIME UNDO - - - 22-JAN-01 13:44:18 22-JAN-01 13:43:04 19 22-JAN-01 13:43:04 22-JAN-01 13:33:04 1474 22-JAN-01 13:33:04 22-JAN-01 13:23:04 1347 22-JAN-01 13:23:04 22-JAN-01 13:13:04 1628 22-JAN-01 13:13:04 22-JAN-01 13:03:04 2249 22-JAN-01 13:03:04 22-JAN-01 12:53:04 1698 22-JAN-01 12:53:04 22-JAN-01 12:43:04 1433 22-JAN-01 12:43:04 22-JAN-01 12:33:04 1532 22-JAN-01 12:33:04 22-JAN-01 12:23:04 1075

Trang 17

Automatic Undo Management:

Sizing an UNDO Tablespace

Determining a size for the UNDO tablespace requires three pieces of information:

(UR) UNDO_RETENTION in seconds

(UPS) Number of undo data blocks generated per second

(DBS) Overhead varies based on extent and file size (db_block_size)

Trang 18

Automatic Undo Management:

UNDO_POOL, a Resource Manager directive, defines the amount of space

allowed for a resource group.

When a group exceeds its limit, no new transactions are possible for the group, until undo space is freed by current transactions which are either completing or aborting.

Trang 19

Obtaining Undo Segment Information

Information about undo segments can be obtained by querying the following views:

Trang 20

Summary

In this lesson, you should have learned how to:

Configure Automatic Undo Management

Create an UNDO tablespace

Properly size an UNDO tablespace

Obtain undo segment information

Trang 21

Practice 10 Overview

This practice covers the following topics:

Creating an UNDO tablespace

Switching between UNDO tablespaces

Dropping an UNDO tablepsace

Ngày đăng: 17/02/2014, 14:20

TỪ KHÓA LIÊN QUAN

w