Transaction-Level Read Consistency (313)
Oracle also offers the option of enforcing transaction-level read consistency. When atransaction runs in serializable mode, all data accesses reflect the state of the databaseas of the time the transaction began. This means that the data seen by all querieswithin the same transaction is consistent with respect to a single point in time, exceptthat queries made by a serializable transaction do see changes made by the transactionitself. Transaction-level read consistency produces repeatable reads
Hints : DRIVING_SITE
The DRIVING_SITE hint forces query execution to be done at a different site than thatselected by Oracle. This hint can be used with either rule-based or cost-basedoptimization. Table is the name or alias for the table at which site the execution shouldtake place.SELECT /*+ DRIVING_SITE(DEPT) */ * FROM EMP, DEPT@RSITE WHERE EMP.DEPTNO = DEPT.DEPTNO;If this query is executed without the hint, rows from DEPT will be sent to the local siteand the join will be executed there. With the hint, the rows
Multiversion Concurrency Control (311)
Oracle automatically provides read consistency to a query so that all the data that thequery sees comes from a single point in time (statement-level read consistency).Oracle can also provide read consistency to all of the queries in a transaction(transaction-level read consistency).Oracle uses the information maintained in its rollback segments to provide theseconsistent views. The rollback segments contain the old values of data that have beenchanged by uncommitted or recently committed transac
Overview of Locking Mechanisms (310)
In general, multiuser databases use some form of data locking to solve the problems associated with data concurrency, consistency, and integrity. Locks are mechanisms that prevent destructive interaction between transactions accessing the same resource. Resources include two general types of objects: ■ User objects, such as tables and rows (structures and data) ■ System objects not visible to users, such as shared data structures in the memory and data dictionary rows锁机制1. 锁是一种防止多
Preventable Phenomena and Transaction Isolation Levels (309)
The ANSI/ISO SQL standard (SQL92) defines four levels of transaction isolation with differing degrees of impact on transaction processing throughput. These isolation levels are defined in terms of three phenomena that must be prevented between concurrently executing transactions. The three preventable phenomena are: ■ Dirty reads: A transaction reads data that has been written by another transaction that has not been committed yet. ■ Nonrepeatable (fuzzy) reads: A transaction rereads data it h
Introduction to Data Concurrency and Consistency in a Multiuser Environment (308)
In a single-user database, the user can modify data in the database without concern for other users modifying the same data at the same time. However, in a multiuser database, the statements within multiple simultaneous transactions can update the same data. Transactions executing at the same time need to produce meaningful and consistent results. Therefore, control of data concurrency and data consistency is vital in a multiuser database.■ Data concurrency means that many users can access data
Abnormal Instance Shutdown (307)
In unusual circumstances, shutdown of an instance might not occur cleanly; all memory structures might not be removed from memory or one of the background processes might not be terminated. When remnants of a previous instance exist, a subsequent instance startup most likely will fail. In such situations, the database administrator can force the new instance to start up by first removing the remnants of the previous instance and then starting a new instance, or by issuing a SHUTDOWN ABORT statem
Unmount a Database (305)
After the database is closed, Oracle unmounts the database to disassociate it from the instance. At this point, the instance remains in the memory of your computer. After a database is unmounted, Oracle closes the control files of the database. 卸载数据库1. 数据库被关闭后,Oracle 将卸载数据库,使之与实例分离 . 此时,实例依旧存在于计算机的内存中2. 数据库被卸载后,Oracle 将关闭数据库的控制文件[@more@]
Close the Database by Terminating the Instance (304)
In rare emergency situations, you can terminate the instance of an open database to close and completely shut down the database instantaneously. This process is fast, because the operation of writing all data in the buffers of the SGA to the datafiles and redo log files is skipped. The subsequent reopening of the database requires recovery, which Oracle performs automatically. 通过终止实例来关闭数据库1. 在紧急情况下,可以终止一个处于打开状态的数据库的实例,以便立即关闭并完全停止一个数据库2.
Shut Down an Instance (306)
The final step in database shutdown is shutting down the instance. When you shut down an instance, the SGA is removed from memory and the background processes are terminated. 关闭实例停止数据库的最后一个步骤是停止实例 , 关闭实例时,SGA 将被从内存中清除,后台进程将被终止.[@more@]
Close a Database (303)
When you close a database, Oracle writes all database data and recovery data in the SGA to the datafiles and redo log files, respectively. Next, Oracle closes all online datafiles and redo log files. (Any offline datafiles of any offline tablespaces have been closed already. If you subsequently reopen the database, any tablespace that was offline and its datafiles remain offline and closed, respectively.) At this point, the database is closed and inaccessible for normal operations. The control f
Overview of Database and Instance Shutdown (302)
The three steps to shutting down a database and its associated instance are: 1. Close the database. 2. Unmount the database. 3. Shut down the instance. A database administrator can perform these steps using Enterprise Manager. Oracle automatically performs all three steps whenever an instance is shut down. 数据库和实例的关闭1. 关闭数据库和相关实例的三个步骤如下 a. 关闭数据库 b. 卸载数据库 c. 停止实例[@more@]
Open a Database in Read-Only Mode (301)
You can open any database in read-only mode to prevent its data from being modified by user transactions. Read-only mode restricts database access to read-only transactions, which cannot write to the datafiles or to the redo log files. Disk writes to other files, such as control files, operating system audit trails, trace files, and alert logs, can continue in read-only mode. Temporary tablespaces for sort operations are not affected by the database being open in read-only mode. However, you can
Resolution of In-Doubt Distributed Transaction (300)
Occasionally a database closes abnormally with one or more distributed transactions in doubt (neither committed nor rolled back). When you reopen the database and recovery is complete, the RECO background process automatically, immediately, and consistently resolves any in-doubt distributed transactions. 解决拿不准的分布式事务1. 拿不准的分布式事务 : 数据库异常关闭时 , 一个或多个分布式事务既没有提交也没有回滚2. 重新打开数据库并完成恢复工作后 , RECO 后台进程将自动地处理拿不准的分布式事务[@
Undo Space Acquisition and Management (299)
When you open the database, the instance attempts to acquire one or more undo tablespaces. You determine whether to operate in automatic undo management mode or manual undo management mode at instance startup using the UNDO_MANAGEMENT initialization parameter. The supported values are AUTO or MANUAL. If AUTO, then the instance is started in automatic undo management mode. The default value is MANUAL.■ If you use the undo tablespace method, then you are using automatic undo management mode. This
Instance Recovery (298)
If the database was last closed abnormally, either because the database administrator terminated its instance or because of a power failure, then Oracle automatically performs recovery when the database is reopened.实例恢复数据库非正常关闭 , 当数据库重新打开的时候Oracle自动进行恢复[@more@]
What Happens When You Open a Database (297)
Opening a mounted database makes it available for normal database operations. Anyvalid user can connect to an open database and access its information. Usually, adatabase administrator opens the database to make it available for general use.When you open the database, Oracle opens the online datafiles and redo log files. If atablespace was offline when the database was previously shut down, the tablespaceand its corresponding datafiles will still be offline when you reopen the database.If any of
How a Clone Database Is Mounted (296)
A clone database is a specialized copy of a database that can be used for tablespacepoint-in-time recovery. When you perform tablespace point-in-time recovery, youmount the clone database and recover the tablespaces to the desired time, then exportmetadata from the clone to the primary database and copy the datafiles from therecovered tablespaces.克隆数据库如何装载1. 克隆数据库可用于按时间点恢复2. 当用户按时间点恢复表空间时,需要将克隆数据库装载 , 将其中的表空间恢复到期望的时间,然后将克隆
How a Standby Database Is Mounted (295)
A standby database maintains a duplicate copy of your primary database and provides continued availability in the event of a disaster. The standby database is constantly in recovery mode. To maintain your standby database, you must mount it in standby mode using the ALTER DATABASE statement and apply the archived redo logs that your primary database generates. You can open a standby database in read-only mode to use it as a temporary reporting database. You cannot open a standby databa
How a Database Is Mounted with Real Application Clusters (294)
If Oracle allows multiple instances to mount the same database concurrently, then thedatabase administrator can use the CLUSTER_DATABASE initialization parameter tomake the database available to multiple instances. The default value of the CLUSTER_DATABASE parameter is false. Versions of Oracle that do not support RealApplication Clusters only allow CLUSTER_DATABASE to be false.If CLUSTER_DATABASE is false for the first instance that mounts a database, thenonly that instance can mount the datab