Part I – Partition the Disk
Once upon a time when you purchased Oracle software, they gave you something called a manual. A lot in fact, I fondly remember an entire bookshelf of Oracle 7.1 manuals back when I worked for BP.
Later Oracle decided to save themselves the money, and you the shelf space, and started shipping documentation on CD.
Now everything is online which is both a blessing and a curse.
Despite all the websites, blogs and such, nothing is ever as good as having your own sandbox to go play in, test, create, destroy and rebuild. Oracle’s open download and no license for non-production use policy means that many of us get a chance to build our own sandboxes on old PC equipment around the house, but for some technologies this gets a little harder, such as RAC as well as ASM.
ASM is Oracle’s own volume management software that was originally intended to encourage the adoption of RAC technology on Linux and Windows by providing a no-extra-cost volume management solution that was cluster enabled. Increasingly however ASM has become the default volume management package for all Oracle database installs whether RAC is implemented or not. ASM is designed to operate on block devices and is really intended for use on servers connected to commercial grade storage arrays or at the very least with some commercial grade DAS.
Oracle has provided some opportunities to use ASM on much cheaper consumer grade PC equipment which allows the DBA without access to a comprehensive development environment, some opportunity to gain familiarity with the ASM technology and syntax.
This entry concerns the creation of an Oracle 10gR2 database using ASM for storage on a Windows 7 32-bit (Home Edition) PC.
ASM is designed to be a block based volume management package. Although Oracle provides a hidden parameter _asm_allow_only_raw_disks which can be set to FALSE to allow ASM to use cooked disks, I wanted to try to keep my sandbox looking at least something like a real system, and partitioning the disks to provide some real block level storage seemed a better option.
Windows makes this task really easy with the Disk Management facility found in the Control Panel under Administrative Tools.
Selecting the primary C: disk, right clicking allows us to select “Shrink Volume”. After some time Windows will report the amount by which the volume can be shrunk. In my case I chose to shrink it by 32GB which is the amount of space I wanted to give to ASM. If you are really pushed for space it should be possible to create an ASM disk group and a functional sandbox database out of as little as 2 to 4GB.
The shrink can take a while to complete, but once it is done, Windows will show a 32Gb chunk of disk that is not used by Windows and is not formatted.
We can now use the Windows DISKPART tool to create an logical partition in this free space. ASM requires that we create a partition which will later be stamped by ASM for Oracle use.
Microsoft DiskPart version 6.1.7601 Copyright (C) 1999-2008 Microsoft Corporation. On computer: USSATHORNG1L2C DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 232 GB 32 GB DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 200 GB 1024 KB DISKPART> create partition extended DiskPart succeeded in creating the specified partition. DISKPART> create partition logical DiskPart succeeded in creating the specified partition. DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 200 GB 1024 KB Partition 0 Extended 32 GB 200 GB * Partition 2 Logical 31 GB 200 GB DISKPART>
Now if we inspect the Windows Disk Manager again, we will see our 32GB chunk is now a healthy raw logical partition, ready for ASM.