Oracle SQL Developer 中的旧 SQL 历史记录

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

Old SQL History in Oracle SQL Developer

oracleoracle-sqldeveloper

提问by user3035077

In SQL Developer, i was finding some SQL commands of previous month but not able to find that as it is showing only the records of last 4-5 days.

在 SQL Developer 中,我找到了上个月的一些 SQL 命令,但无法找到,因为它只显示最近 4-5 天的记录。

Is there any way to find the old SQL commands those are not displaying under SQL history tab.

有什么方法可以找到那些没有在 SQL 历史记录选项卡下显示的旧 SQL 命令。

Thanks.

谢谢。

回答by Patrick Bacon

As Oracle has documented, there is a SQL history folder and it is larger (has more SQL queries that go back about a year) than the SQL History tool bar (a couple of months).

正如 Oracle 所记录的那样,有一个 SQL 历史文件夹,它比 SQL 历史工具栏(几个月)更大(有更多的 SQL 查询可以追溯到大约一年)。

Here is the content of my SQL History tool bar:

这是我的 SQL History 工具栏的内容:

SQL History tool bar

SQL 历史记录工具栏

With respect to the SQL history folder, release notes cite this location in Windows 7:

关于 SQL 历史文件夹,发行说明在 Windows 7 中引用了这个位置:

C:\Users\your_user_name\AppData\Roaming\SQL Developer\SqlHistory

C:\Users\your_user_name\AppData\Roaming\SQL Developer\SqlHistory

While this folder contains SQL History, it also contains: User-defined reports and user-defined snippets files (e.g. see 3.1 Sql Developer release notes) Here is my SQL History folder:

虽然此文件夹包含 SQL 历史记录,但它还包含: 用户定义的报告和用户定义的片段文件(例如,请参阅 3.1 Sql Developer 发行说明)这是我的 SQL 历史记录文件夹:

My SQL History folder

我的 SQL 历史记录文件夹

I do not see any documentation to adjust the size of either.

我没有看到任何调整两者大小的文档。

回答by Alberto Cerqueira

You can try

你可以试试

View > History SQL

查看 > 历史 SQL

For example, look this picture: enter image description here

例如,看这张图: 在此处输入图片说明

回答by MiguelKVidal

In SQL Developer, to change the limit go to: Tools -> Preferences.

在 SQL Developer 中,要更改限制,请转到: Tools -> Preferences

Inside this, navigate to:

在这个里面,导航到:

Database –> Worksheet –> SQL History Limit

Change it to whatever you want. (In 4.0.1.14, the max was 999999999.)

将其更改为您想要的任何内容。(在 4.0.1.14 中,最大值为 999999999。)

Hope it helps.

希望能帮助到你。

Best regards.

此致。

回答by Roberto Garcia

Well, I think there is another option like this:

好吧,我认为还有另一种选择:

In SQL Developer> View menu: In SQL Developer>View menu

在 SQL Developer > 查看菜单中: 在 SQL Developer >查看菜单中

Then, go to file option: Then, go to file option

然后,转到文件选项: 然后,转到文件选项

and you got recent file tab: and you got recent file tab

你有最近的文件标签: 你有最近的文件标签

回答by Lalit Kumar B

If your queries are still in the shared_pool, you can use v$sqland v$sqlarea. They would be flushed out regularly, but you can find them till that period of time.

如果您的查询仍在 shared_pool 中,则可以使用v$sqlv$sqlarea。它们会定期冲洗掉,但在此之前您可以找到它们。