exp能在什么级别保证备份数据的一致性呢?

简介: 如果库很大,exp的时间很长,库中已经发生了很多改变,exp需要依赖undo吗?如果exp能保证备份数据的一致性,那么能在什么级别保证呢?是表级别、用户级别,还是整个db级别? 对于数据库而言 exp/imp是“拍照留念”archivelog mode的物理backup是“录像记录”。
如果库很大,exp的时间很长,库中已经发生了很多改变,exp需要依赖undo吗?
如果exp能保证备份数据的一致性,那么能在什么级别保证呢?是表级别、用户级别,还是整个db级别?

对于数据库而言
exp/imp是“拍照留念”
archivelog mode的物理backup是“录像记录”。
拍照只能是单点的,而“录像记录”允许你看到录像期间的任何一点-----引自网络

1) exp 是包含表级别的数据完整性;也即导出那一刻的表的快照;也就说明肯定会用undo的数据
1)可以用CONSISTENT该选项保证交叉表的一致性
3)可以用FLASHBACK_SCN保证exp这批数据的一致性
CONSISTENT=y时,确实会出现:
A "snapshot too old" error occurs when rollback space is used up

================================

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 export 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 specify CONSISTENT=N (the default), 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.

The following chart shows a sequence of events by two users: USER1 exports partitions in a table and USER2 updates data in that table.

Time Sequence  USER1  USER2  
1  
Begins export of TAB:P1  
2  
Updates TAB:P2
Updates TAB:P1
Commit transaction  
3  
Ends export of TAB:P1  
4  
Exports TAB:P2  
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, USER2's 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 will be large. In addition, the export of each table will be slower because the rollback segment must be scanned for uncommitted transactions.

  Restrictions
You cannot specify CONSISTENT=Y with an incremental export.

CONSISTENT=Y is unsupported for exports performed using AS SYSDBA.

Keep in mind the following points about using CONSISTENT=Y:

   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.

目录
相关文章
|
12天前
|
监控 NoSQL Redis
RedisShake如何处理数据同步过程中的冲突和一致性问题
RedisShake保障数据同步一致性,支持全量和增量同步,处理并发冲突(利用乐观锁机制),并进行数据校验。遇到故障能自动恢复和重试,保证不间断同步。同时,提供监控和日志功能,便于识别和解决问题,确保数据完整性。
12 0
|
1月前
|
SQL 关系型数据库 MySQL
深入理解MySQL事务特性:保证数据完整性与一致性
深入理解MySQL事务特性:保证数据完整性与一致性
81 1
|
4月前
|
关系型数据库 数据库 RDS
为了确保数据的完整性和准确性,建议您在进行数据迁移前,充分理解源数据库和目标数据库的特性以及迁移过程中可能出现的问题
为了确保数据的完整性和准确性,建议您在进行数据迁移前,充分理解源数据库和目标数据库的特性以及迁移过程中可能出现的问题
40 1
|
4月前
|
存储 测试技术 Linux
存储稳定性测试与数据一致性校验工具和系统
LBA tools are very useful for testing Storage stability and verifying DATA consistency, there are much better than FIO & vdbench's verifying functions.
915 0
|
6月前
|
消息中间件 存储 算法
Flink---13、容错机制(检查点(保存、恢复、算法、配置)、状态一致性、端到端精确一次)
Flink---13、容错机制(检查点(保存、恢复、算法、配置)、状态一致性、端到端精确一次)
|
11月前
|
存储 移动开发 运维
无主复制系统(3)-Quorum一致性的局限性
若有n个副本,且配置w和r,使得w + r > n w + r> nw+r>n,期望可以读到一个最新值。因为成功写入的节点集合和读取的节点集合必有重合,这样读取的节点中至少有一个具有最新值,如图-11。
96 0
|
11月前
|
分布式数据库 数据库
复制延迟案例(1)-最终一致性
该案例违反因果律。 想象先生和夫人之间的对话: Mr Mrs,你能看到多远未来? Mrs 通常约10s,Mr.
68 0
|
存储 SQL 关系型数据库
TiDB用什么保证备份的一致性?
TiDB用什么保证备份的一致性?
359 0
TiDB用什么保证备份的一致性?
|
监控 关系型数据库 测试技术
PostgreSQL 双节点流复制如何同时保证可用性、可靠性(rpo,rto) - (半同步,自动降级方法实践)
PostgreSQL 双节点流复制如何同时保证可用性、可靠性(rpo,rto) - (半同步,自动降级方法实践)
1156 0