CONSISTENT
Default: n
Specifies whether or not Export uses the SET TRANSACTION READ ONLY statement to ensure that the data seen by Export is consistent to a single point in time and does not change during the execution of the exp command. You should specify CONSISTENT=y when you anticipate that other applications will be updating the target data after an export has started.
If you use CONSISTENT=n, each table is usually exported in a single transaction. However, if a table contains nested tables, the outer table and each inner table are exported as separate transactions. If a table is partitioned, each partition is exported as a separate transaction.
Therefore, if nested tables and partitioned tables are being updated by other applications, the data that is exported could be inconsistent. To minimize this possibility, export those tables at a time when updates are not being done.
Table 19-4 shows a sequence of events by two users: user1 exports partitions in a table and user2 updates data in that table.
Table 19-4 Sequence of Events During Updates by Two UsersTIme SequenceUser1User21Begins export of TAB:P1No activity
2No activityUpdates TAB:P2 Updates TAB:P1 Commits transaction
3Ends export of TAB:P1No activity
4Exports TAB:P2No activity
If the export uses CONSISTENT=y, none of the updates by user2 are written to the export file.
If the export uses CONSISTENT=n, the updates to TAB:P1 are not written to the export file. However, the updates to TAB:P2 are written to the export file, because the update transaction is committed before the export of TAB:P2 begins. As a result, the user2 transaction is only partially recorded in the export file, making it inconsistent.
If you use CONSISTENT=y and the volume of updates is large, the rollback segment usage will be large. In addition, the export of each table will be slower, because the rollback segment must be scanned for uncommitted transactions.
Keep in mind the following points about using CONSISTENT=y:CONSISTENT=y is unsupported for exports that are performed when you are connected as user SYS or you are using AS SYSDBA, or both.
Export of certain metadata may require the use of the SYS schema within recursive SQL. In such situations, the use of CONSISTENT=y will be ignored. Oracle recommends that you avoid making metadata changes during an export process in which CONSISTENT=y is selected.
To minimize the time and space required for such exports, you should export tables that need to remain consistent separately from those that do not. For example, export the emp and dept tables together in a consistent export, and then export the remainder of the database in a second pass.
A "snapshot too old" error occurs when rollback space is used up, and space taken up by committed transactions is reused for new transactions. Reusing space in the rollback segment allows database integrity to be preserved with minimum space requirements, but it imposes a limit on the amount of time that a read-consistent image can be preserved.
If a committed transaction has been overwritten and the information is needed for a read-consistent view of the database, a "snapshot too old" error results.
To avoid this error, you should minimize the time taken by a read-consistent export. (Do this by restricting the number of objects exported and, if possible, by reducing the database transaction rate.) Also, make the rollback segment as large as possible.
Note:Rollback segments will be deprecated in a future Oracle database release. Oracle recommends that you use automatic undo management instead.[@more@]
本文探讨了在数据库导出时使用CONSISTENT选项对数据一致性和并发更新的影响。当设置CONSISTENT=y,导出将保证在某一时间点的一致性,但可能增加回滚段使用和降低导出速度。如果CONSISTENT=n,更新可能被部分记录,导致数据不一致。建议在大量更新时谨慎使用CONSISTENT=y,并分开导出需要保持一致性的表。同时,为了避免'快照过旧'错误,应尽量减少读一致性导出的时间并扩大回滚段大小。Oracle推荐使用自动撤销管理来替代传统的回滚段。
1447

被折叠的 条评论
为什么被折叠?



