Operating System - HP-UX
1832994 Members
2246 Online
110048 Solutions
New Discussion

lvextend new LV to VG on oracle raw device

 
Tuck Lee
Frequent Advisor

lvextend new LV to VG on oracle raw device

I have a requirement to add new LV to a raw device. Using LVM do I need to down the oracle to do the lvextend of the new LV?

Pls assist, appreciate
15 REPLIES 15
Robert-Jan Goossens
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

Hi,

If you would like to create a new raw volume you can just create it, just don't create a filesystem.

# lvcreate -L -n /dev/vgXX
eg.

# lvcreate -L1000 -n raw02 /dev/vg02
will create a raw logical volume named raw02, size 1000MB, into the volume group vg02

Hope this helps, if not please give more info.
Robert-Jan
Tuck Lee
Frequent Advisor

Re: lvextend new LV to VG on oracle raw device

Hi

The new LV will be extended to an existing oracle VG raw device, while I am extending will i have to down the Database before I extend?
Robert-Jan Goossens
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

if you have onlinejfs installed, you should be able to extend it online.

# lvextend -L /dev/vgXX/lvolXX

Otherwise you will have to stop the database and use the same command.

Regards,
Robert-Jan
Steven E. Protter
Exalted Contributor

Re: lvextend new LV to VG on oracle raw device

Shalom,

Options:

1) OnlineJFS extends filesystems. I'm not sure it can extend a raw device.
2) I think Oracle will have to be shut down and restarted. At that point after the lvextend, it may recognize the space, it may require intervention of an oracle utility.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alzhy
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

Sala'm.

Please clarify your question. Do you have a need to (1) add a new LV as a raw device or (2) increase an existing LV used as a raw device ?

(1) you obviously know already what to do - just lvcreate a new LV

(2) I believe you can simply extend even w/o shutting down the Oracle instance since extending a raw device is basically just the same as growing a file.

NOTE and BE not confused though - OnlineJFS (aka VxFS) has NO role whatsoever in extending LVs that are used as a raw device by Oracle or any app.
Hakuna Matata.
Tuck Lee
Frequent Advisor

Re: lvextend new LV to VG on oracle raw device

Apologise for the confusion; basically I have 2 requirement

1. lvextend a raw device to a existing LV raw device

2. Create a new LV raw device in an existing VG for oracle database.

The VG is access by a 2 node cluster which is active on both side.

Question:

1.For both servers do I have to shutdown the DB before I proceed?

2. For para 2 if shutdown not required, Do I need to down or recompile the cluster to add my new LV raw device in the cluster? I did not see any entry in the .cntl file.

3. For para 2, for the VGexport and VGimport. Do I need to halt B node if I vgexport from A to B node and vgimport to B?

Mustafa Gulercan
Respected Contributor

Re: lvextend new LV to VG on oracle raw device

hi Tuck;




1.For both servers do I have to shutdown the DB before I proceed?
If you have got Online JFSyou don't need shutdown oracle.Use following commands;
#vgchange -a e -x
and than use lvcreate like;
#lvcreate -L -n

2. For para 2 if shutdown not required, Do I need to down or recompile the cluster to add my new LV raw device in the cluster? I did not see any entry in the .cntl file.
if you create LV in a cluster used volume group, you don't need to down cluster.

3. For para 2, for the VGexport and VGimport. Do I need to halt B node if I vgexport from A to B node and vgimport to B?
Thereis no need to halt node for vgexport
#vgexport -s -v -p -m /tmp/vgname.map /dev/vgname
it is not update the /etc/lvmtab file or remove the devices file.
For vgimport you need to deactive volume group on nodeB.here is the steps;
1- # ll /dev/vg*/group to note the minor number of volume group
2- deactive the volume group
3- #mkdir /dev/vgname
4- #mknod /dev/vgname/group c 64 0xXXXXXX (use hexadecimal number )
5- #vgimport -s -v -m /tmp/vgname.map /dev/vgname
6- don't forget to check the owner of volume group.
chown -R oracle:dba vgname (as an example)

regards;
mustafa
Tuck Lee
Frequent Advisor

Re: lvextend new LV to VG on oracle raw device

Hi,

I do not have Online JFS, so when I extend LV or create new LV do i need to deactivate Vg like vgchange -a n before I start to extend?

Mustafa Gulercan
Respected Contributor

Re: lvextend new LV to VG on oracle raw device

you can not create lv, while volume group is active in Shared Mode.
Tuck Lee
Frequent Advisor

Re: lvextend new LV to VG on oracle raw device

Hi ,

Ok! so if the server does not have onlinejfs. When I create a new LV, I will need to?

#vgchange -a e -x
and than use lvcreate like;
#lvcreate -L -n

Mustafa Gulercan
Respected Contributor

Re: lvextend new LV to VG on oracle raw device

Hi Tuck;
i write a draft quickly.Please be careful don't copy and paste to use these commands.it ia draft.you should work on it.
here is the steps;

you can not use -x parameter if you don't have onlineJFS.For your situation to create a new LV at the oracle raw device's volume group try these steps;
DO 1 to 3 both nodes.
1-shutdown the oracle.
Be sure there is no connection to that volume group.Don't forget to close oracle's listener.
2-halt the cluster packets which include that volume group.
3-vgchange -a n vgname
ll /dev/vgname/group (note the minor number of that volume group)
#vgexport -s -v -p -m /tmp/vgname.map /dev/vgname
it is not update the /etc/lvmtab file or remove the devices file.(it is a map file for existing volume group.thing it is a backup.but not data's backup under the vg.it is a map.)
vgexport -s -v -m /tmp/vgname.map /dev/vgname (it is update the /etc/lvmtab file and remove the devices file)
cd /dev
mkdir vgname
mknod /dev/vgname/group c 64 0xXXXXX (use ex minor number.)
vgimport -s -v -m /tmp/vgname.map /dev/vgname
strings /etc/lvmtab (check it.)

At NODE A do following;
lvcreate
vgchange -a n vgname
vgexport -s -v -m /tmp/vgname.map /dev/vgname
cd /dev
mkdir vgname
mknod /dev/vgname/group c 64 0xXXXXXX
vgimport -s -v -m /tmp/hp/vgname.map /dev/vgname
strings /etc/lvmtab

AT NODE B:
scp -pr nodeA:/tmp/vgname.map /tmp/vgname.map
cd /dev
mkdir vgname
mknod /dev/vgname/group c 64 0xXXXXXX (use ex minor number.be sure it is same)
vgimport -s -v -m /tmp/vgname.map /dev/vgname


regards;
Mustafa
Alzhy
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

Tuck,

Again OnlineJFS plays no role and is not required in creating a new LV nor extending an existing LV that is used as a RAW Device!!



Hakuna Matata.
Mustafa Gulercan
Respected Contributor

Re: lvextend new LV to VG on oracle raw device

Hi Tuck Lee;
You are new at forum.Welcome..And Pls read forum etiquette.
You should assign points .
The point system was put into place by HP to help determine which answers helped you solve your problem as well.

regards;
mustafa


Ralph Grothe
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

Wonder why so many people mentioned OnlineJFS when he is dealing with raw devices.
Simply extend the volume by using lvextend.
New chunks on it must be allocated by database means.
If you don't know how to do this ask your Oracle DBA (hopefully you have one), because he should know.
I would assume that for this no shutdown of the instance is required,
but don't take this assumption seriously as I have no Oracle expertise.
Madness, thy name is system administration
Alzhy
Honored Contributor

Re: lvextend new LV to VG on oracle raw device

Ralph!

Finally someone is talking! OnLine JFS PLAYS NO ROLE IN RAW STORAGE... Only the VOLUME MANAGER (LVM, VXVM or none).

And Ralph, RAW devices can be treated simply as files right? So expansion/contraction of RAW devices need not mean the DB needs to be shut down...
Hakuna Matata.