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.

目录
相关文章
|
3月前
|
canal 缓存 关系型数据库
高并发场景下,6种方案,保证缓存和数据库的最终一致性!
在解决缓存一致性的过程中,有多种途径可以保证缓存的最终一致性,应该根据场景来设计合适的方案,读多写少的场景下,可以选择采用“Cache-Aside结合消费数据库日志做补偿”的方案,写多的场景下,可以选择采用“Write-Through结合分布式锁”的方案,写多的极端场景下,可以选择采用“Write-Behind”的方案。
683 0
|
4月前
|
SQL 关系型数据库 MySQL
深入理解MySQL事务特性:保证数据完整性与一致性
深入理解MySQL事务特性:保证数据完整性与一致性
659 1
|
4月前
|
监控 NoSQL Redis
RedisShake如何处理数据同步过程中的冲突和一致性问题
RedisShake保障数据同步一致性,支持全量和增量同步,处理并发冲突(利用乐观锁机制),并进行数据校验。遇到故障能自动恢复和重试,保证不间断同步。同时,提供监控和日志功能,便于识别和解决问题,确保数据完整性。
168 0
|
11月前
|
消息中间件 存储 算法
Flink---13、容错机制(检查点(保存、恢复、算法、配置)、状态一致性、端到端精确一次)
Flink---13、容错机制(检查点(保存、恢复、算法、配置)、状态一致性、端到端精确一次)
|
分布式数据库 数据库
复制延迟案例(1)-最终一致性
该案例违反因果律。 想象先生和夫人之间的对话: Mr Mrs,你能看到多远未来? Mrs 通常约10s,Mr.
84 0
|
存储 SQL 关系型数据库
TiDB用什么保证备份的一致性?
TiDB用什么保证备份的一致性?
393 0
TiDB用什么保证备份的一致性?
|
关系型数据库 数据库 PostgreSQL
PostgreSQL 数据库数据文件BLOCK一致性校验、备份集恢复后的有效性快速校验 - pg_verify_checksums
PostgreSQL 数据库数据文件BLOCK一致性校验、备份集恢复后的有效性快速校验 - pg_verify_checksums
2501 0
|
监控 关系型数据库 测试技术
PostgreSQL 双节点流复制如何同时保证可用性、可靠性(rpo,rto) - (半同步,自动降级方法实践)
PostgreSQL 双节点流复制如何同时保证可用性、可靠性(rpo,rto) - (半同步,自动降级方法实践)
1256 0
|
数据库 缓存 数据库连接
缓存与数据库一致性保证
上一篇《缓存架构设计细节二三事》(点击查看)引起了广泛的讨论,其中有一个结论:当数据发生变化时,“先淘汰缓存,再修改数据库”这个点是大家讨论的最多的。
808 0
|
SQL 关系型数据库 MySQL
mysqldump如果保证一致性
mysqldump 运行mysqldump需一定的权限。如,备份表的最低权限为select,备份触发器需show triggers权限。 (1)备份结果文件命令规范:dbname_port_$(date +%Y%m%d).
1177 0