Saturday, September 3, 2011

What are the major difference between Oracle9i and Oracle10g?

Oracle 9i has the following new features: 

  1. Direct XML database support.
  2. Oracle Data Guard and enhancements.
  3. New data sharing and replication features.
  4. Compresses keys in tables when loading data.
  5. Security Improvements.
  6. Manage system table spaces locally.
  7. Automated DBA.
Oracle 10g has following new features:
  1. New drop database and alter database begin backup syntax.
  2. Oracle 10g Data Guard Broker and RAC to support Redo Log Transport.
  3. SQL apply feature and regular expression support.
  4. Supports HTML database.
  5. Recycle bin for storing objects and new purge command.
  6. SYSAUX table space and rename table space command.
  7. Automated Storage Management (ASM).
  8. Automatic Workload Repository (AWR).
  9. Automatic Database Diagnostic Monitor (ADDM)
  10. PLS_INTEGER, a new data type was added which enhances performance. ANYDATA data type was introduced to hold a data of variant feature.

Tuesday, June 28, 2011

How to get list of Top Performing SQLs in Oracle?

The V$SQLAREA is used for identifying the top most resource-consuming SQL statements with a variety of criteria. It is widely useful to Database Administrators, Application Developers, Oracle Support Engineers and generally anyone involved in an Oracle Database Performance Tuning activity.
The thresholds used are the same as used by default in Statspack:
Buffer Gets : 10,000
Physical Reads : 1,000
Executions : 100
Parse Calls : 1,000
Sharable Memory : 1,048576
Version Count : 20
For Top Buffer Gets >>>
SELECT * FROM(
SELECT substr(sql_text,1,40) sql,
buffer_gets, executions, buffer_gets/executions "Gets/Exec",hash_value,address
FROM V$SQLAREA
WHERE buffer_gets > 10000
ORDER BY buffer_gets DESC
)WHERE rownum <= 10;
For Top Physical Reads >>>
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
disk_reads, executions, disk_reads/executions "Reads/Exec",
hash_value,address
FROM V$SQLAREA
WHERE disk_reads > 1000
ORDER BY disk_reads DESC)
WHERE rownum <= 10;
For Top Executions >>>
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
executions, rows_processed, rows_processed/executions "Rows/Exec",
hash_value,address
FROM V$SQLAREA
WHERE executions > 100
ORDER BY executions DESC)
WHERE rownum <= 10;
For Top Parse Calls >>>
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
parse_calls, executions, hash_value,address
FROM V$SQLAREA
WHERE parse_calls > 1000
ORDER BY parse_calls DESC)
WHERE rownum <= 10;