Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

dba_constraints tips

Oracle Database Tips by Donald BurlesonJuly 4th 2015

Question:  How can I get a script to display all information about a constraint from the dba_constraints view?

Answer:  The dba_constraints view is used to show all constraints and constraint types that are associated with a table. 

See use dba_constraints to find all references to an Oracle table

In dba_constraints, you see the constraint name and constraint type.  Here is a description of the dba_constraints view:

SQL> desc dba_constraints
 
Name                    Null?    Type
----------------------- -------- ------------------
OWNER                   NOT NULL VARCHAR2(30)
CONSTRAINT_NAME         NOT NULL VARCHAR2(30)
CONSTRAINT_TYPE                  VARCHAR2(1)
TABLE_NAME              NOT NULL VARCHAR2(30)
SEARCH_CONDITION                 LONG
R_OWNER                          VARCHAR2(30)
R_CONSTRAINT_NAME                VARCHAR2(30)
DELETE_RULE                      VARCHAR2(9)
STATUS                           VARCHAR2(8)
DEFERRABLE                       VARCHAR2(14)
DEFERRED                         VARCHAR2(9)
VALIDATED                        VARCHAR2(13)
GENERATED                        VARCHAR2(14)
BAD                              VARCHAR2(3)
RELY                             VARCHAR2(4)
LAST_CHANGE                      DATE
INDEX_OWNER                      VARCHAR2(30)
INDEX_NAME                       VARCHAR2(30)
INVALID                          VARCHAR2(7)
VIEW_RELATED                     VARCHAR2(14)


This dba_constraints script below shows details about a constraint:

col type            format a10
col constraint_name format a30

select  
   decode(constraint_type,
     'C', 'Check',
     'O', 'R/O View',
     'P', 'Primary',
     'R', 'Foreign',
     'U', 'Unique',
     'V', 'Check view') type,
   constraint_name,
   status,
   last_change,
from   
see BC Oracle code depot for alternate scripts.
   dba_constraints
where
   table_name = 'MYTAB'
order by
   1;

 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster