LVM and VxVM

Confrim the process of addition and deletion of raw file in db ~

 
sreedhar puppali
Occasional Advisor

Confrim the process of addition and deletion of raw file in db ~

Hi All : Pl help me to validae my process. for addtion and deletion of raw file in oracle.

Below are the detailed steps and dba steps to add these luns to database:

Sample file: LUN
/dev/rdsk/c13t12d4

: /dev/rdsk/c12t12d4


Server1
Server1dev/rdsk > ls -l | grep c13t12d4
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
****verify device file existence and obtain major minor numbers

Server1dev/rdsk > ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
****ensure nothing else is associated with this device by searching on minor

Create a link using mknod command : very very careful using this command improper use this command may currpt the correspondin the LUN which you were not supposed to use :

# /usr/sbin/mknod sid_f11_fix_50g c 188 0x0dc400

Now Verify that file has been hooked up to the LUN :
# ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
crw-r--r-- 1 root sys 188 0x0dc400 Aug 24 12:36 rdw1_f11_fix_50g
*****verify node matches correct device




Give the required Oracle righs to the file :
chown oracle:dba rdw1_f11_fix_50g

# ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
crw-r--r-- 1 oracle dba 188 0x0dc400 Aug 24 12:36 sid_f11_fix_50

And add this file on both the cluster node and add the file to database using alter database datafile..

Similaraly.. i have many unused raw devices which are not being used in oracle.. I wanted to re-make use of them..

Can any one givs me the commands to clear the raw devies and re-add the raw to db.

Thank you
Sredhar
13 REPLIES 13
sreedhar puppali
Occasional Advisor

Re: Confrim the process of addition and deletion of raw file in db ~

Corrected :
Sample file: LUN
/dev/rdsk/c13t12d4

: /dev/rdsk/c12t12d4


Server1
Server1dev/rdsk > ls -l | grep c13t12d4
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
****verify device file existence and obtain major minor numbers

Server1dev/rdsk > ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
****ensure nothing else is associated with this device by searching on minor

Create a link using mknod command : very very careful using this command improper use this command may currpt the correspondin the LUN which you were not supposed to use :

# /usr/sbin/mknod sid_f11_fix_50g c 188 0x0dc400

Now Verify that file has been hooked up to the LUN :
# ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
crw-r--r-- 1 root sys 188 0x0dc400 Aug 24 12:36 sid_f11_fix_50g
*****verify node matches correct device




Give the required Oracle righs to the file :
chown oracle:dba sid_f11_fix_50g

# ls -l | grep 0x0dc400
crw-r----- 1 bin sys 188 0x0dc400 Aug 24 11:16 c13t12d4
crw-r--r-- 1 oracle dba 188 0x0dc400 Aug 24 12:36 sid_f11_fix_50

And add this file on both the cluster node and add the file to database using alter database datafile..

Similaraly.. i have many unused raw devices which are not being used in oracle.. I wanted to re-make use of them..

Can any one givs me the commands to clear the raw devies and re-add the raw to db.
Michael Steele_2
Honored Contributor

Re: Confrim the process of addition and deletion of raw file in db ~

Paste in :

ll /dev/vg*/lv*

This will list all of your logical volumes. Your logical volumes are the 2nd level of data access. Level 1 will be the disk or physical volume. Level 3 will be the file system. Since you have no file system you have no level 3. This is what makes a raw file system. Only a level 2 logical volume. Which can be listed out with the above command.

You'll then want to verify the existence of these lvol'v in /etc/lvmtab.

strings /etc/lvmtab

If the lvols are in /etc/lvmtab then use the lvremove command. If not, then use the 'rm' command on all lvols and rlvols.
Support Fatherhood - Stop Family Law
sreedhar puppali
Occasional Advisor

Re: Confrim the process of addition and deletion of raw file in db ~

Thank you !
How can i associate logical volumes to LUN in this case : /dev/rdsk/c13t12d4

My admins wil give me LUN numbers in cluster for each node. I assoicate and create the link and make use of them..

I just wanted to clarify the process which am following above..

And
dd if=/dev/zero of= /dev/rdsk/c13t12d4 bs=16384

is the right command to delete contents of raw.. or can I use the softlink name instead.

Thank you
Sreedhar


sreedhar puppali
Occasional Advisor

Re: Confrim the process of addition and deletion of raw file in db ~

Am confused now !

Here is the output as per your suggested commands :

# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c2t1d0s2
/dev/dsk/c3t0d0s2
/dev/vgorabkp
/dev/dsk/c13t0d3
/dev/dsk/c13t0d4
/dev/dsk/c13t12d5
/dev/vgu03
F_'W
/dev/dsk/c13t11d4
/dev/vg800
/dev/dsk/c13t14d0
# ls -ltr /dev/dsk/c2t1d0s2
brw-r----- 1 bin sys 31 0x021002 Dec 5 2004 /dev/dsk/c2t1d0s2
# ls -ltr |grep 0x021002
# cd /dev/
# ls -ltr vg*


vg00:
total 0
crw-r----- 1 root sys 64 0x000000 Jan 5 2005 group
brw-r----- 1 root sys 64 0x000005 Jan 5 2005 lvol5
brw-r----- 1 root sys 64 0x000006 Jan 5 2005 lvol6
crw-r----- 1 root sys 64 0x000006 Jan 5 2005 rlvol6
brw-r----- 1 root sys 64 0x000007 Jan 5 2005 lvol7
crw-r----- 1 root sys 64 0x000007 Jan 5 2005 rlvol7
brw-r----- 1 root sys 64 0x000008 Jan 5 2005 lvol8
crw-r----- 1 root sys 64 0x000008 Jan 5 2005 rlvol8
crw-r----- 1 root sys 64 0x000004 Jan 5 2005 rlvol4
crw-r----- 1 root sys 64 0x000005 Jan 5 2005 rlvol5
brw-r----- 1 root sys 64 0x000004 Jan 5 2005 lvol4
brw-r----- 1 root sys 64 0x000001 Jan 5 2005 lvol1
brw-r----- 1 root sys 64 0x000002 Jan 5 2005 lvol2
crw-r----- 1 root sys 64 0x000002 Jan 5 2005 rlvol2
crw-r----- 1 root sys 64 0x000001 Jan 5 2005 rlvol1
brw-r----- 1 root sys 64 0x000003 Jan 5 2005 lvol3
crw-r----- 1 root sys 64 0x000003 Jan 5 2005 rlvol3
br--r----- 1 root sys 64 0x000009 Feb 9 2005 lvol9
cr--r----- 1 root sys 64 0x000009 Feb 9 2005 rlvol9
brw-r----- 1 root sys 64 0x00000a Feb 28 2005 restore
crw-r----- 1 root sys 64 0x00000a Feb 28 2005 rrestore



How can I co-relate with my number raw devices avaliable in /dev/rdsk/*

Thank you
Sreehar
Michael Steele_2
Honored Contributor

Re: Confrim the process of addition and deletion of raw file in db ~

Can you paste in a pvdisplay -v /dev/dsk/...
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: Confrim the process of addition and deletion of raw file in db ~

Sorry for the confustion. Got ahead of myself and mis-stated. Your /etc/lvmtab is correct. I'll need the 'pvdisplay' ouptut to id the lvols per disk.
Support Fatherhood - Stop Family Law
Siju Vadakkan
Trusted Contributor

Re: Confrim the process of addition and deletion of raw file in db ~

My understanding is that, raw device file for oracle means a 'logical volume created either by LVM or VXVM' with out creating filesystem on it. Not the physical device. Can u please provide the existing raw device filename used by oracle and the command out put of vgdisplay -v.
sreedhar puppali
Occasional Advisor

Re: Confrim the process of addition and deletion of raw file in db ~

No I think we are leading towards lvm .

I donot maintain any of those..

All I do is :

I request size of the luns : For ex If I need to add 100g lun to the database.
Sysadmin will give me /dev/rdsk/c13t12d4

I will use this lun using mknod,major number.

All am verifying the process of addition and deletion of lun/raw.

In case if i need to delete the raw contents and assign the raw disk to another tablespace.

Siju Vadakkan
Trusted Contributor

Re: Confrim the process of addition and deletion of raw file in db ~

Can u please provide :

#ll /dev/rdsk

and please highlight the devices used as raw volumes.