Previous Table of Contents Next


If a datafile cannot be accessed due to a disk failure, it must be restored to a new location or switched to an existing datafile copy. The following is an example that opens two channels—one to disk and the other to tape. It also moves the datafile to a new location and performs a restore of the datafile.


run{

allocate channel dev1 type disk;

allocate channel dev2 type ‘sbt_tape’;

sql “alter tablespace tablespace1 offline immediate”;

set newname for datafile ‘/uo1/oracle/datafiles/data1.dbf’ to

‘/uo2/oracle/datafiles/data1.dbf’;

restore (tablespace tablespace1);

switch datafile all;

recover tablespace tablespace1;

sql “alter tablespace tablespace1 online”;

release channel dev1;

release channel dev2;

}

In a VLDB, the backup and recover strategy is extremely important due to the requirements for high availability. It is important to consider the frequency and the type of backups you will be performing.

Table 33.4 describes the types of failure that can occur.

Table 33.4. Failure types.

Failure Type Description

Statement failure This is a logical failure in the processing of the statement, such as an incorrect syntax usage. Oracle usually returns an error message indicating the cause of such failure.
Process failure This is usually a failure in a user process, such as an abnormal disconnection or termination of the process. Usually an error is returned and Oracle and other processes continue to work.
User or application error Based on the type of error, you may need to perform point-in-time recovery. For example, a user accidentally deletes some data that is not supposed to be deleted.
Instance failure This error represents a situation that prevents the instance (system global area and the background processes) from continuing to work. It can be due to a hardware or software problem.
Media failure This represents a problem with the disk containing the data. A common situation is a disk head crash that prevents physical reading or writing of the files on disk.

types Within types

Oracle8 provides the ability to create types that can be used to simplify data representation. For example, name and address can be created as types that can be used in several table definitions.


Create type name_type(

first_name    varchar(25),

middle_name    char(1),

last_name    varchar(25));



Create type address_type(

street        varchar(30),

city        varchar(25),

state        varchar(2),

zip_code    number(5));



create table employee(

name        name_type,

hire_date    date,

address    address_type,

number procedure    give_tenure,

number function    give_salary number);



create table managers(

name        name_type,

department    varchar(10),

number function    give_number_of _team_members number);

As seen from this example, you can standardize and reuse type definitions, which results in simplifying data management.

Object Views

Object views allow you to create virtual object tables from data of either built-in or user-defined types stored in relational or object tables in the VLDB. Object views can be used as a powerful security mechanism because they allow you to provide a version of an underlying table that does not contain certain data—sensitive data—and also it may restrict the type of operations that can be performed against it.

Using object views you can

  Perform object-oriented operations without modifying the relational structure of the database
  Use legacy data with object-oriented applications
  Transparently and gradually migrate from relational tables to object-oriented objects

Object views provide the following advantages:

  Relational data makes up a row of an object view and can traverse the network as a unit, resulting in improved performance.
  Relational data can be fetched into the client-side object cache and mapped to C or C++ structures. As a result of this, 3GL applications can manipulate the data easily.
  Provide flexibility by allowing different in-memory representations of the same relational data.
  Allow for the co-existence of relational and object data in the same database.

Table 33.5 shows the various datatypes supported by Oracle8.

Table 33.5. Oracle8 datatypes.

Data format Supports

Datatype Scalar, Video, Spatial, Image, User-Defined
Data model Relational, Multidimensional, Object-oriented
Application DSS, OLTP

VARRAY

This is a new datatype supported in Oracle8. Like a regular array, it is an ordered list of elements. But, unlike an array, it is of variable size. You need to specify the maximum size when creating a VARRAY.


create type price as varray(1000) of number;

create type products (product_name varchar(20), product_value price); 

Summary

Operating systems and hardware and software enhancements are making it feasible for companies to use very large databases. Oracle8 has taken on the challenging task of realistically supporting such VLDB systems by providing several key features discussed in this chapter.

When you are dealing with a VLDB, you have to consider a lot of things that normally would not be considered in smaller databases, such as physical and logical design aspects that are more critical for VLDBs. Tuning of VLDBs takes on a new meaning, due especially to a more focused approach needed for system global area (SGA) usage.

Several administrative tasks, such as backup and recovery, become more challenging due to the high demands placed by VLDBs. This chapter discusses Oracle8 as a viable solution for such tasks.


Previous Table of Contents Next
Используются технологии uCoz