Operating System - HP-UX
1829403 Members
1360 Online
109991 Solutions
New Discussion

Create new Logical Volume

 
Michael Selvam
Occasional Advisor

Create new Logical Volume

Hi everybody

I need a great help from the UNIX experts because in my current project there is no Unix administrator.

I need to create a new logical volume and make a symbolic link for oracle datafile in the RAW devices. Kindly advice me the following steps are correct or not.

STEP1:
To create a new logical volume I will run the following scripts in the root user

# lvcreate -n sdata1 vgoracle
# lvextend -L 1500 /dev/vgoracle/sdata1 /dev/dsk/c6t0d4

STEP2: To create a symbolic link, I will run the following scripts on the each node login as oracle user

$ ln ?s /dev/vgoracle/sdata1 /data/oracle/oradata/WEB/sdata1_01.dbf


Thanks & Regards

Michael Selvam
7 REPLIES 7
Marcin Wicinski
Trusted Contributor

Re: Create new Logical Volume

Hi,

It's OK, but remember:

lvextend -l
lvextend -L

Later,
Marcin Wicinski
Stefan Farrelly
Honored Contributor

Re: Create new Logical Volume


Looks good, it will create a 1500 MB lvol, but when you create the symbolic link you want it to point to the raw lvol, rsdata, not sdata.

Im not sure why you do it this way, creating a link from a filename called X.dbf pointing to a raw lvol, normally oracle raw databases are handled without such links (?)
Im from Palmerston North, New Zealand, but somehow ended up in London...
John Waller
Esteemed Contributor

Re: Create new Logical Volume

This is fine as long as you have 1500Mb free on /dev/dsk/c6t0d4. I presume that the c6t0d4 device is a RAID device so you don't have to worry about mirroring the data at an O/S level. Another thing is why specify the device in the first place ?. A lvextend without the /dev/dsk/? on the end will extend the LV to the next available extents.
Volker Borowski
Honored Contributor

Re: Create new Logical Volume

NO,

/dev/vgoracle/sdata1 is the block device.

You need to use the character device !!!

/dev/vgoracle/rsdata1

Second:
After lvcreate, the permissions on the rawdevice usally are 644 for root. You might need to adjust to get access for the oracle user, i.e.

chown oracle:dba /dev/vgoracle/rsdata1
chmod 600 /dev/vgoracle/rsdata1

Third:
lvextend may round up to the next PE size ! So the volume might be bigger than expected. Check the real size with lvdisplay after lvextend.

Fourth:
When you use the device in Oracle, give a little spare space to the size, in case HP and Oracle programming guys have diffrent views about GB / MB / KB ( 1000 <-> 1024 ), so that you are not leaving the rawdevice at the edge. This might cause errors.

Hope this helps
Volker
Deshpande Prashant
Honored Contributor

Re: Create new Logical Volume

Hi
You may want to change the ownership of raw volume to oracle before creating the links.
#chown oracle:dba /dev/vgoracle/rsdata1
Also change permissions to 755
#chmod 755 /dev/vgoracle/rsdata1

Thanks.
Prashant.

Take it as it comes.
Wodisch
Honored Contributor

Re: Create new Logical Volume

Hello Michael,

to modify Prashant recommendation a little bit:
chmod 664 /dev/...

for the x-permission is not needed for data files/volumes,
but you may have processes running in group "dba",
but not being user "oracle"...

Just my ?0.02,
Wodisch
Michael Tully
Honored Contributor

Re: Create new Logical Volume

Hi,

The other guys are correct in the advice given,
I would like to add one further thing, and that
is how to check whether you have enough space
to begin with.

# vgdisplay -v /dev/vgoracle

and note both the information in header which
indicates the space available and the in
section which relates directly to the disk
that you want to use.

My 3 cents worth
Good Luck
-Michael
Anyone for a Mutiny ?