如何在 Oracle SQL Developer 中增加缓冲区大小以查看所有记录?

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

How to increase buffer size in Oracle SQL Developer to view all records?

sqloracleoracle11goracle-sqldeveloper

提问by PacificNW_Lover

How to increase buffer size in Oracle SQL Developer to view all records (there seems to be a certain limit set at default)? Any screen shots and/or tips will be very helpful.

如何在 Oracle SQL Developer 中增加缓冲区大小以查看所有记录(默认情况下似乎设置了一定的限制)?任何屏幕截图和/或提示都会非常有帮助。

回答by Ollie

https://forums.oracle.com/forums/thread.jspa?threadID=447344

https://forums.oracle.com/forums/thread.jspa?threadID=447344

The pertinent section reads:

相关部分写道:

There's no setting to fetch all records. You wouldn't like SQL Developer to fetch for minutes on big tables anyway. If, for 1 specific table, you want to fetch all records, you can do Control-End in the results pane to go to the last record. You could time the fetching time yourself, but that will vary on the network speed and congestion, the program (SQL*Plus will be quicker than SQL Dev because it's more simple), etc.

没有设置来获取所有记录。无论如何,您不希望 SQL Developer 在大表上提取几分钟。如果,对于 1 个特定表,您想要获取所有记录,您可以在结果窗格中执行 Control-End 以转到最后一条记录。您可以自己计算获取时间,但这会因网络速度和拥塞情况、程序(SQL*Plus 将比 SQL Dev 更快,因为它更简单)等而有所不同。

There is also a button on the toolbar which is a "Fetch All" button.

工具栏上还有一个按钮,它是一个“ Fetch All”按钮。

FWIW Be careful retrieving all records, for a very large recordset it could cause you to have all sorts of memory issues etc.

FWIW 小心检索所有记录,对于非常大的记录集,它可能会导致您遇到各种内存问题等。

As far as I know, SQL Developer uses JDBC behind the scenes to fetch the records and the limit is set by the JDBC setMaxRows()procedure, if you could alter this (it would prob be unsupported) then you might be able to change the SQL Developer behaviour.

据我所知,SQL Developer 在幕后使用 JDBC 来获取记录,并且限制是由 JDBCsetMaxRows()过程设置的,如果您可以更改此设置(可能不受支持),那么您也许可以更改 SQL Developer 的行为.

回答by Don

Select Tools > Preferences > Database / Advanced

选择工具 > 首选项 > 数据库/高级

There is an input field for Sql Array Fetch Size but it only allows setting a max of 500 rows.

Sql Array Fetch Size 有一个输入字段,但它最多只允许设置 500 行。

回答by Frank InOregon

If you are running a script, instead of a statement, you can increase this by selecting Tools/Preferences/Worksheet and increasing "Max Rows to print in a script". The default is 5000, you can change it to any size.

如果您正在运行脚本而不是语句,您可以通过选择工具/首选项/工作表并增加“在脚本中打印的最大行数”来增加它。默认为 5000,您可以将其更改为任意大小。

回答by TomG

You can also edit the preferences file by hand to set the Array Fetch Size to any value.

您还可以手动编辑首选项文件以将 Array Fetch Size 设置为任何值。

Mine is found at C:\Users\<user>\AppData\Roaming\SQL Developer\system4.0.2.15.21\o.sqldeveloper.12.2.0.15.21\product-preferences.xmlon Win 7 (x64).

我的是在C:\Users\<user>\AppData\Roaming\SQL Developer\system4.0.2.15.21\o.sqldeveloper.12.2.0.15.21\product-preferences.xmlWin 7 (x64) 上找到的。

The value is on line 372 for me and reads <value n="ARRAYFETCHSIZE" v="200"/>

该值在我的第 372 行并读取 <value n="ARRAYFETCHSIZE" v="200"/>

I have changed it to 2000 and it works for me.

我已将其更改为 2000,它对我有用。

I had to restart SQL Developer.

我不得不重新启动 SQL Developer。

回答by Vivek Agrawal

press f5 for running queries instead of f9. It will give you all the results in one go...

按 f5 而不是 f9 运行查询。它会一次性为您提供所有结果...

回答by Anand Kumar

Tools-> Preferences -> Database ->Worksheet

工具->首选项->数据库->工作表

Enter desired size in "Max rows to print in a script"

在“要在脚本中打印的最大行数”中输入所需的大小

Save changes.

保存更改。

回答by Joe Gayetty

It is easy, but takes 3 steps:

这很简单,但需要 3 个步骤:

  1. In SQL Developer, enter your query in the "Worksheet" and highlight it, and press F9 to run it. The first 50 rows will be fetched into the "Query Result" window.
  2. Click on any cell in the "Query Result" window to set the focus to that window.
  3. Hold the Ctrl key and tap the "A" key.
  1. 在 SQL Developer 中,在“工作表”中输入您的查询并突出显示它,然后按 F9 运行它。前 50 行将被提取到“查询结果”窗口中。
  2. 单击“查询结果”窗口中的任何单元格以将焦点设置到该窗口。
  3. 按住 Ctrl 键并点击“A”键。

All rows will be fetched into the "Query Result" window!

所有行都将被提取到“查询结果”窗口中!

回答by Alex Stephens

after you retrieve the first 50 rows in the query windows, simply click a column to get focus on the query window, then once selected do ctrl + pagedown

在查询窗口中检索前 50 行后,只需单击一列即可获得查询窗口的焦点,然后选择后执行ctrl + pagedown

This will load the full result set (all rows)

这将加载完整的结果集(所有行)

回答by gumol

Here is another cheat:

这是另一个作弊:

Limit your query if you don't really need all the rows. i.e.

如果您真的不需要所有行,请限制您的查询。IE

WHERE rownum <= 10000

Then click on any cell of the results and do from your keyboard CTRL+END. This will force SQL Developer to scroll until the bottom result of your query.

然后单击结果的任何单元格并从键盘上执行CTRL+END。这将强制 SQL Developer 滚动到查询的底部结果。

This has the advantage of keeping the default behavior and use this on demand.

这具有保持默认行为并按需使用的优点。