Oracle8i
Enterprise Edition for Windows NT Getting
Started A68694-01 |
|
This appendix describes how to configure your system to
store data files for tablespaces on raw partitions.
Specific topics discussed:
In addition to storing data files for tablespaces on a
file system, data files can also be stored on raw partitions.
A raw partition is a portion of a physical disk
that is accessed at the lowest possible level. Input/output (I/O) to
a raw partition offers approximately a 5% to 10% performance
improvement over I/O to a partition with a file system on it.
A raw partition is created after generation of an
extended partition and a logical partition, after partitions are
assigned to it and before applying any formatting. The Windows NT
Disk Administrator application enables you to create an extended
partition on a physical drive.
An extended partition points to raw space on the
disk that can be assigned multiple logical partitions for the
database files. An extended partition also avoids the four-partition
limit by letting you define large numbers of logical partitions to
accommodate applications using Oracle8i Enterprise Edition.
Logical partitions can then be given symbolic link names to free up
drive letters.
The Disk Administrator window illustrated in the figure below shows four disks. Two of the disks have an extended partition.
Disk 0 |
A primary partition |
Disk 1 |
An extended partition with six logical partitions and 246 MB of free space |
Disk 2 |
An extended partition with three logical partitions and 1146 MB of free space |
Disk 3 |
An unformatted partition |
|
|
Windows NT defines each disk drive found at startup with the following naming convention:
where Harddiskm is the number of the physical
drive, and Partitionn is a logical partition number, as shown
in the Disk Administrator window (in the above figure).
Harddiskm starts at 0, and Partitionn starts at 1.
Partition0 has a special meaning in that it has access to the whole disk. For example, the first logical partition (E:) on the second physical drive in the above figure has the following entry:
The first logical partition on a system (normally the C drive) has the following entry:
Raw partitions are of two types:
Note: Although you can use physical disks, Oracle Corporation recommends that you use logical partitions. |
A physical disk represents the entire disk and points to
\Device\Harddiskx\Partition0.
Windows NT automatically creates a symbolic link name of
\\.\PhysicalDrivex, where x is the number corresponding
to your hard disk drive number in the Disk Administrator. The
x matches the x in
\Device\Harddiskx\Partition0.
\\.\PhysicalDrivex is automatically defined by Windows NT for every hard disk in the machine. For example, a machine with three hard disks:
\\.\PhysicalDrive0 \\.\PhysicalDrive1 \\.\PhysicalDrive2
Internally, these names expand to
\\.\PhysicalDrive0 = \Device\Harddisk0\Partition0 \\.\PhysicalDrive1 =\Device\Harddisk1\Partition0 \\.\PhysicalDrive2 =\Device\Harddisk2\Partition0
Partition0 is special, because it represents the entire
physical disk regardless of any partitioning scheme on that disk. On
all disks recognized by Windows NT, the Disk Administrator writes a
signature on the first block of all disks. To avoid overwriting that
block, Oracle skips the first block of a physical raw partition that
is used for an Oracle data file.
A logical partition is a partition created by the Disk
Administrator that points to a drive other than
\Device\Harddiskx\Partition0.
Logical partitions are initially assigned names with drive letters (\\.\DRIVE_LETTER:) and typically re-assigned symbolic link names (\\.\SYMBOLIC LINK NAME). For example, \\.\D: may be assigned a symbolic link name of \\.\ACCOUNTING_1. Regardless of whether a drive letter or symbolic link name is used, logical partitions are defined to represent a specific partition in a disk rather than the entire disk. Internally, these names may expand to:
\\.\D:= \Device\Harddisk2\Partition1 \\.\ACCOUNTING_1= \Device\Harddisk3\Partition2
Drive letters can be assigned to specific partitions,
using the Disk Administrator. Symbolic link names can, on the
other hand, be assigned using a utility such as DOSDEV.EXE, which is
available with the Windows NT Resource Kit, or the SETLINKS
utility.
Note: Oracle does not skip the first block of a logical raw partition used for an Oracle data file. |
Consider the following when deciding which raw partition to use:
Question: What is the impact if I have created logical partitions, but defined physical disk convention names for them. For example:
Question: What is the impact if I have created logical names representing Partition0? For example:
Answer: This poses severe problems, because the Disk Administrator typically writes a signature into the first block of every disk, and consequently may overwrite a portion of the data file header.
This can also cause data loss. Never use Partition0 with
the logical partition convention. See "Compatibility
Issues" below for information on rebuilding your Oracle database
with the proper conventions.
Question: How do I transfer the contents of
any raw partition to a standard file system for backup
purposes?
Answer: Use the Oracle-provided OCOPY tool to copy data to/from a raw partition for both physical and logical raw conventions. See "Compatibility Issues" below for further information.
The physical and logical partition conventions are not
compatible with one another because of the extra block that is
skipped for physical raw conventions. This also means you cannot
simply do an OCOPY from a physical disk to a logical partition,
because the contents of these partitions are incompatible.
To convert from a physical convention to a logical convention, you must:
If your database installation uses physical disk
conventions with logical partitions, Oracle Corporation recommends
converting to the logical partition conventions at your earliest
convenience, using the preceding steps.
Only one extended partition can be created per disk. You
can use the free space in the extended partition to create multiple
logical partitions or use all or part of it when creating volume sets
or other kinds of volumes for fault-tolerance purposes.
To create an extended partition:
Note: Changes that you have made are not saved until you choose Commit Changes Now from the Partition menu or quit Disk Administrator. |
Note that the lines now display diagonally from top left to bottom right, indicating the partition is an extended partition.
After an extended drive is created, you must assign
logical partitions to it. Logical partitions are assigned letters of
the alphabet.
To create logical partitions in an extended partition:
Hard Diskx |
Partitions x-x |
Hard Diskx |
Partitions x-x |
If you do not want to use the drive letters assigned to
the logical partitions that you created in "Creating
Logical Partitions in an Extended Partition", use the Oracle
SETLINKS utility to create symbolic links to raw logical partitions.
Otherwise, keep the drive letters and proceed to "Creating
a Tablespace in a Raw Partition".
The SETLINKS utility requires an input ASCII file that
maps a symbolic link name to a raw partition. the following figure
shows an ASCII file that maps two symbolic links, ACCOUNTING_1 and
ACCOUNTING_2, to two logical partitions on the first disk:
To assign symbolic links to each logical partition:
ACCOUNTING_1 |
Harddisk1 Partition1 |
ACCOUNTING_2 |
Harddisk1 Partition2 |
Oracle Corporation. Copyright (c) 1998. All rights reserved. Created Link: Created Link:6 = Device:\Device\Harddisk1\Partition1 Created Link:ACCOUNTING_2 = Device:\Device\Harddisk1\Partition2 Dos devices updated successfully.
Oracle Corporation. Copyright (c) 1998. All rights reserved. ACCOUNTING_1 = \Device\Harddisk1\Partition1 ACCOUNTING_2 = \Device\Harddisk1\Partition2
You can remove or ignore links by changing the contents
of the input file and running it through SETLINKS again.
To remove an existing symbolic link:
ACCOUNTING_1 ACCOUNTING_2 \Device\Harddisk1\Partition2
To ignore links:
To create a tablespace using a data file located in a raw partition:
SQL> CREATE TABLESPACE TABLESPACE DATAFILE '\\.\DATAFILE' SIZE XM;
For example, to create a tablespace named ACCOUNTING_1 that was assigned a symbolic link name of ACCOUNTING_1, enter the following:
SQL> CREATE TABLESPACE ACCOUNTING_1 DATAFILE '\\.\ACCOUNTING_1 SIZE 502M;
Note: if you are creating a database with the BUILD_DB.SQL script, modify data files that are stored on raw partitions with a naming convention of \\.\DRIVE_LETTER: or \\.\SYMBOLIC LINK NAME. See "Putting the CREATE DATABASE Statement in a Script" |