OCP knowledge point explanation-basic knowledge of Undo rollback

Source: Internet
Author: User
1. What is a rollback segment? 1. rollback segment table space. The official name of Oracle is "Restore table space": You can restore multiple tablespaces. However, at any time, only one tablespace can be restored ..

1. What is a rollback segment? 1. rollback segment table space. The official name of Oracle is "Restore table space": You can restore multiple tablespaces. However, at any time, only one tablespace can be restored ..

1. What is a rollback segment?

1. For the tablespace In the rollback segment, Oracle officially calls "restoring tablespace ":


2. rollback segment:

In Oracle, the virtual host segment is the highest layer in the logical structure. A table is a segment, which is called a table segment, and an index is an index segment. The rollback segment is also a segment. we can regard it as a table, a table created by the system.

By default, the system creates 11 rollback segments. Of course, if the restored tablespace is too small, the number of rollback segments by default may be smaller than this number. You can view their names as follows:

Sys @ MYTWO> select * from v $ rollname;

USN NAME

----------------------------------------

0 SYSTEM

11_syssmu11 $

12 _ SYSSMU12 $

::

::

19 _ SYSSMU19 $

20_syssmu20 $

11 rows have been selected.


Switch the active tablespace to UNDOTBS3:

Sys @ MYTWO> select * from v $ rollname;

USN NAME

----------------------------------------

0 SYSTEM

23 _ SYSSMU23 $

24 _ SYSSMU24 $

25 _ SYSSMU25 $


Since UNDOTBS3 only has 512 KB, only three rollback segments are created by default.

The number of rollback segments in the restored tablespace is adjusted as needed. When the system is busy, more rollback segments will be automatically created, and the system will automatically recycle the rollback segments when the system is idle. We can also see the creation and recovery of rollback segments in the alarm log.


3. Observe the UNDOTBS3 rollback segment:

UNDOTBS3 is the tablespace that needs to be restored frequently in subsequent exercises. It consists of 128 kb and blocks. Next, we will use DBA_UNDO_EXTENTS to observe the area occupation of the rollback segment in UNDOTBS3:

----------------------------------------------------------------------------------------------------------------------------


From the above results, we can see that _ SYSSMU25 $ the rollback segment occupies two zones. The No. 0 zone starts from block 82nd to block 96, with a total of 15 blocks. Block 1 starts from block 97 and ends with block 112. There are 16 blocks in total. Why is there one more block in area 1 than area 0? This is because 81st blocks are used as the rollback segment header, and the rollback segment header needs to save important information: transaction table, which will be mentioned soon. Rollback records can be saved from block 82nd. We can also get the same result from DBA_EXTENTS.

Use the following command to observe each rollback segment in UNDOTBS3 and draw a brief diagram about the space usage of each rollback segment, you must have an impression on the segments and segments of these rollback segments so that you can better understand the content of the following chapters.

In UNDOTBS3, each rollback segment occupies two zones. This is because the rollback segment is usually the minimum of two zones.


Ii. related parameters:

1. UNDO_MANAGEMENT: this parameter determines the Undo space management mode. This parameter is a static parameter (cannot be modified dynamically ). If it is set to MANUAL, rollback-managed undo (RMU) management mode is used; if it is set to AUTO, system-managed undo (SMU) or automatically managed undo (AMU) are used) management Mode. In Oracle 9i Database, AUTO is the default value.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.