Oracle7 Administrator's Reference for UNIX

Contents Index Home Previous Next

Planning a Database

Issues to consider when setting up a database include performance, reliability, scalability, ease of maintenance, and cost-effectiveness. Many tasks in this chapter are best performed first on a test database.

Perform the following tasks in planning your database:

****************

Task 1: Define Database Requirements

Before you define your system, define the demands you will place on it.

Consider the following criteria:

See Also: "The Oracle7 Database Administrator", "Creating a Database", "Establishing Security Policies", and "Backing Up a Database" chapters in the Oracle7 Server Administrator's Guide for conceptual information.

****************

Task 2: Estimate Database Hardware Requirements

Based on the requirements defined in Task 1, estimate the hardware requirements for your system.

Use I/O Rates to Calculate Disk Drives Needed

Based on the throughput required to sustain transaction rates, calculate the number of disks required, as well as anticipated database size. Use the TKPROF utility to help determine disk requirements.

For example, if four physical I/Os are needed for one transaction, and your application performs 100 transactions per second, you need about 400 disk I/Os per second. One disk can perform approximately 50 random I/O operations per second, so the system requires at least 8 disk drives (400/50) with the data files balanced across the disks.

Also, spread disk drives between many controllers. Most disk controllers can only sustain two drives doing sequential reads simultaneously. If tables are used for parallel queries, no more than two disks should be active on a single controller.

See Also: "Tools for Planning and Tuning a Database"[*] for more information on the TKPROF utility.

Configure the UNIX Kernel for Oracle7

It is important to configure your UNIX operating system to support the Oracle7 Server.

See Also: Chapter 3, "Setting the Environment", in the Oracle7 Installation Guide for your platform for information on configuring and rebuilding the UNIX kernel.

****************

Task 3: Plan an Optimal Flexible Architecture (OFA) Database Structure

The Optimal Flexible Architecture (OFA) Standard is a set of configuration guidelines that provides faster, more reliable Oracle databases that require less maintenance.

When you install the Oracle7 Server, tools, applications, and databases, you decide where to place files and how to allocate data across disks. Oracle allows great flexibility for these installation decisions. OFA requirements and rules are cited throughout the first three chapters of this guide.

OFA is designed to:

See Also: Appendix B, "Summary of the OFA Standard", for a comprehensive list of the OFA requirements and rules.

OFA Requirements

The OFA standard is defined in the following 13 requirements. The OFA recommendations for how to meet these requirements appear in Chapter 2, "Oracle7 Architecture on UNIX". For an OFA-compliant database, you must:

Select an Installation Configuration

Oracle7 can be installed as either a server-based or client/server system.

See Also: Chapter 20, "Client/Server Architecture" in Oracle7 Server Concepts for more information on installation configurations.

****************

Task 4: Decide on Raw Devices

Raw devices can improve database performance, but there are implications in terms of administration and flexibility.

Advantages of Raw Devices

Raw devices provide the following advantages:

Raw devices offer the greatest benefit when used for write-intensive, sequentially accessed data, such as redo log files.

Disadvantages of Raw Devices

Disadvantages of using raw devices include:

Note: This disadvantage can be largely eliminated by use of the Enterprise Backup Utility, which is available on many UNIX platforms.

Do not use raw devices if:

Other Raw Device Considerations

Raw devices can be used concurrently with a file system. For example, redo log files can be stored on raw devices while small, infrequently accessed tables normally in the buffer cache or tables can be left in the file system.

Setting up Raw Partitions

If you use raw devices, when partitioning and formatting disk drives you should:

Oracle Corporation recommends you:

Raw Redo Logs

Because raw devices are most beneficial for files that receive sequential writes, redo logs are ideal candidates for raw devices. In addition, online redo log files are not usually included in operating system backup procedures, so one of the primary administrative challenges for raw devices is removed.

Using Logical Volumes

Oracle Corporation recommends using a Logical Volume Manager (LVM) if available.

See Also: The Oracle7 Reference Addendum for your platform to determine if your system supports an LVM.

Balancing Disk I/O with a Logical Volume Manager

A typical stripe size is 4 MB. Use the following guidelines to determine the best size for raw partitions on your system:

Stripe all data files containing indexes and clusters, as well as those containing tables.

****************

Task 5: Define Database Backup Strategy

Define a backup and recovery strategy before creating a database.

See Also: Chapter 4, "Backing Up and Recovering Oracle7 on UNIX" in this guide and Part V, "Database Backup and Recovery", in the Oracle7 Server Administrator's Guide for information on backup and recovery.

****************

Task 6: Plan Space Management Parameters

The Oracle OFA rules help eliminate fragmentation of free space in the data dictionary, isolate other fragmentation, and minimize resource contention.

Setting Storage Parameters Appropriately

Database performance suffers with excessive dynamic space management. Use the information in the following sections to minimize the number of dynamically allocated extents and substantially reduce the need for de-fragmentation in the future.

Pre-allocating Space for Tables, Indexes and Rollback Segments

Pre-allocate enough space for tables, indexes, rollback segments, and temporary segments by using appropriate values for the following storage parameters for each segment type:

Storage Parameter Default Setting
INITIAL 5 database blocks
NEXT 5 database blocks
MINEXTENTS 1 database block
MAXEXTENTS Determined by block size (see Table 1 - 2). Only set if you want $MAXEXTENTS to be less than the value dictated by block size.
PCTINCREASE 0
Table 1 - 1. Storage Parameters and Default Settings

When tables are created without a storage parameter, a default is set. To check the parameters in a running database, use the following SQL command:

SELECT * FROM DBA_TABLESPACES;

See Also: Chapter 1, "Oracle7 Server", in the Oracle7 Reference Addendum for your platform and Chapter 1, "Initialization Parameters", in the Oracle7 Server Reference for default settings for initialization parameters.

Adjust the value of the PCTFREE parameter to allocate space in the data blocks:

Initializing Data and Index Segments

Before the installation, set INITIAL large enough for the initial data and index sizes plus the PCTFREE in each data block. Choose a value for INITIAL such as 256K, 512K, 1M, 2M, or 32M to minimize tablespace fragmentation.

Set NEXT to the same value as INITIAL.

Suggestion: Set INITIAL to one-tenth the size of the file.

PCTINCREASE should normally be set to zero. The number of possible extents is determined by the block size, as shown in Table 1 - 2.

Block Size Number of Extents Platforms and Uses for Block Size (most can be set larger)
2 KB 121 Sun, Hewlett-Packard, Sequent, most UNIX platforms
4 KB 249 IBM-AIX, Sequent (for large databases)
8 KB 507 For VLDBs
16 KB 1017 For decision-support VLDBs
Table 1 - 2. Block Size and Number of Extents

Initializing Temporary Segments and Rollback Segments

Temporary segments and rollback segments are used dynamically. Configure temporary segments with INITIAL set to ks + b

where:

k is an integer between 1 and 20 (typically 2 - 3)
s is the sort area (in data blocks)
b is one data block
Set NEXT to ks and PCTINCREASE to zero.

Rollback segments should be allocated initially as 20 to 40 equal-sized extents (for example, MINEXTENTS=30). Each extent (INITIAL and NEXT) should be about 0.25 to 0.50 percent of the size of the largest active table. MAXEXTENTS should be set to a high value. Try to allocate at least one rollback segment per available disk drive to spread the I/O as widely as possible.

Suggestion: Oracle Corporation recommends the following guidelines:

See Also: Oracle7 Server Administrator's Guide for information about configuring data objects.


Contents Index Home Previous Next