Understanding Raw Devices for Oracle Databases: Definition, Benefits, and Practical Guidelines
This article explains what raw (裸) devices are, how to identify and use them with Oracle on Unix, their performance advantages, when they should be employed, and practical tips for configuration, backup, and related storage considerations.
1. What is a raw device? A raw device, also called a raw partition, is an unformatted special character device that is not accessed through a Unix file system; applications read and write it directly without filesystem buffering.
2. How to identify a raw device? In the Unix /dev directory, character device files perform I/O without OS buffering, while block device files use caching. Raw devices are accessed via character special files, which you can see among many entries in /dev.
3. Benefits of using raw devices By bypassing the Unix file system, data moves directly from disk to Oracle, which can improve performance for I/O‑intensive databases up to about 40 % when disk I/O is the bottleneck. It also eliminates file‑system overhead such as inode and free‑block management.
4. When to decide on raw devices Consider raw devices only after the database has been well tuned and you have verified a disk I/O bottleneck (e.g., using vmstat, sar). You also need free partitions on the disk; otherwise you must add disks or re‑plan the layout.
5. Systems that must use raw devices Oracle Parallel Server requires raw devices for all data files, control files, and redo logs. Some Unix systems also require raw devices for asynchronous I/O, as documented in their manuals.
6. Can the first partition of a disk be used as a raw device? It is possible but not recommended because older Unix versions store disk metadata and volume‑group information in the first partition; overwriting it can render the disk unusable. Newer Unix versions handle this more safely, but caution is still advised.
7. Can an entire raw device be used for Oracle data files? No. Data files must be slightly smaller than the raw device, leaving at least two Oracle block sizes free.
8. Ownership of raw devices Raw devices should be created by root and then assigned to the Oracle user and its group (typically DBA).
9. Specifying a raw device when creating a data file Use the device path inside single quotes, just like a regular file. Example for creating a tablespace with two 30 MB raw devices (Oracle block size 4 KB):
CREATE TABLESPACE ts_raw DATAFILE '/dev/raw1' SIZE 30M, '/dev/raw2' SIZE 30M;10. Relationship between Oracle block size and raw devices Oracle block size must be a multiple of the physical block size of the raw device.
11. Backing up a raw device Unix utilities cannot back up raw devices directly; the typical method is to use dd, e.g., dd if=/dev/raw1 of=/dev/rmt0 bs=16k. After copying to tape, further Unix tools can process the backup.
12. Mixing raw devices and file‑system files If Parallel Server is not used, you may place some data files on a file system and others on raw devices, though this complicates backup procedures.
13. Should online redo logs be on raw devices? Yes, especially with Parallel Server, because redo logs are heavily written and benefit from raw‑device performance.
14. Can archived redo logs be on raw devices? No. Archived logs must reside on a regular Unix file system or tape.
15. Multiple data files on a single raw device Not allowed; each raw device should host only one data file, leaving space for at least two Oracle blocks.
16. Placing several raw devices on the same physical disk Not advisable, as it creates I/O contention and defeats the performance advantage of raw devices. Distribute them across different disks and controllers.
17. Should all raw devices be the same size? Not required, but using uniform sizes simplifies management.
18. Need to change Unix kernel parameters for raw devices? Generally no, though you may reduce buffer sizes if the system is dedicated to Oracle, since raw devices bypass the kernel buffers.
19. Additional OS‑level performance tricks Using RAID, especially for I/O‑intensive workloads, can further improve throughput.
20. Further performance improvements Optimize Oracle itself and add more disks and controllers to spread I/O across multiple devices.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architects' Tech Alliance
Sharing project experiences, insights into cutting-edge architectures, focusing on cloud computing, microservices, big data, hyper-convergence, storage, data protection, artificial intelligence, industry practices and solutions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
