Oracle 并发和并行中的Undo 详细使用说明
无论什么时候进程或者用户回话修改过数据库里面的数据,Oracle把它(数据库中的数据)被修改以前的存在过的旧值保存为undo data。
无论什么时候进程或者用户回话修改过数据库里面的数据,Oracle把它(数据库中的数据)被修改以前的存在过的旧值保存为undo data。这种设计为数据库使用者提供给了很多好处。
理解UNDO段(undo segments)
Undo Segments 也叫做rollback segments,在数据库中和其他的段的概念相似,就像表段,索引段。因为undo segments 也是用扩展(extents)组成,这也是有数据块依次组成。一个undo段也是装载的数据和表的数据类似。然而,这是相似之处。undo段必须被保存在的定类型的表空间,乘坐 undo tablespace。 尽管一个数据库可以拥有超过一个undo 表空间,但是同一个时刻只能有一个表空间是活动状态。undo 段搜集包含在一个事物中的一个或者许多表的undo信息。而且undo表空间按照需要自动增大或者减小,就像循环缓冲区。在一个undo段中填满扩展的是能回到段的开始,如果段的第一个扩展没有被活跃的事物使用。
在每个事物的开始,换句话说,当地一个数据库操纵语言(DML)命令在预先的一个提交前被发起,,或者用户第一次请求数据库链接——事物被指派给一个在undo表空间的undo段。对任何表的任何改变在事物中,被记录到指派的undo段中。目前活跃的undo段的名字能被从动态性能视图v$rollname查询,你应该能看到类似下面的内容。
ps:数据字典视图DBA_ROLLBACK_SEGS显示在线的和不在线的所有的undo 段在system和undo段中的。
使用undo数据
undo数据是数据库中的旧值,当进程或者用书改变了一个表或者索引。undo数据为oracle 数据库的以下四个目标服务:
1、用户回滚一个事务;
2、DML操作和查询的读一致性;
3、数据库恢复操作;
4、flashback功能。
使用事务回滚
在第一章中,你了解了事务和他们怎样在数据库机构中被管理的。 在用户层,你可能有一个或者几百个DML命令(就像 DELETE ,INSERT ,UPDATE,or MERGE)在一个特定的事务中,这些事务需要被标记为修改了一个或者多个表的一个进程或者用户所重做。 undo一个事务中的改变叫做回滚部分部分或者全部的事务。必须被回滚的改变被称作undo信息,回滚信息被存储在特别类型的表空间中,称作undo表空间。
当一个完整的事务被回滚,oracle回滚了所有事务开始的改变,使用保存的undo表空间中的回滚信息,释放包括在事务中的任何锁,并且结束事务。
如果失败发生在客户端或者网络上,异常终止了用户到数据库的链接,undo信息被一很多相同的方式使用,就像用户显示显示回滚事务一样。oracle使用事物开始保存在undo表空间中的信息撤销所有的改变。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to check which table space a table belongs to in Oracle: 1. Use the "SELECT" statement and specify the table name to find the table space to which the specified table belongs; 2. Use the database management tools provided by Oracle to check the table space to which the table belongs. Tools usually provide a graphical interface, making the operation more intuitive and convenient; 3. In SQL*Plus, you can view the table space to which the table belongs by entering the "DESCRIBEyour_table_name;" command.

Overview of how to use PDO to connect to Oracle database: PDO (PHPDataObjects) is an extension library for operating databases in PHP. It provides a unified API to access multiple types of databases. In this article, we will discuss how to use PDO to connect to an Oracle database and perform some common database operations. Step: Install the Oracle database driver extension. Before using PDO to connect to the Oracle database, we need to install the corresponding Oracle

Steps for Oracle to fetch only one piece of duplicate data: 1. Use the SELECT statement combined with the GROUP BY and HAVING clauses to find duplicate data; 2. Use ROWID to delete duplicate data to ensure that accurate duplicate data records are deleted, or use "ROW_NUMBER" ()" function to delete duplicate data, which will delete all records except the first record in each set of duplicate data; 3. Use the "select count(*) from" statement to return the number of deleted records to ensure the result.

Implementing data import into PHP and Oracle databases In web development, using PHP as a server-side scripting language can conveniently operate the database. As a common relational database management system, Oracle database has powerful data storage and processing capabilities. This article will introduce how to use PHP to import data into an Oracle database and give corresponding code examples. First, we need to ensure that PHP and Oracle database have been installed, and that PHP has been configured to

How to efficiently use connection pooling in PHP and Oracle databases Introduction: When developing PHP applications, using a database is an essential part. When interacting with Oracle databases, the use of connection pools is crucial to improving application performance and efficiency. This article will introduce how to use Oracle database connection pool efficiently in PHP and provide corresponding code examples. 1. The concept and advantages of connection pooling Connection pooling is a technology for managing database connections. It creates a batch of connections in advance and maintains a

The oracle database requires jdk. The reasons are: 1. When using specific software or functions, other software or libraries included in the JDK are required; 2. Java JDK needs to be installed to run Java programs in the Oracle database; 3. JDK provides Develop and compile Java application functions; 4. Meet Oracle's requirements for Java functions to help implement and implement specific functions.

How to use PHP to extend PDO to connect to Oracle database Introduction: PHP is a very popular server-side programming language, and Oracle is a commonly used relational database management system. This article will introduce how to use PHP extension PDO (PHPDataObjects) to connect to Oracle database. 1. Install the PDO_OCI extension. To connect to the Oracle database, you first need to install the PDO_OCI extension. Here are the steps to install the PDO_OCI extension: Make sure

Oracle's steps to determine whether a table exists in a stored procedure: 1. Use the "user_tables`" system table to query the table information under the current user, compare the incoming table name "p_table_name" with the "table_name" field, and if the conditions are met, then "COUNT(*)" will return a value greater than 0; 2. Use the "SET SERVEROUTPUT ON;" statement and the "EXEC`" keyword to execute the stored procedure and pass in the table name to determine whether the table exists.
