Fw: How to bind the oracle 9i data file to zfs volumes

From: Simon (simon.zcyuan@gmail.com)
Date: Wed Apr 18 2007 - 05:38:33 EDT


Dear All,

I made another testing(the last time:-)) but successful,so happy ?!
and belows are the detail.

*) Requirements:
Create oracle 9i data file over Solaris 10 zfs volume

*) Failure History:
With "dbca" GUI,db creation always failure due to '/device' space not
enough,it complains:

You don't have enough free disk space to create the database,You need
at leat 409600KB on /devices,You have only 0KB available."

First I suspected the oracle couldn't recognize the zfs device file as
it's link file,not a particular character deivce file,as:
# zfs create -V 210m ora_pool/controlfile01_200m
# ls -l /dev/zvol/rdsk/ora_pool/controlfile01_200m
lrwxrwxrwx 1 root root 39 Apr 17 14:58
/dev/zvol/rdsk/ora_pool/controlfile01_200m ->
../../../../devices/pseudo/zfs@0:1c,raw (a link file pointing to
/device)

And I made many attempts but got same errors when dbca launched,then I
try to use "script" to create db,successful.

*) Procedure of succeeding in creating oracle data file over zfs volumes:

- Create zfs volumes
 # zfs create -V 210m ora_pool/controlfile01_200m
 # zfs create -V 210m ora_pool/controlfile02_200m
 # zfs create -V 210m ora_pool/controlfile03_200m
 ...

 # zfs create ora_pool/oracle
 # zfs set mountpoint=/opt/oracle ora_pool/oracle
 # groupadd dba
 # useradd -d /opt/oracle -g dba -s /bin/csh -m oracle
 # chown oracle:dba /dev/zvol/rdsk/ora_pool/*
 # chmod 600 /dev/zvol/rdsk/ora_pool/*

 # projadd -U oracle -p 1233 -c "oracle parameters setting" user.oracle
 # projmod -a -K "project.max-shm-memory=(priv,17179869184,deny)" user.oracle
 # projmod -a -K "project.max-sem-ids=(priv,2000,deny)" user.oracle
 # projmod -a -K "process.max-sem-nsems=(priv,2048,deny)" user.oracle
 # projmod -a -K "project.max-shm-ids=(priv,256,deny)" user.oracle

- After oralce software installation,create database by *scripts*,not
by GUI tool "dbca":

  # cat CreateDBFiles

connect SYS/change_on_install as SYSDBA
set echo on
spool /opt/oracle/product/9.2/assistants/dbca/logs/CreateDBFiles.log

CREATE TABLESPACE "INDX" LOGGING DATAFILE

'/dev/zvol/rdsk/ora_pool/index01_4000m' SIZE 4000M REUSE EXTENT

MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;
CREATE TABLESPACE "TOOLS" LOGGING DATAFILE

'/dev/zvol/rdsk/ora_pool/tools_1000m' SIZE 1000M REUSE EXTENT

MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;
CREATE TABLESPACE "USERS" LOGGING DATAFILE

'/dev/zvol/rdsk/ora_pool/users01_4000m' SIZE 4000M REUSE EXTENT

MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;
spool off
exit;

 # cat CeateDB

connect SYS/change_on_install as SYSDBA
set echo on
spool /opt/oracle/product/9.2/assistants/dbca/logs/CreateDB.log
startup nomount pfile="/opt/oracle/admin/ora9/scripts/init.ora";
CREATE DATABASE ora9
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/dev/zvol/rdsk/ora_pool/system_800m' SIZE 800M REUSE

EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE
'/dev/zvol/rdsk/ora_pool/temp01_4000m' SIZE 4000M REUSE

UNDO TABLESPACE "UNDOTBS1" DATAFILE
'/dev/zvol/rdsk/ora_pool/undotbs1_01_4000m' SIZE 4000M REUSE

CHARACTER SET UTF8
NATIONAL CHARACTER SET AL16UTF16

LOGFILE GROUP 1 ('/dev/zvol/rdsk/ora_pool/redo1_01_400m') SIZE 400M,
GROUP 2 ('/dev/zvol/rdsk/ora_pool/redo2_01_400m') SIZE 400M,
GROUP 3 ('/dev/zvol/rdsk/ora_pool/redo3_01_400m') SIZE 400M;
spool off
exit;

It's OK,no errors reported during datafile creation,validate it:

SQL> startup pfile='/opt/oracle/admin/ora9/scripts/init.ora';
ORACLE instance started.

Total System Global Area 2402258952 bytes
Fixed Size 733192 bytes
Variable Size 251658240 bytes
Database Buffers 2147483648 bytes
Redo Buffers 2383872 bytes
Database mounted.
Database opened.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------

/dev/zvol/rdsk/ora_pool/system_800m

/dev/zvol/rdsk/ora_pool/undotbs1_01_4000m

/dev/zvol/rdsk/ora_pool/index01_4000m

/dev/zvol/rdsk/ora_pool/tools_1000m

/dev/zvol/rdsk/ora_pool/users01_4000m

SQL> create table aa ( a1 varchar(10));

Table created.

SQL> insert into aa values ('aa');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from aa;

A1
--------------------
aa

It seems that only with the "script",no "dbca" GUI tool,the oracle
data file can be kept on the zfs volumes.

Any comments on this.

Thanks

Regards,
Simon

----- Original Message -----
From: "Simon" <simon.zcyuan@gmail.com>
To: "Bryan Pepin" <bpepin@emc.com>
Cc: <sunmanagers@sunmanagers.org>
Sent: Friday, April 13, 2007 2:19 PM
Subject: Re: How to bind the oracle 9i data file to zfs volumes

> Bryan,
>
> Thanks for your reply.
>
> I aslo get some reference from other channels that ZFS volume is not
> suitable for raw device accessing,instead,use zfs filesystem.
>
> But another problem raised,why did the zfs allow us to create raw
> volume,but can't be used ?
>
> Thanks.
> Regards,
> Simon
>
> On 4/13/07, Bryan Pepin <bpepin@emc.com> wrote:
>> In ZFS, there is no concept of volumes, at least in the traditional
>> sense of volume managers. So if you are trying to use the RAW device
>> that the zpool command created, I'm pretty sure that is not what ZFS is
>> intended for, and will not work.
>>
>> ZFS uses the concept of storage pools to manage physical storage.
>>
>> At least that is my understanding....Hope this helps....
>>
>> -Bryan
>>
>> Simon wrote:
>> > Experts,
>> >
>> > I'm installing Oracle 9i on Solaris 10 11/06(update 3),I created some
>> > zfs volumes which will be used by oracle data file,as:
>> >
>> > # zfs create -V 200m ora_pool/controlfile01_200m
>> > # zfs create -V 800m ora_pool/system_800m
>> > ...
>> >
>> > # ls -l /dev/zvol/rdsk/ora_pool
>> > lrwxrwxrwx 1 root root 39 Apr 11 12:23
>> > controlfile01_200m -> ../../../../devices/pseudo/zfs@0:1c,raw
>> > lrwxrwxrwx 1 root root 39 Apr 11 13:34 system_800m ->
>> > ../../../../devices/pseudo/zfs@0:7c,raw
>> >
>> > (Please note above,it's just a link file!)
>> >
>> > then bind the data file to these volumes when create database as:
>> > oracle control data file (size:200m)-->
>> > /dev/zvol/rdsk/ora_pool/controlfile01_200m
>> > oracle system data file(size:800m) --> /dev/zvol/rdsk/ora_pool/system_800m
>> > ...
>> >
>> > it fails with the error:the space of "/devices" is insufficient.I
>> > think this is because above character device files under
>> > "/dev/zvol/rdsk/ora_pool" are link file to point to "/device" node,not
>> > the particular device file.
>> >
>> > Compared with the raw volumes which created by vxvm:
>> > # ls -l /dev/vx/rdsk/oradg/controlfile01_200m
>> > crw------- 1 root root 283,99000 Apr 7 22:51 controlfile01_200m
>> >
>> > It's a individual character device file,not the link file,this is the
>> > difference between zfs volume and vxvm volume.
>> >
>> > Please help to provide solution,any helps are much appreciated !
>> >
>> > Best Regards,
>> > Simon
>> > _______________________________________________
>> > sunmanagers mailing list
>> > sunmanagers@sunmanagers.org
>> > http://www.sunmanagers.org/mailman/listinfo/sunmanagers
>> >
>> >
>> >
>> >
>>
>> --
>> ************************************************
>> Bryan Pepin
>> Unix Enterprise Systems
>>
>> EMC Corporation
>> 4400 Computer Drive
>> Westboro, MA 01580
>> 508-898-4776
>> bpepin@emc.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:41:53 EDT