Monday, January 25, 2010

Managing Schema Objects

Create and Modify tables:
TBD



Manage Constraints: An integrity constraint defined on the table can be in one of the following states
  • enable, validate (validate is default if constraint is enabled)
  • enable, novalidate
  • disable, validate
  • disable novalidate (novalidate is default if constrant is disabled)
Create Indexes:
TBD


Create and use temporary tables
The definition of a temporary table is visible to all sessions, but the data in a temporary table is visible only to the session that inserts data into the table. There are two types of temporary tables:
  • Session specific
    • The db truncates the table when you terminate the session
    • Specified by ON COMMIT PRESERVE ROWS clause
  • Transaction specific
    • The db truncates the table after each commit.
    • Specified by ON COMMIT DELETE ROWS clause.
By default temporary tables are stored in the default temporary tablespace of the user who created it. You can alternatively create a temporary tablespace and create the temporary table on that tablespace. Eg: create global temporary table test_temp (startdate date, ......) on commit DELETE ROWS [tablespace some_temp_tbsp]

No comments:

Post a Comment