oracle.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 04 Apr 2013 17:32:02 +0300
changeset 1484 20964d8677d7
parent 1483 1475d464e8a8
child 1485 752e99dbb016
permissions -rw-r--r--
Profiling.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

==================
 Oracle database.
==================
.. contents::

Oracle database development environment.
========================================

  http://en.wikipedia.org/wiki/Oracle_SQL_Developer
                Integrated development environment (IDE) for working with
                SQL/PLSql in Oracle databases.
  http://en.wikipedia.org/wiki/SQL*Plus
                An Oracle database client that can run SQL and PL/SQL commands
                and display their results.
  http://en.wikipedia.org/wiki/Oracle_Forms
                Is a software product for creating screens that interact with an
                Oracle database. It has an IDE including an object navigator,
                property sheet and code editor that uses PL/SQL.
  http://en.wikipedia.org/wiki/Oracle_JDeveloper
                JDeveloper is a freeware IDE supplied by Oracle Corporation. It
                offers features for development in Java, XML, SQL and PL/SQL,
                HTML, JavaScript, BPEL and PHP.
  http://en.wikipedia.org/wiki/Oracle_Reports
                Oracle Reports is a tool for developing reports against data
                stored in an Oracle database.

Информация о таблицах в БД Oracle.
==================================

Список таблиц::

  select * from user_tables;

Занимаемый размер таблиц и индексов::

  select segment_name, segment_type, sum(bytes) from user_extents
    group by segment_name, segment_type order by sum(bytes);

  select sum(bytes) from user_extents;

Список индексов по таблицам::

  select * from user_indexes order by table_name;

Список размеров индексов по таблицам::

  select index_name, table_name, sum(user_extents.bytes) as bytes from user_indexes
    left outer join user_extents on user_extents.segment_name = table_name
    group by index_name, table_name
    order by table_name;

Список ограничений::

  select * from user_constraints;

Используемое пространство таблиц::

  select distinct tablespace_name from user_tables;

Profiling.
==========

Timing info about last queries::

  select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql
    order by LAST_LOAD_TIME desc

In SQL/Plus::

  SET TIMING ON;
  -- do stuff
  SET TIMING OFF;

or::

  set serveroutput on
  variable n number
  exec :n := dbms_utility.get_time;
  select ......
  exec dbms_output.put_line( (dbms_utility.get_time-:n)/100) || ' seconds....' );

See:

  http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2113.htm
                $SQL lists statistics on shared SQL area without the GROUP BY
                clause.


List of Oracle Reserved Words.
==============================

 * http://docs.oracle.com/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm