This bulletin describes the steps in setting up the Oracle7 database on a RAW Partition.
---------------------------------------------------------------------------
What is a Raw device and what is the advantage of having a Raw device?
A Raw device, or a Raw disk partition, is a hardware device that is supported by a character device driver. Raw devices are not buffered by the kernel; the data is transferred directly between the user's buffers and the device. This direct transfer makes the I/O operation much faster when compared to FAT and NTFS file systems. So, if you are I/O bound with your system, you may want to locate your log and datafiles to RAW partitions to gain I/O performance.
The trade-off of the raw partition choice is restricted configuration options. Each RAW partition equates to a single file and is represented by a single file which is then represented by a single drive letter.
Since the Log files are an I/O intensive operation, you may want to put them on RAW Partitions. If you want to locate the Log files on RAW partitions, you have to do it at the time of the creation of the database. For example:
- Go into the "Disk Administrator" in the Administrative Tools. If you already have free space there. Single click on it.
NOTE: If you don't have free space, you have to delete one of the partitions that you don't need anymore. To do so, select the drive that you don't want anymore, then select "Delete", under the "Partition" menu.- Go to "Partition" menu and select "Create" in "Create Primary Partition" screen. Create the partition equal to the size of the file plus 1M, then click on OK.
- Do the same thing to create the new unformatted partitions for the other files.
- Go to "Partition" menu and click on "Commit Changes Now...", to save the changes.
- Each partition now is represented by a drive letter like 'e: ' or 'I:', and you can locate one file on each of them.
CREATE DATABASE CONTROLFILE REUSE LOGFILE GROUP 1 ('\\.\e:') size 14M, GROUP 2 ('\\.\i:') size 14M;
This will create a database with the logfiles located on RAW partitions '\\.\e:' and '\\.\i:' of size 15 MB. Always leave 1M to avoid written data to cylinder 0 of the disk. In order to create data tablespaces mapped to datafiles, on RAW partitions. Do like the following example:
CREATE TABLESPACE DATA DATAFILE '\\.\f:' SIZE 49M;
This will create a 49 MB tablespace on RAW partition '\\.\f:', which has a size of 50 MB. (Again 1M to avoid cylinder 0)
When creating a datafile that will use the RAW device, make sure that the datafile is smaller than the size of the RAW device. For example if you create a 100 MB RAW partition, do not allocate a datafile of size 100M. Instead allocate a datafile of 99 MB. the usual rule of thumb is to leave 1M, unused. Following this rule ensures that you won't write over cylinder 0 of the disk.
There is a potential problem involved with the use of the RAW partitions:
- The OS will not protect cylinder 0 of the disk, if it's part of the RAW partition. To prevent this make sure the RAW partition used by Oracle does not start at cylinder 0. If you try to create a tablespace on a RAW partition with a size equal to the size of the RAW partition, you will receive the following error messages:
- ORA-01119, 00000, "error in creating database file '\\.\k:' // *Cause: Usually due to not having enough space on the device.
- ORA-09200: Sfccf: error creating file OSD-04008: Writefile() failure, unable to write to file(OS 87)