05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

418<br />

CHAPTER 10 ■ DATABASE TABLES<br />

6 address_type(work_city,work_street,work_state,work_zip) work_adress<br />

7 from people_tab<br />

8 /<br />

View created.<br />

ops$tkyte@ORA10G> insert into people values ( 'Tom', '15-mar-1965',<br />

2 address_type( 'Reston', '123 Main Street', 'Va', '45678' ),<br />

3 address_type( 'Redwood', '1 <strong>Oracle</strong> Way', 'Ca', '23456' ) );<br />

1 row created.<br />

However I achieve very much the same effect, I know exactly what is stored, how it is<br />

stored, <strong>and</strong> where it is stored. For more complex objects, we may have to code INSTEAD OF<br />

triggers on the object views to allow for modifications through the view.<br />

Object Tables Wrap-Up<br />

Object tables are used to implement an object relational model in <strong>Oracle</strong>. A single object table<br />

will create many physical database objects typically, <strong>and</strong> add additional columns to your<br />

schema to manage everything. There is some amount of “magic” associated with object tables.<br />

Object views allow you to take advantage of the syntax <strong>and</strong> semantics of “objects,” while at the<br />

same time retaining complete control over the physical storage of the data <strong>and</strong> allowing for<br />

relational access to the underlying data. In that fashion, you can achieve the best of both the<br />

relational <strong>and</strong> object-relational worlds.<br />

Summary<br />

Hopefully after reading this chapter, you have come to the conclusion that not all tables are<br />

created equal. <strong>Oracle</strong> provides a rich variety of table types that you can exploit. In this chapter,<br />

we have covered many of the salient aspects of tables in general <strong>and</strong> explored the many different<br />

table types <strong>Oracle</strong> provides for us to use.<br />

We began by looking at some terminology <strong>and</strong> storage parameters associated with tables.<br />

We looked at the usefulness of freelists in a multiuser environment where a table is frequently<br />

inserted/updated by many people simultaneously, <strong>and</strong> how the use of ASSM tablespaces<br />

could make it so we don’t even have to think about that. We investigated the meaning of<br />

PCTFREE <strong>and</strong> PCTUSED, <strong>and</strong> developed some guidelines for setting them correctly.<br />

Then we got into the different types of tables, starting with the common heap. The heap<br />

organized table is by far the most commonly used table in most <strong>Oracle</strong> applications, <strong>and</strong> it is<br />

the default table type. We moved on to examine index organized tables (IOTs), which provide<br />

us with the ability store our table data in an index structure instead of a heap table. We saw<br />

how these are applicable for various uses, such as lookup tables <strong>and</strong> inverted lists, where a<br />

heap table would just be a redundant copy of the data. Later, we saw how IOTs can really be<br />

useful when mixed with other table types, specifically the nested table type.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!