EXP的consistent参数

CONSISTENT
默认值:n
使用SET TRANSACTION READ ONLY语句限制数据以保证一致读,确保导出的数据在同一个时间点上。在导出开始后,如果有其他应用试图更改数据,我们就应该在exp命令中指定CONSISTENT=y 。
当consistent=n时,每张表一般都是一个导出事务。然而,如果表时nest表,outer表和inner表会被不同的事务分开导出,如果是分区表,也会有同样的效果。因此,如果nest表和分区表被其他事务update,导出的数据可能是不一致的。为了最小化数据不一致的可能,导出的时候应该选择在没有事务处理的时候。


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.CONSISTENT=y 不支持SYS用户或者SYSDBA权限?
? 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.导出指定元数据时可能使用递归SQL涉及SYS schema。?
? 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.为了优化时间和空间,我们应该在导出表的时候保持数据的一致性。比如,一致性导出emp表和dept表,然后其他对象可以在另一个导出语句中导出。简而言之,导出数据时应该保持数据一致性,甚至可以多段导出数据来保证数据不会紊乱。?
? 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, then 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.回滚段使用告急时会出现“快照太久”的错误,在导出的时候需使用回滚段。如果已提交的事务的回滚段已经被覆盖但是又需要使用其数据来保持一致性读取,这个时候就会发生“快照太久”的错误。为了避免这个错误,我们需要尽量少的开销导出时间(限制导出的对象数目,减少事务发生率等),设置回滚段足够大。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31461640/viewspace-2141554/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31461640/viewspace-2141554/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ConsistentHash是一种在分布式系统中解决数据分片、负载均衡的算法,用于解决数据分布和节点动态变化的问题。在Java中,可以通过实现ConsistentHash算法来分配数据并达到负载均衡的效果。 在Java中,可以使用TreeMap或者HashMap作为底层数据结构来实现ConsistentHash算法。TreeMap可以保证数据有序性,HashMap则可以提供更快的插入和查询速度。我们在这里以TreeMap为例来说明ConsistentHash的实现过程。 首先,我们需要创建一个哈希函数,将节点的IP地址或者ID映射为整数,作为节点的哈希值。然后,我们在TreeMap中存储节点的哈希值和对应的物理节点信息。 当有新的数据需要插入时,将数据的哈希值通过哈希函数计算得到对应的整数。然后,在TreeMap中找到大于等于该哈希值的最小键值对应的物理节点,将数据保存在该节点上。 当节点动态增加或删除时,我们需要重新计算所有已存在数据的哈希值,并将数据重新分配到新的节点上,以保持数据的均匀分布。 通过使用ConsistentHash算法,我们可以实现数据的分片存储和负载均衡,使得在节点动态变化的情况下,系统的性能和可扩展性得到有效的提升。 总之,ConsistentHash算法是一种在分布式系统中解决数据分片、负载均衡问题的算法。在Java中,我们可以通过实现ConsistentHash算法,使用TreeMap或者HashMap来实现数据分配和节点动态变化的管理。这样可以有效提高系统的性能和可扩展性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值