The SQL Query History document records all queries executed within the SQL document. It allows users to view, search, edit, filter, and export executed queries to a .csv file.
To open the Query History document, do one of the following:
On the SQL toolbar, select Show Query History.
Note
To turn on the SQL toolbar, go to the View menu and select Toolbars > SQL.
The Query History document is divided into two sections:
The grid includes the following columns:
When you hover over a query in the Query Text column, a tooltip appears with detailed information about the executed query, including the execution date, status, size, duration, associated file, the server on which the query was executed, a user who executed the query, and the whole query text.
When you select a query in the Query History grid, its full text appears in the Preview pane.
To set up the Query History behavior:
1. Open the Options dialog by doing one of the following:
2. In the Options dialog, navigate to Environment > Documents > Query History to configure how SQL queries can be stored and managed:
Store query history: When the option is selected (default state), the query history is stored automatically. To stop storing query history, clear the checkbox.
Storage location: By default, the query history is saved in C:\Users\Username\AppData\Roaming\Devart\dbForge Documenter for Oracle\ExecutedQueries
where Username
is the name of the current user. To use a different directory, specify the correct storage path of the Query History database.
Max script size: By default, the maximum script size is 1024 KB. To set a different script size, specify the correct value.
Automatically remove queries older than 60 d.: Executed queries are stored for 60 days by default, while the maximum interval you can 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.
3. To save the changes, select OK. To restore the settings on a page to their default state, select Reset Page Defaults.
The tool allows you to filter queries using the search box or filters available for each column in the Query History grid.
In the Search box, enter the search string to find specific queries. The queries that match the search criteria will be filtered in the grid, and the matching text will be highlighted in green in the Preview pane.
To delete the text in the Search box, select Clear Filter in the Search box.
To filter queries per column, hover over the column header and select the filter icon in the upper-right corner:
Select the checkboxes next to the query status you want to display in the Query History grid.
On the Values tab, select the checkboxes next to the queries. Alternatively, select a condition from the list and specify a value on the Text Filters tab.
On the Values tab, use the slider to set the minimum and maximum values or enter them manually in the From and To boxes. Alternatively, select a condition from the list and specify a value on the Numeric Filters tab.
On the Values tab, select the checkboxes next to the date range from the list. Alternatively, select the checkboxes next to the filters on the Date Filters tab.
On the Values tab, select the checkboxes next to the query duration from the list. Alternatively, select a condition from the list and specify a value on the Filters tab.
On the Values tab, select the checkboxes next to the files. Alternatively, select a condition from the list and specify a value on the Text Filters tab.
On the Values tab, select the checkboxes next to the servers from the list. Alternatively, select a condition from the list and specify a value on the Text Filters tab.
On the Values tab, select the checkboxes next to the users from the list. Alternatively, select a condition from the list and specify a 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. In the Custom Range dialog that opens, set the time period and select OK to apply the filter. To discard the changes, select Cancel.
The tool allows you to add, edit, or delete filters using the Filter panel or the Filter Editor dialog.
The Filter panel appears at the bottom of the Query History grid after a filter is applied. It allows you to:
To open the Filter Editor dialog, do one of the following:
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 calls the shortcut menu with the following options:
Note
Query History is saved in the ExecutedQueries.db file. The default path of the file is
%appdata%\Devart\dbForge Documenter for Oracle\ExecutedQueries
.
To specify a different path, go to the Tools menu and select Options. In the Options dialog that opens, select Environment > Documents > Query History.Note that this file does not store your connection passwords.
To group executed queries by column, do one of the following:
To group executed queries by multiple columns, drag as many column headers as you need to the Group by Box pane. In this case, the grid will display a tree of nested groups you can expand or collapse by using the corresponding arrows.
To sort the grouped data, do one of the following:
To manage the grouped data, right-click the Group By Box pane and select the required option from the shortcut menu:
To ungroup data, do one of the following:
To hide the Group By Box pane, do one of the following:
The Customization window displays the column headers from the Query History grid. The window allows you to remove, sort, or manage the columns.
1. In 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.
In the Customization window, right-click the column to open the shortcut menu to manage columns on the grid.
The sort glyph indicates the current sort order of a column. To remove sorting, select Clear Sorting. If the column is not sorted, the sort glyph is hidden.
In the Query History grid, right-click the column header and select Show Auto Filter Row.
The Preview pane displays the text of the selected query. To manage the query text, right-click anywhere in the Preview pane and select the required option.
You can edit the query by doing one of the following:
Double-click the required query:
In the Query History grid, double-click the required query. This action opens the query in a new SQL document where you can edit and execute it.
Use the ‘To New SQL Window’ option:
In the Query History grid, right-click the selected query and then select To New SQL Window. This command opens the query 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 with exported query history, navigate to the folder containing the file and double-click it to open the file.
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.
In the upper-right corner of the Query History document, select and then select Reset View Layout to restore the default view layout.