The Query History document can be used to keep track of all the queries that have been executed within the SQL document. It allows users to view, search for executed queries, edit, filter, and export them to a .csv file.
To open the Query History document, use one of the following ways:
On the SQL toolbar, select Show Query History.
Note
If the SQL toolbar is turned off, you can turn it on by navigating to the View menu and selecting Toolbars > SQL.
Hovering over the row in the Query Text column displays the text of the executed query.
The Query History document is organized into two main sections:
The Query History document includes the following columns:
You can configure the Query History behavior in the Options dialog. To open it, use one of the following ways:
In the Options dialog, navigate to Environment > Documents > Query History to set up the Query History settings:
By default, the query history is saved in the following folder:
C:\Users\Username\AppData\Roaming\Devart\dbForge Studio for Oracle\ExecutedQueries
where Username is the name of the current user.
The maximum script size is set to 1024 KB by default. Executed queries are stored for 60 days by default, while the maximum interval that can be set is 365 days. After the specified period has ended, the history is automatically deleted. You can also back up your history data by copying the file from the storage folder to another location on your computer.
Note
Once the data has been automatically deleted, the history files can no longer be reopened in the dbForge tool.
To save the changes, select OK.
The tool allows you to filter queries using the search box or by applying filters available for each column in the Query History document.
In the Search box, type the search string to find specific queries. The text matching the search criterion will be highlighted in green. To delete the text in the Search box, select Clear Filter in the Search box.
To filter queries per column, hover over the upper-right corner of the column header and select the filter icon:
Select the checkbox next to the query status you want to display in the Query History document.
Select the checkboxes next to the queries on the Values tab or choose the condition from the list and specify the value on the Text Filters tab.
Select the minimum and maximum values to filter the entries using the slider on the Values tab or choose the condition from the list and specify the value on the Numeric Filters tab.
Select the checkboxes next to the date range from the list on the Values tab or select the checkboxes next to the filter on the Date Filters tab.
Select the checkboxes next to the query duration from the list on the Values tab or choose the condition from the list and specify the value on the Filters tab.
Select the checkboxes next to the file on the Values tab or choose the condition from the list and specify the value on the Text Filters tab.
Select the checkboxes next to the servers from the list on the Values tab or choose the condition from the list and specify the value on the Text Filters tab.
Select the checkboxes next to the user from the list on the Values tab or choose the condition from the list and specify the value on the Text Filters tab.
From the Period list, select the required timeframe to filter queries by their execution period. To specify a custom timeframe, select Custom Range from the list.
In the Custom Range dialog that opens, set the time period and select OK.
The Studio allows you to add, edit, or delete filters using the Filter panel or the Filter Editor dialog.
The Filter panel allows you to:
To open the Filter Editor dialog, select Edit Filter in the Filter panel.
The Filter Editor dialog allows you to:
To apply the filter, select Apply. This keeps the dialog open, and you can edit the filter. To save the changes and close the dialog, select OK. To discard the changes, select Cancel.
Right-clicking the column header will call the shortcut menu with the following options:
Note
Query History is stored in the ExecutedQueries.db file. To specify a path to the folder where this file will be stored, go to Tools menu > Options > Environment > Documents > Query History. The default path is %appdata%\Devart\dbForge Studio for Oracle\ExecutedQueries.
Note that this file does not store your connection passwords.
To group executed queries by column, right-click the column header by which you want to group queries and select Group By This Column. The data will be automatically displayed in groups, each represented by a collapsed node. The column header will be moved to the Group by Box pane.
Alternatively, right-click the column header and select Show Group by Box. The Group by Box pane will appear above the grid. Drag a column header you want the data to be grouped by to the pane.
You can group data by multiple columns. In this case, the grid will display a tree of nested groups that you can expand or collapse by clicking the corresponding arrows.
You can also sort the grouped data as follows:
To manage the grouped data, right-click the Group By Box pane and select the required option from the shortcut menu:
The Customization window displays the column headers from the Query History grid. The window allows you to remove, sort, or manage the columns.
1. On the Query History grid, right-click the column header and select Column Chooser to open the Customization window.
2. In the window, all the columns are selected by default. Clear the checkboxes next to the columns you want to remove from the grid.
Right-clicking the column will invoke the shortcut menu to manage columns on the grid.
The sort glyph indicates the current sort order of a column. If the column is not sorted, the sort glyph is hidden. To remove sorting, select Clear Sorting.
Right-click the column header and select Show Auto Filter Row.
Navigate to the lower Preview pane that displays the text of the selected query.
To use the shortcut options, right-click anywhere in the Preview pane and select the required option.
The query can be edited as follows:
Way 1 - double-click the required query:
Double-click the required query in the Query History document. This will open the query in a new SQL document where you can edit and execute it.
Way 2 - use the “To New SQL Window” option:
1. Select the required query and then right-click it.
2. From the shortcut menu, select To New SQL Window. The query will open in a new SQL document.
1. On the toolbar of the Query History document, select Export to CSV.
2. In the Save As window that opens, select the folder to store the file and specify the file name.
3. Select Save to save the changes.
To open the file, navigate to the folder containing the file and double-click it. The .csv file will display query history:
1. On the Query History document, select Clear or press Ctrl+Del.
2. A message appears notifying you that all records in the query history will be deleted.
3. Select Yes to confirm the deletion or select No to cancel it.
To reset view layout, in the upper-right corner of the Query History document, select and then select Reset View Layout.