在 Oracle 中禁用重做日志对 Hibernate 事务有什么影响?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1394718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the effects of disabling the redo logs in Oracle on Hibernate transactions?
提问by Monis Iqbal
If we disable the 'redo logs' of a tablespace in Oracle, will they impact Hibernate's transactions? These are the options present in the Oracle EM on a tablespace level:
如果我们在 Oracle 中禁用表空间的“重做日志”,它们会影响 Hibernate 的事务吗?这些是 Oracle EM 中表空间级别的选项:
Enable logging Yes Generate redo logs for creation of tables, indexes and partitions, and for subsequent inserts. Recoverable No Redo log entries are smaller, the above operations are not logged and not recoverable.
启用日志记录 是 为创建表、索引和分区以及后续插入生成重做日志。Recoverable No Redo 日志条目较小,以上操作不记录且不可恢复。
Also, is Oracle's commit/rollback functionality dependent upon these redo logs?
此外,Oracle 的提交/回滚功能是否依赖于这些重做日志?
回答by APC
Redo logs have nothing to do with transactions. They are there for recovering your database in the event of a crash or an OS file corruption. If you don't have redo logging on, then if anything goes wrong with the database your users will lose all their work since the last good back up.
重做日志与事务无关。它们用于在发生崩溃或操作系统文件损坏时恢复您的数据库。如果您没有重做登录,那么如果数据库出现任何问题,您的用户将丢失自上次备份以来所做的所有工作。
Normally we would only want to disable logging on a tablespace prior to a bulk data load. The first action after that load would be to take a backup and then re-enable logging. Not logging in a transactional system is a very bad idea.
通常我们只想在批量数据加载之前禁用表空间的日志记录。加载后的第一个操作是进行备份,然后重新启用日志记录。不登录交易系统是一个非常糟糕的主意。
回答by Vincent Malgrat
Redo logs are an integrated part of the Oracle RDBMS, you can disable them in only a few special cases:
重做日志是 Oracle RDBMS 的一个集成部分,您只能在少数特殊情况下禁用它们:
- bulk load of data,
- creating/recreating of indexes
- 批量加载数据,
- 创建/重新创建索引
If you disable the generation of redo logs for one of these operations, you will lose the ability to recover your database fully after this point (ie: you should immediately backup your database after those batch jobs are complete).
如果您为这些操作之一禁用重做日志的生成,您将失去在此之后完全恢复数据库的能力(即:您应该在这些批处理作业完成后立即备份您的数据库)。
You can not disable the generation of redo for simple transactions. You wouldn't want to anyway, since they allow the database to recover after a crashed instance (online redo log, even if you are in NOARCHIVELOG) and allow media recovery after a crashed disk for example (archived redo log, only in ARCHIVELOG).
您不能禁用简单事务的重做生成。您无论如何都不想这样做,因为它们允许数据库在实例崩溃后恢复(在线重做日志,即使您在 NOARCHIVELOG 中)并允许在磁盘崩溃后进行媒体恢复,例如(归档重做日志,仅在 ARCHIVELOG 中) .