System management for Oracle DBAs  

home
Up
file layout
file naming
constraints
pfile
network

 

Constraint Naming

Overview

The following recommendations cover the naming of database constraints.

bulletName all constraints. No system named constraints are acceptable.
bulletConstraint names should use the table name and a constraint abbreviation. Where multiple constraints are allowed they are numbered sequentially for uniqueness.

The advantages of using just the table name, and not some abbreviation of table name and column names are that it's simpler to name. With the use of table name first it's easy to "group" tables, their indexes, and their constraints, and it's obvious which constraints belong to which table when viewing execution plans.

Naming Guidelines

Primary key constraints - <table name>_PK

Foreign key constraints - <table name>_FK{#}

Unique constraints - <table name>_UQ{#}

Check constraints - <table name>_CK{#}

Not null constraints - <table name>_NN{#}

 

   

Copyright © 1998-2008 AppsDBA Consulting. All Rights Reserved.