Running custom queries by using Object Query Language

You can use customized Object Query Language (OQL) queries to analyze the heap dump.

About this task

OQL queries have a similar format to Structured Query Language (SQL), which is typically used to query relational databases. OQL represents classes as tables, objects as rows, and fields as columns. The OQL syntax is as follows:
SELECT * FROM [ INSTANCEOF ] <class_name> [ WHERE <filter_expression> ]
See later topics for more detailed information about OQL syntax.

Procedure

  1. Click the Open Object Query Language Studio to execute statements button () in the toolbar.
  2. Type your query in the OQL editor pane. When you type a class name or regular expression after the FROM clause, the editor provides a list of suggested class names. The list is displayed when you type a period (.), when you type a double quotation mark (") to start a regular expression, and when you press Ctrl+Space.
    Note: In the Web Edition of the product you cannot type in the OQL editor pane, but you can paste a query into the pane.
  3. Press F5 or Ctrl+Enter to run the query, or select the Execute Query button () from the toolbar.
    Note: In the Web Edition of the product, use the Execute Query toolbar button.
  4. Start of changeIf required, you can press Ctrl+Z or Ctrl+Y to undo or redo changes that you make in the OQL Editor pane.
    Note: This function is not available in the Web Edition of the product.
    End of change

Results

The results of your query are shown. Select an item in the report to show further information about that item in the Inspector view.
Tip: Start of changeYou can rerun previous queries by opening the Navigation History view, then double-clicking an OQL query from the list. End of change

What to do next

Start of changeFor many queries, you can select some of objects in the results area, right-click to display a menu, then click Copy > OQL Query. This action creates an OQL statement that includes a representation of the selected objects, and the columns that are shown in the results area. You can paste this OQL statement into an OQL editor pane, then run it as a new query.
Note: This function is not available in the Web Edition of the product.
End of change




© Copyright IBM Corporation 2011, 2015.
© Copyright 2008, 2015 SAP AG and others. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.