Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Oracle Guideline

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-03, 14:56
ser_rom ser_rom is offline
Registered User
 
Join Date: Dec 2002
Posts: 5
Unhappy Oracle Guideline

Hello,

Somebody knows where can I find some official documents to normalize my database?. One guideline or something like that.

For example, the name of the index, tables, fk, pk, tablespaces, ...

Thanks a lot.

SRR.
Reply With Quote
  #2 (permalink)  
Old 02-11-03, 06:44
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 4,874
Re: Oracle Guideline

Quote:
Originally posted by ser_rom
Hello,

Somebody knows where can I find some official documents to normalize my database?. One guideline or something like that.

For example, the name of the index, tables, fk, pk, tablespaces, ...

Thanks a lot.

SRR.

I'm not clear what you are looking for here. Do you want guidance on HOW to normalise? Or do you want pre-designed documentation forms in which to record your design?
__________________
Tony Andrews
http://tonyandrews.blogspot.com
Reply With Quote
  #3 (permalink)  
Old 02-12-03, 04:57
ser_rom ser_rom is offline
Registered User
 
Join Date: Dec 2002
Posts: 5
Hello and thank you very much for your help.

I need some documents to format my code SQL. Example:

How can I call a Foreign key?. FK_...
And an Index?. IX_....

I need a document which explain all.

Thanks a lot.

SRR.
Reply With Quote
  #4 (permalink)  
Old 02-12-03, 06:43
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 4,874
Quote:
Originally posted by ser_rom
Hello and thank you very much for your help.

I need some documents to format my code SQL. Example:

How can I call a Foreign key?. FK_...
And an Index?. IX_....

I need a document which explain all.

Thanks a lot.

SRR.

You can name them however you like, though of course you should have a standard. Many Oracle designers use Oracle Designer to create databases, and adopt its default naming conventions as standard. These are:
1) Every table has an "alias" of around 3 characters, e.g. "EMP" for EMPLOYEE, "DPT" for DEPARTMENT.
2) Primary keys are named EMP_PK, DPT_PK
3) Foreign keys are named EMP_DPT_FK
4) Indexes on foreign keys are named EMP_DPT_FK_I
5) Unique constraints are named EMP_UK1, EMP_UK2

It seems logical then to name other indexes with a "_I" suffix also, e.g. EMP_SURNAME_I.

Trigger names are user defined. Again, it seems logical to continue to use table aliases in their names, and to identify the type of trigger in the name, e.g. EMP_BIUR (Before Insert or Update for each Row).

Package names are user defined. It's quite common to use a "_PKG" suffix. If the package is "about" a table then the name might be e.g. EMP_PKG.

Procedures within packages are generally named in the form verb_noun e.g. hire_employee, calculate_bonus

Functions within packages are generally named in the form of a noun representing the return value e.g. department_headcount, total_commission.

(With very few exceptions, ALL procedures and functions should be in packages).

Check constraints are often named like EMP_HIRE_DATE_CHK, EMP_SALARY_CHK.

Have I missed anything?

I'm sure if you search the internet for "Oracle naming standards" you will find some alternatives - the point is, there is no "official" standard that everyone in the world follows.
__________________
Tony Andrews
http://tonyandrews.blogspot.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On