Get all SQL statements ordered by CPU time descending
get
                    /database/performance/top_sql_statements/
Returns records from GV$SQL ordered by CPU time descending, SQL Text ascending. A client requires SQL Administrator role to invoke this service.
                Request
Query Parameters
                    - 
                            limit: integer(int32)
                            
                            The maximum number of records to return.
 - 
                            q: 
                            
                            Filtering is the process of limiting a collection resource by using a per-request dynamic filter definition across multiple page resources, where each page contains a subset of items found in the complete collection. Filtering enables efficient traversal of large collections.Examples
 
There's no request body for this operation.
Back to TopResponse
Supported Media Types
                - application/json
 
200 Response
Description of the SQL statements in the database ordered to show the top SQL statements first.
                            
                            
                                Root Schema : PerformanceTopSQLStatements
    
    	Type: 
    	
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Show Source
        object- 
                
                    
                    count: integer
                    
                    
                     
                    
                
                
                Total number of records in the current response.
 - 
                
                    
                    hasMore: boolean
                    
                    
                     
                    
                
                
                Indicates if there are more records to be retrieved.
 - 
                
                    
                    items: array
                    
                    
                
                
                    items
                
                
                
 - 
                
                    
                    limit: integer
                    
                    
                     
                    
                
                
                The actual page size limit on number of records applied by the server.
 - 
                
                    
                    links: array
                    
                    
                
                
                    links
                
                
                
 - 
                
                    
                    offset: integer
                    
                    
                     
                    
                
                
                The actual index from which the item resources are returned.
 
Nested Schema : items
    
    	
    	Type: 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Show Source
        array- 
            Array of: 
                object  SQLStatement
            
            Corresponding to a record on GV$SQL, this object describes an SQL Statement. The list of attributes may vary depending on database version.
 
Nested Schema : SQLStatement
    
    	Type: 
    	
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    objectCorresponding to a record on GV$SQL, this object describes an SQL Statement. The list of attributes may vary depending on database version.
    
    
    
    
        Show Source
        - 
                
                    
                    action: string
                    
                    
                     
                    
                
                
                Contains the name of the action that was executing when the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_ACTION.
 - 
                
                    
                    action_hash: integer
                    
                    
                     
                    
                
                
                Hash value of the action listed in the ACTION column.
 - 
                
                    
                    address: string
                    
                    
                     
                    
                
                
                Address of the handle to the parent for this cursor.
 - 
                
                    
                    application_wait_time: integer
                    
                    
                     
                    
                
                
                Application wait time (in microseconds).
 - 
                
                    
                    bind_data: string
                    
                    
                     
                    
                
                
                Bind data.
 - 
                
                    
                    buffer_gets: integer
                    
                    
                     
                    
                
                
                Number of buffer gets for this child cursor.
 - 
                
                    
                    child_address: string
                    
                    
                     
                    
                
                
                Address of the child cursor.
 - 
                
                    
                    child_latch: integer
                    
                    
                     
                    
                
                
                Child latch number that is protecting the cursor. This column is obsolete and maintained for backward compatibility.
 - 
                
                    
                    child_number: integer
                    
                    
                     
                    
                
                
                Number of this child cursor.
 - 
                
                    
                    cluster_wait_time: integer
                    
                    
                     
                    
                
                
                Cluster wait time (in microseconds).
 - 
                
                    
                    command_type: integer
                    
                    
                     
                    
                
                
                Oracle command type definition.
 - 
                
                    
                    con_id: integer
                    
                    
                     
                    
                
                
                The ID of the container to which the data pertains.
 - 
                
                    
                    concurrency_wait_time: integer
                    
                    
                     
                    
                
                
                Concurrency wait time (in microseconds).
 - 
                
                    
                    cpu_time: integer
                    
                    
                     
                    
                
                
                CPU time (in microseconds) used by this cursor for parsing, executing, and fetching.
 - 
                
                    
                    ddl_no_invalidate: string
                    
                    
                     
                    
                
                
                Indicates if a DDL statement updated a dependent object and did not invalidate this cursor.
 - 
                
                    
                    direct_reads: integer
                    
                    
                     
                    
                
                
                Number of direct reads for this child cursor.
 - 
                
                    
                    direct_writes: integer
                    
                    
                     
                    
                
                
                Number of direct writes for this child cursor.
 - 
                
                    
                    disk_reads: integer
                    
                    
                     
                    
                
                
                Number of disk reads for this child cursor.
 - 
                
                    
                    elapsed_time: integer
                    
                    
                     
                    
                
                
                Elapsed time (in microseconds) used by this cursor for parsing, executing, and fetching. If the cursor uses parallel execution, then ELAPSED_TIME is the cumulative time for the query coordinator, plus all parallel query slave processes.
 - 
                
                    
                    end_of_fetch_count: integer
                    
                    
                     
                    
                
                
                Number of times this cursor was fully executed since the cursor was brought into the library cache. The value of this statistic is not incremented when the cursor is partially executed, either because it failed during the execution or because only the first few rows produced by this cursor are fetched before the cursor is closed or re-executed. By definition, the value of the END_OF_FETCH_COUNT column should be less or equal to the value of the EXECUTIONS column.
 - 
                
                    
                    exact_matching_signature: integer
                    
                    
                     
                    
                
                
                Signature calculated on the normalized SQL text. The normalization includes the removal of white space and the uppercasing of all non-literal strings.
 - 
                
                    
                    executions: integer
                    
                    
                     
                    
                
                
                Number of executions that took place on this object since it was brought into the library cache.
 - 
                
                    
                    fetches: integer
                    
                    
                     
                    
                
                
                Number of fetches associated with the SQL statement.
 - 
                
                    
                    first_load_time: string
                    
                    
                     
                    
                
                
                Timestamp of the parent creation time.
 - 
                
                    
                    force_matching_signature: integer
                    
                    
                     
                    
                
                
                Signature used when the CURSOR_SHARING parameter is set to FORCE.
 - 
                
                    
                    full_plan_hash_value: integer
                    
                    
                     
                    
                
                
                Numeric representation of the complete SQL plan for this cursor. Comparing one FULL_PLAN_HASH_VALUE to another easily identifies whether or not two plans are the same (rather than comparing the two plans line by line). Note that the FULL_PLAN_HASH_VALUE cannot be compared across databases releases. It is not backward compatible.
 - 
                
                    
                    hash_value: integer
                    
                    
                     
                    
                
                
                Hash value of the parent statement in the library cache.
 - 
                
                    
                    im_scan_bytes_inmemory: integer
                    
                    
                     
                    
                
                
                In-memory size of data scanned from the IM column store.
 - 
                
                    
                    im_scan_bytes_uncompressed: integer
                    
                    
                     
                    
                
                
                Uncompressed size of data scanned from the IM column store.
 - 
                
                    
                    im_scans: integer
                    
                    
                     
                    
                
                
                Number of In-Memory Column Store (IM column store) segment scans.
 - 
                
                    
                    inst_id: integer
                    
                    
                     
                    
                
                
                Instance number from which the associated GV$SQL view information was obtained.
 - 
                
                    
                    invalidations: integer
                    
                    
                     
                    
                
                
                Number of times this child cursor has been invalidated.
 - 
                
                    
                    io_cell_offload_eligible_bytes: integer
                    
                    
                     
                    
                
                
                Number of I/O bytes which can be filtered by the Exadata storage system.
 - 
                
                    
                    io_cell_offload_returned_bytes: integer
                    
                    
                     
                    
                
                
                Number of filtered bytes returned by Exadata cells (that is, the number of bytes returned after processing has been offloaded on the Exadata cells).
 - 
                
                    
                    io_cell_uncompressed_bytes: integer
                    
                    
                     
                    
                
                
                Number of uncompressed bytes (that is, size after decompression) that are offloaded to the Exadata cells.
 - 
                
                    
                    io_interconnect_bytes: integer
                    
                    
                     
                    
                
                
                Number of I/O bytes exchanged between Oracle Database and the storage system.
 - 
                
                    
                    is_bind_aware: string
                    
                    
                     
                    
                
                
                Indicates whether the cursor is bind aware (Y) or not (N). A query is considered bind-aware if it has been marked to use extended cursor sharing. The query would already have been marked as bind-sensitive.
 - 
                
                    
                    is_bind_sensitive: string
                    
                    
                     
                    
                
                
                Indicates whether the cursor is bind sensitive (Y) or not (N). A query is considered bind-sensitive if the optimizer peeked at one of its bind variable values when computing predicate selectivities and where a change in a bind variable value may cause the optimizer to generate a different plan.
 - 
                
                    
                    is_obsolete: string
                    
                    
                     
                    
                
                
                Indicates whether the cursor has become obsolete (Y) or not (N). This can happen if the number of child cursors is too large.
 - 
                
                    
                    is_reoptimizable: string
                    
                    
                     
                    
                
                
                This columns shows whether the next execution matching this child cursor will trigger a reoptimization.
 - 
                
                    
                    is_resolved_adaptive_plan: string
                    
                    
                     
                    
                
                
                This column shows whether all of the adaptive parts of a plan have been resolved to the final plan. Once the plan is resolved, the plan hash value and the plan displayed by DBMS_XPLAN will not change through the end of execution.
 - 
                
                    
                    is_rolling_invalid: string
                    
                    
                     
                    
                
                
                Indicates if this cursor is rolling validated.
 - 
                
                    
                    is_rolling_refresh_invalid: string
                    
                    
                     
                    
                
                
                Indicates if this cursor is rolling validated and requires execution time refresh.
 - is_shareable: string
 - 
                
                    
                    java_exec_time: integer
                    
                    
                     
                    
                
                
                Java execution time (in microseconds).
 - 
                
                    
                    kept_versions: integer
                    
                    
                     
                    
                
                
                Indicates whether this child cursor has been marked to be kept pinned in the cache using the DBMS_SHARED_POOL package.
 - 
                
                    
                    last_active_time: string
                    
                    
                     
                    
                
                
                TIme at which the query plan was last active.
 - 
                
                    
                    last_load_time: string
                    
                    
                     
                    
                
                
                Time at which the query plan was loaded into the library cache.
 - 
                
                    
                    links: array
                    
                    
                
                
                    links
                
                
                
 - 
                
                    
                    literal_hash_value: integer
                    
                    
                     
                    
                
                
                Hash value of the literals which are replaced with system-generated bind variables and are to be matched, when CURSOR_SHARING is used. This is not the hash value for the SQL statement. If CURSOR_SHARING is not used, then the value is 0.
 - 
                
                    
                    loaded_versions: integer
                    
                    
                     
                    
                
                
                Indicates whether the context heap is loaded (1) or not (0).
 - 
                
                    
                    loads: integer
                    
                    
                     
                    
                
                
                Number of times the object was either loaded or reloaded.
 - 
                
                    
                    locked_total: integer
                    
                    
                     
                    
                
                
                Total number of times the child cursor has been locked.
 - 
                
                    
                    module: string
                    
                    
                     
                    
                
                
                Contains the name of the module that was executing when the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_MODULE.
 - 
                
                    
                    module_hash: integer
                    
                    
                     
                    
                
                
                Hash value of the module listed in the MODULE column.
 - 
                
                    
                    object_status: string
                    
                    
                     
                    
                
                
                Status of the cursor.
 - 
                
                    
                    old_hash_value: integer
                    
                    
                     
                    
                
                
                Old SQL hash value.
 - 
                
                    
                    open_versions: integer
                    
                    
                     
                    
                
                
                Indicates whether the child cursor is locked (1) or not (0).
 - 
                
                    
                    optimized_phy_read_requests: integer
                    
                    
                     
                    
                
                
                Number of physical read I/O requests from Database Smart Flash Cache issued by the monitored SQL.
 - 
                
                    
                    optimizer_cost: integer
                    
                    
                     
                    
                
                
                Cost of this query given by the optimizer.
 - 
                
                    
                    optimizer_env: string
                    
                    
                     
                    
                
                
                Optimizer environment.
 - 
                
                    
                    optimizer_env_hash_value: integer
                    
                    
                     
                    
                
                
                Hash value for the optimizer environment.
 - 
                
                    
                    optimizer_mode: string
                    
                    
                     
                    
                
                
                Mode under which the SQL statement was executed.
 - 
                
                    
                    outline_category: string
                    
                    
                     
                    
                
                
                If an outline was applied during construction of the cursor, then this column displays the category of that outline. Otherwise the column is left blank.
 - 
                
                    
                    outline_sid: integer
                    
                    
                     
                    
                
                
                Outline session identifier.
 - 
                
                    
                    parse_calls: integer
                    
                    
                     
                    
                
                
                Number of parse calls for this child cursor.
 - 
                
                    
                    parsing_schema_id: integer
                    
                    
                     
                    
                
                
                Schema ID that was used to originally build this child cursor.
 - 
                
                    
                    parsing_schema_name: string
                    
                    
                     
                    
                
                
                Schema name that was used to originally build this child cursor.
 - 
                
                    
                    parsing_user_id: integer
                    
                    
                     
                    
                
                
                User ID of the user who originally built this child cursor.
 - 
                
                    
                    persistent_mem: integer
                    
                    
                     
                    
                
                
                Fixed amount of memory used for the lifetime of the child cursor (in bytes).
 - 
                
                    
                    physical_read_bytes: integer
                    
                    
                     
                    
                
                
                Number of bytes read from disks by the monitored SQL.
 - 
                
                    
                    physical_read_requests: integer
                    
                    
                     
                    
                
                
                Number of physical read I/O requests issued by the monitored SQL.
 - 
                
                    
                    physical_write_bytes: integer
                    
                    
                     
                    
                
                
                Number of bytes written to disks by the monitored SQL.
 - 
                
                    
                    physical_write_requests: integer
                    
                    
                     
                    
                
                
                Number of physical write I/O requests issued by the monitored SQL.
 - 
                
                    
                    pinned_total: integer
                    
                    
                     
                    
                
                
                Total number of times the child cursor has been pinned.
 - 
                
                    
                    plan_hash_value: integer
                    
                    
                     
                    
                
                
                Numeric representation of the current SQL plan for this cursor. Comparing one PLAN_HASH_VALUE to another easily identifies whether or not two plans are the same (rather than comparing the two plans line by line).
 - 
                
                    
                    plsql_exec_time: integer
                    
                    
                     
                    
                
                
                PL/SQL execution time (in microseconds).
 - 
                
                    
                    program_id: integer
                    
                    
                     
                    
                
                
                Program identifier.
 - 
                
                    
                    program_line#: integer
                    
                    
                     
                    
                
                
                Program line number.
 - 
                
                    
                    px_servers_executions: integer
                    
                    
                     
                    
                
                
                Total number of executions performed by parallel execution servers (0 when the statement has never been executed in parallel).
 - 
                
                    
                    remote: string
                    
                    
                     
                    
                
                
                Indicates whether the cursor is remote mapped (Y) or not (N).
 - 
                
                    
                    result_cache: string
                    
                    
                     
                    
                
                
                Indicates whether the function is result???cached (YES) or not (NO).
 - 
                
                    
                    rows_processed: integer
                    
                    
                     
                    
                
                
                Total number of rows the parsed SQL statement returns.
 - 
                
                    
                    runtime_mem: integer
                    
                    
                     
                    
                
                
                Fixed amount of memory required during the execution of the child cursor.
 - 
                
                    
                    serializable_aborts: integer
                    
                    
                     
                    
                
                
                Number of times the transaction failed to serialize, producing ORA-08177 errors, per cursor.
 - 
                
                    
                    service: string
                    
                    
                     
                    
                
                
                Service name.
 - 
                
                    
                    service_hash: integer
                    
                    
                     
                    
                
                
                Hash value for the name listed in the SERVICE column.
 - 
                
                    
                    sharable_mem: integer
                    
                    
                     
                    
                
                
                Amount of shared memory used by the child cursor (in bytes).
 - 
                
                    
                    sorts: integer
                    
                    
                     
                    
                
                
                Number of sorts that were done for the child cursor.
 - 
                
                    
                    sql_fulltext: string
                    
                    
                     
                    
                
                
                Full text for the SQL statement exposed as a CLOB column. The full text of a SQL statement can be retrieved using this column instead of joining with the V$SQLTEXT dynamic performance view.
 - 
                
                    
                    sql_id: string
                    
                    
                     
                    
                
                
                SQL identifier of the parent cursor in the library cache.
 - 
                
                    
                    sql_patch: string
                    
                    
                     
                    
                
                
                SQL patch used for this statement, if any.
 - 
                
                    
                    sql_plan_baseline: string
                    
                    
                     
                    
                
                
                SQL plan baseline used for this statement, if any.
 - 
                
                    
                    sql_profile: string
                    
                    
                     
                    
                
                
                SQL profile used for this statement, if any.
 - 
                
                    
                    sql_text: string
                    
                    
                     
                    
                
                
                First thousand characters of the SQL text for the current cursor.
 - 
                
                    
                    sqltype: integer
                    
                    
                     
                    
                
                
                Denotes the version of the SQL language used for this statement.
 - 
                
                    
                    type_chk_heap: string
                    
                    
                     
                    
                
                
                Descriptor of the type check heap for this child cursor.
 - 
                
                    
                    typecheck_mem: integer
                    
                    
                     
                    
                
                
                Typecheck memory.
 - 
                
                    
                    user_io_wait_time: integer
                    
                    
                     
                    
                
                
                User I/O Wait Time (in microseconds).
 - 
                
                    
                    users_executing: integer
                    
                    
                     
                    
                
                
                Number of users executing the statement.
 - 
                
                    
                    users_opening: integer
                    
                    
                     
                    
                
                
                Number of users that have any of the child cursors open.