Oracle® Database Administrator's Guide 11g Release 2 (11.2) Part Number E25494-02 |
|
|
PDF · Mobi · ePub |
Tables are the basic unit of data storage in an Oracle Database. Data is stored in rows and columns. You define a table with a table name, such as employees
, and a set of columns. You give each column a column name, such as employee_id
, last_name
, and job_id
; a data type, such as VARCHAR2
, DATE
, or NUMBER
; and a width. The width can be predetermined by the data type, as in DATE
. If columns are of the NUMBER
data type, define precision and scale instead of width. A row is a collection of column information corresponding to a single record.
You can specify rules for each column of a table. These rules are called integrity constraints. One example is a NOT NULL
integrity constraint. This constraint forces the column to contain a value in every row.
You can invoke transparent data encryption to encrypt data before storing it. If users attempt to circumvent the database access control mechanisms by looking inside Oracle datafiles directly with operating system tools, encryption prevents these users from viewing sensitive data.
Tables can also include virtual columns. A virtual column is like any other table column, except that its value is derived by evaluating an expression. The expression can include columns from the same table, constants, SQL functions, and user-defined PL/SQL functions. You cannot explicitly write to a virtual column.
Some column types, such as LOB
s, varrays, and nested tables, are stored in their own segments. LOB
s and varrays are stored in LOB
segments, while nested tables are stored in storage tables. You can specify a STORAGE
clause for these segments that will override storage parameters specified at the table level.
After you create a table, you insert rows of data using SQL statements or using an Oracle bulk load utility. Table data can then be queried, deleted, or updated using SQL.
See Also:
Oracle Database Concepts for an overview of tables
Oracle Database SQL Language Reference for descriptions of Oracle Database data types
Chapter 19, "Managing Space for Schema Objects" for guidelines for managing space for tables
Chapter 18, "Managing Schema Objects" for information on additional aspects of managing tables, such as specifying integrity constraints and analyzing tables
Oracle Database Advanced Security Administrator's Guide for a discussion of transparent data encryption