Some ways to check bad sql in oracle

Monday, May 22nd, 2017 (0 Comment)

Sometime, we have some systems use oracle database and these system query data very slowly, we need dba check bad sql in oracle if any.

After dba check bad sql and dba will provide sql scripts, we will have to customize sql to run faster.

We will have some scripts to check bad sql

1) Check bad sql ues V$SQL view

  • ELAPSED_TIME is microseconds, 1 second = 1.000.000 microseconds

2) Check bad sql use v$sqlarea view

Script 1

Script 2

From SQL_ID, we can link to V$SQL view to get sql statement.

Script 3

3) Kill session oracle

After we get bad sql (include sql_id) and we want to kill session was calling this sql, we need login sysdba and run script below to get sid

Get result of query and run. Or run manual with script below

 

Tags: , , , ,

Related Posts

database
How to create function return table or cursor in oracle
database
Create group user class by using object oriented plsql
database
Functions encrypt decrypt and checksum oracle
database
Create stored procedure pl/sql in oracle

Related Posts

database
How to create function return table or cursor in oracle
database
Create group user class by using object oriented plsql
database
Functions encrypt decrypt and checksum oracle
database
Create stored procedure pl/sql in oracle

Leave a Reply

Your email address will not be published. Required fields are marked *