如何查看 Oracle 表日志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/677052/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:58:13  来源:igfitidea点击:

How to see Oracle Table Logs?

databaseoraclelogging

提问by IAdapter

I look at a table's properties in Oracle and it has "LOGGING: YES". How can I query that log, or if it's in a file, where can I find it?

我在 Oracle 中查看了一个表的属性,它有“LOGGING: YES”。我如何查询该日志,或者如果它在一个文件中,我在哪里可以找到它?

回答by Matthew Watson

Logging on a table just means that all DML on the table will generate REDO, eg, if the server crashes the table will be recoverable. If you have LOGGING turned off, then some types of DML (direct load) will not cause redo, and may not be recoverable after a crash.

登录一个表只是意味着该表上的所有 DML 都会生成 REDO,例如,如果服务器崩溃,该表将是可恢复的。如果您关闭了 LOGGING,那么某些类型的 DML(直接加载)将不会导致重做,并且在崩溃后可能无法恢复。

This option is something that you would mainly use in a data warehouse I believe.

我相信这个选项主要用于数据仓库。

A good article on it can be found here

可以在这里找到一篇关于它的好文章

回答by David Aldridge

I'll echo Matthew's reply, but also add that you can sort-of query the "log" by using the Flashback Query syntax. You're really querying the undo rather than the redo, of course, and performance is nothing spectacular. 11g has significant enhancements.

我会回应 Matthew 的回复,但还要补充一点,您可以使用闪回查询语法对“日志”进行排序查询。当然,您实际上是在查询撤消而不是重做,而且性能并不出色。11g 有显着的增强。

回答by David Aldridge

You can also turn Auditing on. That can audit INS/UPD/DEL/SEL both successes and/or failures. It can write the results to a table or to the file system.

您也可以打开审核。这可以审计 INS/UPD/DEL/SEL 成功和/或失败。它可以将结果写入表或文件系统。