Read an Excerpt
From Chapter 2: Oracle8 Overview and Object Oriented Databases
...Parallelism is completely configurable in Oracle8. You can now use it to help you get information out of the database in minutes; you can also use it to recover a database in parallel in a fraction of the time it used to take.Oracle8 Backup and Recovery
The backup and recovery process has been reengineered in Oracle8. It has more automation and more audit trails than ever before. In addition, Oracle is working more closely with third-party vendors to provide you with more options than ever before. Oracle realizes that in order to be successful in this arena, they need the best possible tools.
Oracle8: Objects and New Database Objects
As we have discussed earlier, the relational model is used to represent data as a series of tables with columns and attributes. Oracle8 is an object-relational database. This means it has object-oriented technologies embedded within it. With this in mind, we should expect to be able to build complex object types in Oracle8 (complex in the sense we would expect you to be able to have objects within objects, and some ability to bind or encapsulate methods with those objects). Well, you won't be disappointed. Oracle8 does support complex object types.
In Oracle8, you have the ability to declare an object type by specifying a name with one or more attributes, coupled with some PL/SQL code. These attributes can be as simple as a varchar2 field to reference another object. These object types are complex in nature, since you can have objects referencing objects. The object you reference can also have embedded objects. Once these objects arecreated, they can be referenced elsewhere. As you can see, this ability to support complex objects is the basis of the object-relational database. Lets take a closer look at some object types supported in Oracle8.
Nested Objects
Oracle8 supports the concept of nested objects. With the create type command, you are able to create additional data types, and then reference those data types within other objects. The following listing demonstrates creating a new data type called room_capacity_type.
create type room_capacity_type (
auditorium_setting integer,
table_setting integer,
standing_room_setting integer);
The following listing references the newly created type in the conference_facility table. The type room_capacity_type exists with or without the table conference_facility. This type can be used in many different ways and in many different locations. This ability to extend the database with additional types is a very powerful capability. It is also a very powerful capability to help simplify the complexity of dealing with complex data types.
SQL*Plus: Release 4.0.3.0.0 - Production on Sun May 11 12:20:12 1999 copyright (c) Oracle Corporation 1979, 1994, 1996. All rights reserved. Connected to:
Oracle8 Server Release 8.0.3.0.1 - Production
With the distributed, heterogeneous, replication, objects and parallel query options
PL/SQL Release 3.0.3.0.1 - Production
SQL>
SQL> create table conference_facility (
2 room_name varchar2(20),
3 room_settings room_capacity_type);
Table created.
SQL> ** now let's insert into the table **
SQL> insert into conference_facility values (
2 'GREAT HALL', room_capacity_type(500, 200, 1000));
1 row created.
Varray
A new type recognized in Oracle8 is VARRAY. An array is an ordered list of elements. In Oracle8, they are called VARRAY since the array is of variable size. When we think of an array, we think of the mail boxes you see at old hotels when you check in. Each room in the hotel would have a slot in this big box holding the room keys. In Oracle8, an array is an ordered set of built-in types or objects called elements. Since the array is variable size, when you create it in Oracle8, you must always specify the maximum size. This listing uses VARRAY:
create type price as varray(100) of number;
It is interesting to note that when you create this array in Oracle8, the database does not actually go out and allocate any database space, it merely defines a new type and stores it in the system catalog. It is possible to reference this array in another table, as the data type of a column. For example,
create table car (car_name varchar2(25), car_val price);
This ability to support arrays of variable size is a very nice enhancement in Oracle8. Many times as a developer, this functionality would have made my job much easier. We look forward to using this newfound ability to manipulate order sets of objects...