is there a tool to trace queries, like profiler for sql server?



is there a tool to trace queries, like profiler for sql server?..

Answer / Ravi Deep Rawat

"Yes, Oracle provides the `DBMS_PROFILER` package to capture and analyze SQL statements execution statistics. Here's an example:
```sqln
DECLAREn
prm_handle DBMS_PROFILER.HANDLE;n
event_name VARCHAR2(30) := 'my_event';n
sample_stats DBMS_PROFILER.SAMPLE_STATS_LIST; n
BEGINn
DBMS_PROFILER.CREATE_EVENT_CALLSTACK (event_name, NULL, TRUE);n
DBMS_PROFILER.START_Sampling(prm_handle, event_name, sample_stats);n
-- Execute SQL statements heren
DBMS_PROFILER.STOP_Sampling(prm_handle); n
DBMS_OUTPUT.PUT_LINE('Sampling finished'); n
END;n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

Differentiate between translate and replace?

1 Answers  


how to find the n'th highest salary from emp ?

10 Answers  


find out first highest salary?

10 Answers   Verinon Technology Solutions,


List out the components of logical database structure of oracle database.

1 Answers  


How can Oracle users be audited?

1 Answers   MCN Solutions,


when a grant option is encountered for a table EMP to a peer sitting beside you who has already having the table of that name (EMP), then what is the result?

2 Answers  


How to create a new tablespace in oracle?

1 Answers  


How to convert csv to table in oracle?

1 Answers  


Please explain drop constraint oracle?

1 Answers  


What is forall Statement ?

2 Answers   Thermotech,


two tables are there emp(eno,ename,sal,deptno),dept(deptno,dname).how form the query in deptno,ename,max(sal)

2 Answers  


write a query to dispaly those name who is more than one in student table? example- in a student table sandeep kumar comes 4 times, rakesh kumar comes 2 times, ajit kumar comes 1 times so query will display sandeep kumar and rakesh kumar single times.

11 Answers   Wipro,


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)