Oracle Database

Recently I had to drop some foreign key constraints on tables.

Below the SQL, which did the job for me. After 'drop constraint' you have to provide the name of a constraint you want to delete as it is maintained in table all_constraints.

Alter Table
a_table
drop constraint
fk_any_table_ref;

Recently I had to rebuild some indexes, since they met two major conditions under which an index rebuild most likely will improve performance.

According to Burleson, an index rebuild can help under the following conditions.

http://www.dba-oracle.com/art_dbazine_idx_rebuild.htm

  • High index fragmentation:  The SQL workload has lots of table DML causing lots of deleted leaf blocks.
  • High index scan access plans:  The SQL workload is rich with index scans (index fast-full scans and index range scans)

The second condition definetely holds valid for my clients database. The application, RSA IGL is used for over 10 years without any archiving or regular house keeping and up to 100 Million entries in several important tables.

If you have to know the current database version, you can get this information using the following SQL.

SQL

1
SELECT * FROM V$VERSION;

 

Subcategories

This category will hold examples for Oracle SQL.

This category will hold Oracle SQL Developer specific articles.

A category holding articles for Oracles programming language PL SQL.