简体   繁体   English

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

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

How to increase buffer size in Oracle SQL Developer to view all records (there seems to be a certain limit set at default)?如何在 Oracle SQL Developer 增加buffer size查看所有记录(默认好像有一定的限制)? Any screen shots and/or tips will be very helpful.任何屏幕截图和/或提示都将非常有帮助。

https://forums.oracle.com/forums/thread.jspa?threadID=447344https://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.无论如何,您不希望 SQL Developer 在大表上获取几分钟。 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.如果,对于 1 个特定表,您想要获取所有记录,您可以在结果窗格中执行 Control-End 以转到最后一条记录。 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*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 来获取记录,并且限制是由 JDBC setMaxRows()过程设置的,如果您可以更改它(可能不支持),那么您可以更改SQL 开发人员行为。

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 行。

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,您可以将其更改为任意大小。

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.在 SQL Developer 中,在“工作表”中输入您的查询并突出显示它,然后按 F9 运行它。 The first 50 rows will be fetched into the "Query Result" window.前 50 行将被提取到“查询结果”窗口中。
  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.按住 Ctrl 键并点击“A”键。

All rows will be fetched into the "Query Result" window!所有行都将被提取到“查询结果”窗口中!

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.xml on Win 7 (x64).我的位于C:\\Users\\<user>\\AppData\\Roaming\\SQL Developer\\system4.0.2.15.21\\o.sqldeveloper.12.2.0.15.21\\product-preferences.xml on Win 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。

press f5 for running queries instead of f9.按 f5 而不是 f9 运行查询。 It will give you all the results in one go...它会一次性为您提供所有结果...

Tools-> Preferences -> Database ->Worksheet工具->首选项->数据库->工作表

Enter desired size in "Max rows to print in a script"在“要在脚本中打印的最大行数”中输入所需的大小

Save changes.保存更改。

After you fetch the first 50 rows in the query windows, simply click on any column to get focus on the query window, then once selected do ctrl + end key在查询窗口中获取前 50 行后,只需单击任意列即可获得查询窗口的焦点,然后选择后执行ctrl + end key

This will load the full result set (all rows)这将加载完整的结果集(所有行)

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)这将加载完整的结果集(所有行)

Here is another cheat:这是另一个作弊:

Limit your query if you don't really need all the rows.如果您真的不需要所有行,请限制您的查询。 ie IE

WHERE rownum <= 10000

Then click on any cell of the results and do from your keyboard CTRL+END .然后单击结果的任何单元格并从键盘上执行CTRL+END This will force SQL Developer to scroll until the bottom result of your query.这将强制 SQL Developer 滚动到查询的底部结果。

This has the advantage of keeping the default behavior and use this on demand.这具有保持默认行为并按需使用的优点。

I know this is a bit late, but just use your OS shortcut to select all (Command + a on macOS or Ctrl + a on Windows), this will force fetch all results to select all rows:)我知道这有点晚了,但只需使用您的操作系统快捷方式到 select all(在 macOS 上为 Command + a 或在 Windows 上为 Ctrl + a),这将强制将所有结果提取到 select 所有行:)

On PL SQL Developer 13.0.6, go to Configure > Preferences.在 PL SQL Developer 13.0.6 上,转到配置 > 首选项。 On the left side menu look for SQL Window.在左侧菜单中查找 SQL Window。 There is an option called Records per Page.有一个名为“每页记录”的选项。 I changed it to "All records" and it does the trick.我将其更改为“所有记录”,它就成功了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM