Skip Headers
Oracle® Database Platform Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E10845-08
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

B Storing Tablespaces on Raw Partitions

This appendix describes how to configure your system to store datafiles for a tablespace on raw partitions.

This appendix contains these topics:

Note:

Oracle RAC requires additional configuration tools. See Oracle Real Application Clusters Administration and Deployment Guide for information on creating logical partitions and assigning symbolic links. Do not use this appendix to create partitions for Oracle RAC.

Raw Partition Overview

Datafiles for tablespaces can be stored on a file system or 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.

Physical Disk

A physical disk represents the entire disk and points to the following:

\Device\Harddiskx\Partition0

Symbolic link name \\.\PhysicalDrivex is automatically defined by Windows for every hard disk in the computer. For example, a computer with three hard disks will have the following symbolic links:

\\.\PhysicalDrive0 
\\.\PhysicalDrive1 
\\.\PhysicalDrive2 

Internally, these names expand to the following:

\\.\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. Windows writes a signature on the first block of all disks it recognizes. To avoid overwriting that block, Oracle Database skips the first block of a physical raw partition that is used for an Oracle Database datafile.

Note:

Although you can use physical disks, Oracle recommends that you use logical partitions.

Logical Partition

Logical partitions point to drives other than \Device\Harddiskx\Partition0. They 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 can expand to:

\\.\D:= \Device\Harddisk2\Partition1 
\\.\ACCOUNTING_1= \Device\Harddisk3\Partition2 

Note:

Oracle Database does not skip the first block of a logical raw partition used for an Oracle Database datafile.

Physical Disk and Logical Partition Considerations

Consider the following when deciding which raw partition to use:

  • Physical disks are automatically defined by Windows to represent the entire disk, and should never be defined by the user.

  • Logical partitions must be defined by the user to represent a specific partition in a disk. These partitions should be logical partitions or drives contained in an extended partition. They should never be defined as Partition0.

  • Using an entire disk (Partition0) for an Oracle Database datafile and using a partition that occupies the entire disk for an Oracle Database datafile are not the same thing. Even when a partition occupies the entire disk, there is still a small space on the disk that is not part of the partition.

  • If you are using an entire disk for an Oracle Database datafile (Partition0), then use the pre-defined physical raw names that Windows provides.

  • If you are using a specific partition and it occupies the entire disk, then use a logical partition.

  • If you are using a specific partition created with Windows disk-management tools, then define and use a symbolic link name rather than a logical partition number (even if it occupies the entire disk).

Note:

For both physical and logical raw conventions, use OCOPY to transfer the contents of a raw partition to a standard file system for backup purposes.

Compatibility Issues

You can create logical partitions, but define physical disk convention names for them. For example:

\\.\PhysicalDriveACCOUNTING_1 = \Device\Harddisk2\Partition1 
\\.\PhysicalDriveACCOUNTING_2 = \Device\Harddisk3\Partition1 

Oracle Database then handles datafiles using the physical disk convention even though it really is a logical partition. This will not cause any data corruption or loss as long as you continue to use physical disk naming conventions. Oracle recommends that you convert to the logical partition at your earliest convenience.

You can also create logical names representing Partition0, but this is definitely not recommended. For example:

\\.\ACCOUNTING_1 = \Device\Harddisk1\Partition0 

This poses severe problems, because Disk Management typically writes a signature into the first block of every disk, and consequently may overwrite a portion of the datafile header. It can also cause data loss. Never use Partition0 with the logical partition convention.

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 use OCOPY to copy from a physical disk to a logical partition, because contents of these partitions are incompatible.

To convert from a physical convention to a logical convention, you must:

  1. Perform a full database export to a (local) file system.

  2. Create logical partitions and define logical names for these partitions.

  3. Recreate the database by using the new logical partitions.

  4. Perform the full database import to the newly-created database.

If your database installation uses physical disk conventions with logical partitions, Oracle recommends converting to the logical partition conventions at your earliest convenience, using the preceding steps.

See Also:

Your operating system documentation for information on creating extended and logical partitions

Creating a Raw Partition and a Mount Point

To create a raw partition, you must first generate an extended partition and a logical partition. An extended partition points to raw space on the disk that can be assigned multiple logical partitions for database files. An extended partition also avoids the four-partition limit by letting you define large numbers of logical partitions to accommodate applications using the Oracle Database server. Logical partitions can then be given symbolic link names to free up drive letters.

On Windows Vista, Windows Server 2008, and Windows Server 2008 R2, create primary partitions and logical drives in extended partitions by selecting the New Simple Volume option. To create a raw device, select Do not assign a drive letter or drive path. To mount the raw device, assign and remove a drive letter. Do not use spanned volumes or striped volumes. These options will convert the volume to a dynamic disk. Automatic Storage Management does not support dynamic disks.

You can use diskpart.exe for disk management from the command line. It can increase the disk volume capacity dynamically and create, delete, and resize partitions and volumes.

Volume mount point offers additional storage space on a volume. Different partitions appear as a single logical volume and that is why it surpasses the 26-drive letter limitation. Use mount points as an alternative to drive letters.

See Also:

The Microsoft Web site for more information about raw partitions and volume mount points

http://www.microsoft.com/en/us/default.aspx

Creating a Tablespace in a Raw Partition

To create a tablespace using a datafile located in a raw partition:

  1. Start SQL*Plus:

    C:\> sqlplus
    
  2. Connect to the Oracle Database repository database:

    SQL> CONNECT SYSTEM
    Enter password: password
    

    where password for user account SYSTEM is MANAGER by default. If you have changed this password, substitute the correct password for MANAGER.

  3. Create the tablespace:

    SQL> CREATE TABLESPACE tablespace DATAFILE '\\.\datafile' SIZE xm;
    

    where:

    • tablespace is the tablespace name

    • '\\.\' is the drive letter or symbolic link name assigned to the raw partition

    • x is the tablespace size in megabytes (Twenty megabytes is a good starting place.)

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 SQL script, modify datafiles that are stored on raw partitions with a naming convention of \\.\drive_letter: or \\.\symbolic link name.

Configuring Disks for Automatic Storage Management

To use Automatic Storage Management with direct attached storage (DAS) or storage area network (SAN) storage, the disks must be stamped with a header by asmtool or asmtoolg (GUI version).

See Also:

"Manually Configuring Disks for Automatic Storage Management" in Oracle Database Installation Guide for Microsoft Windows for instructions on using asmtool or asmtoolg

Each DAS or SAN disk must have a partition table. Oracle recommends creating exactly one partition for each disk containing the entire disk. Use Microsoft Computer Management or the command line tool diskpart to create the partition. Once the partitions have been created, run asmtoolg or asmtool. These tools associate meaningful, persistent names with disks to facilitate using those disks with Automatic Storage Management. Automatic Storage Management uses disk strings to more easily operate on groups of disks at once, so the names created by asmtool make this easier than using Windows drive letters. All disk names created by asmtool begin with the prefix ORCLDISK for identification purposes.

Automatic Storage Management uses the value of initialization parameter ASM_DISKSTRING as its search path when it discovers disks. The default value of ASM_DISKSTRING is \\.\ORCLDISKn. If you want a different search path, then you must specify a different value for this parameter.

See Also:

"Initialization Parameters for ASM Instances" in Oracle Database Administrator's Guide