Chapter 17. Top Ten Database Design Do's

In This Chapter

  • Using Oracle's built-in constraints

  • Spreading out your I/O

  • Learning data normalization

  • Improper or inconsistent naming conventions

  • Setting up roles and privileges properly

  • Cutting down on ad-hoc queries

  • Enforcing password security

  • Avoiding too many DBAs

  • Storing code in the database

  • Testing recovery strategy

In this chapter we focus on some of the mistakes or shortcomings we've seen in Oracle databases over the years. Most of these are honest mistakes due to inexperience with Oracle or databases in general and can easily be overcome. After all, if it weren't for things like this, DBAs like yourself wouldn't have anything to do!

Using Oracle's Built-In Constraints

Constraints enforce rules against your data. Oracle offers some of these built-in constraints:

  • Primary keys identify a column or columns in the table whose data for the values stored is unique and non-null.

  • Foreign keys enforce something called referential integrity.

  • Check constraints are customizable constraints that check the data entered into a column.

  • Not Null constraints disallow an empty column to be empty.

  • Unique constraints are a column or group of columns whose values together are unique for the row.

Constraints seem like a very useful and almost required feature in any database. Odd as it may seem, some software vendors don't natively include a system of constraints in the database software. This requires developers to code their own in the application. This can be extremely ...

Get Oracle® 11g For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.