How to use a raw partition with Oracle 8i at Solaris 2.6

I try to configure a Solaris System
with Oracle8i for use with a
raw partition. Who knows the right way?

best regards
Who is Participating?
mshaikhConnect With a Mentor Commented:
Another thing I noticed is that you are using slice 0. This will not work. Try format the disk so that at least the first cylinder is associated with slice 0  to hold the label and volume table of contents.  Format subsequent slices to start after cylinder 1 and use these for your raw devices.  For example use:  
    /dev/rdsk/c0t2d0s1  not   /dev/rdsk/c0t2d0s0.  
Change the owner and group of the raw special device files created by the format  command to oracle/dba so you will have permissions to write to the device. Gennerally avoid  using slice 2 as this normally  whole disk.  
It should be described in the Installation manual or in the Unix DBA guide.
You need to know the size of your raw partition when creating the table space. When creating the tablespace on a raw partition, you must give the SIZE that is equal to the size of the raw partition minus one Oracle block (the file header), otherwise it will terminate with an error.
Honestly, I would not recommend you using raw partitions. It used to be that raw was faster than unix file systems. But this is practically no longer the case. Considering additional headaches in using raw, this difference is not worth it. Another reason for raw used to be that not all unix systems supported synch writes for file systems and because of this redo logs were always in jeopardy, that's why we used to put logs on raw partitions. Now, I believe all unix systems support synch writes and youy can run logs on unix files. Considering that modern disk storage systems like Veritas or EMC are completely different, the concept of raw vs unix files is practically irrelevant.
So if I were you I wouldn't even think about raw.
You will need to create the raw devices as root, but the ownership
should be changed to the 'oracle' account afterwards. The group must
also be changed to the 'dba' group (usually called dba). Say you created two raw devices /dev/raw1 and /dev/raw2.

To use raw device you need to specify the full pathname in
single quotes, and use the REUSE parameter.  e.g. if the two raw
devices are each 30Mb in size, and the database has a 4K block size, the
relevant command would look like this:

create tablespace raw_tabspace datafile '/dev/raw1' size 30712K REUSE
datafile '/dev/raw2' size 30712K REUSE

Note that the raw partitions are under /dev directory the raw1 and raw2 are
unix  raw partitions.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

The only reason for raw device is probably parallel server. Is this your case ?
Gerald02Author Commented:
I tried to use what mshaikh's
written but it doesn't work.

The raw solaris raw partition is at
/dev/rdsk/c0t2d0s0. I've tried to change the owner to my oracle instance but it doesn't work:

# su - root
# cd /dev/rdsk
# chown oracle:oinstall c0t2d0s0
# ls -al c0t2d0s0
lrwxrwxrwx   1 root     root          45 Mar  8 19:11 c0t2d0s0 -> ../../devices/

But it seems that everyone could use it so I've used the create tablespace with
the reuse option.

>create tablespace raw01 datafile '/dev/rdsk/c0t2d0s0' size 256M REUSE;

The result is:

ORA-19504: failed to create file "/dev/rdsk/c0t2d0s0"
ORA-27041: unable to open file
SVR4 Error: 5: I/O error
Additional information: 1

I do not know what's going wrong. This method I already tried before but without the REUSE option and it doesn't work, too.

Thank's a lot for help.

Gerald02Author Commented:
The reason for trying to use raw partitions with solaris is a very poor performance compared with a LINUX server.

Until now I've tuned the server to run 4 times faster but this is not fast enough. Since I know that raw partitions are possibly very usefull for mass updates and random searches I want's to try a raw partition for better performance.

Another problem is, that the results differ between a few (3) seconds and 60 seconds so the average is very bad.

best regards
What hapening is most probably the raw partition is not setup correctly at the OS level. You have to define a charcter special device to make this work. Please post you email here and I will send you an article on setting up raw partitions.
Gerald02Author Commented:
Hello mshaikh,

I think you will get the 100 Points...


best regards
Gerald02Author Commented:

the answer was not right for Solaris 7. $ ls -l c0t2d0s1
lrwxrwxrwx   1 root     root          45 Mär  8 19:11 c0t2d0s1 -> ../../devices/

But with Slice 1 it works even the owner is root:root or not!

Since I've tested performance for a lot of hours and round about two dozens of test I will give a short statement to those who do not like to use RAW partitions:

The results of my test is, that RAW partition are not as fast as partitions in the filesystem for all operations. But in the moment they seem to be better because the difference between the max and min values of my testprocedure is very small compared to the results with using filesystem based tablespaces.

The procedure is:
insert 32768 records from table into table;
insert 2*32768 from table into table;
Do some selects on the table.
Delete the first 10.000 using rownum.

The result for a user not using raw partitions are (in seconds)

Min        Avg        Max
2           7.65         37
5          16.05         31
5           5.05          6
32         35.00         50

The results for a user using as default tabplespace a raw patition and as temporary a filesystem based tablespace  are:

Min        Avg         Max
3           3.8            5
8           8.35           9
4           4.55           5
10         12.00          18

This seemed to be better as the file system based results because the AVG is round about two times faster!

Best regards

P.S. I think I should try to optimize the filesystem (buffers etc.) for better results!??

Compared with the performance of the default Oracle installation the above presented results are factor four to six times better!

Now I will make a load test with hundreds of user and I hope I can make this test with a LINUX system too. I believe that the E-450 Solaris combination will be better with dozens of users as the LINUX System..... but it seem's that the LINUX system is with only one user a really fast system (with a cheaper hardware).
Gerald02Author Commented:
Now I have transformed the complete database including logfile system, rollback, user, temporary into a raw system and it runs faster as the LINUX system with one user!


The results:

      Min.       Avg.       Max.
---------- ---------- ----------
insert into perftest (select * from perftest where rownum <32769);
         0         .9          2

insert into perftest (select * from perftest where rownum <65537);
         1       1.75          2

select count(*) into dummy from perftest, (select * from perftest where rownum <
         4       4.55          5

This is really a great result compared to the default oracle installation.

I think I won't try to optimize the filesystem based database. I think this will waste a lot of time and I do not have any time to do such a job.

best regards

All Courses

From novice to tech pro — start learning today.