what are the methods using performance tunning in sql and
pl/sql
Answers were Sorted based on User's Feedback
Answer / yogish d naik
There are mainly two ways to do performance tuning.
1. Using Explain plan: it is an method of getting how our
query will execute without actually executing the query. It
is used for only sql. (but not pl/sql).
Steps: 1. Here first Create query by following syntax
EXPLAIN PLAN FOR
SELECT A.ename,A.sal,nvl(A.comm,0),B.dname,B.loc
FROM emp A ,dept B
WHERE A.deptno=B.deptno;
Steps: 2. DBMS_XPLAN is a inbuilt package provided by
oracle we just call that package to get explain plan for
that query.
select * from table(DBMS_xplan.display());
here we has to observe two things cost and operation, if
it is taken TABLA ACCESS FULL then we has to make indexes
for columns mentioned in where clause. And note down the
cost before and check after indexing.
2. Sql Tracing and TKprof:
Sql Tracing: is used to generate execution plan and time
related statistics after executing query or program.
Steps: 1. Enable Trace:
ALTER SESSION SET SQL_TRACE = TRUE;
Steps: 2. Run some pl sql program
Steps: 3. Disable trace
ALTER SESSION SET SQL_TRACE = FALSE;
Use TKPROF Utility:
The trace file generated from previous step will be in non
readable format. TKPROF is a command line utility (os level)
converts non-readable trace file into readable text file.
C:\users\server> tkprof orcl_ora_7176.trc newfile.txt
Analyze output 1.CPU & Elapsed time should be less
2. Disk reads should be less
3. plan should have lesser cost , path should not be full
table scan.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / vyshak
1.tracing
2.explain plan
3.auto tracing
4.AWR reports
5.using v$views
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the difference between the conventional and direct path loads? : aql loader
What are sql injection vulnerabilities?
How many types of primary keys are there?
What is the least restrictive isolation level? : Transact sql
What is keys and its types?
Differentiate between pl/sql and sql?
what is purge command explain about oracle performance tuning
2 Answers Accenture, eCentric Solutions,
How is data stored on a disk?
What is the syntax to add a record to a table?
How packaged procedures and functions are called from the following?
What is the maximum database size for sql express?
What is cursor and its types?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)