Operating System - HP-UX
1833875 Members
2061 Online
110063 Solutions
New Discussion

Rename/move LV to new name (SAP & Oracle env)

 
SOLVED
Go to solution
Mike Oswald
Occasional Advisor

Rename/move LV to new name (SAP & Oracle env)

I have read most of the messages (labeled rename lv..) but do not have a warm and fuzzy about the details and whether it applies to my environment.

We have SAP and Oracle using raw devices on an EMC. The /dev/vg's are not mounted.

In /dev you would see something like:
/dev/vgsapd/ &

In /oracle//sapraw you would see (sym-link):
-> /dev/vgsapd/

Okay so far? In Oracle you would see:
/oracle// in each of the tablespaces.

SOoo.. I have 1 or more sym-links in /oracle//sapraw directory that is pointing to a logical volume I wish to rename.

The current name is confusing and does not match what is found in Oracle and could lead to someone doing a lvremove (which I almost did) because I did not find the lv-name used in the database.

Okay.. I thought lvchange would help me but I am not so sure. The Unix move (mv) command looks good, BUT do I have to worry about the volume-group information for the lvolume?

Thanks!

-Mike
9 REPLIES 9
Michael Steele_2
Honored Contributor

Re: Rename/move LV to new name (SAP & Oracle env)

Orace will refer to the device file: /dev/vg##/rlvol. Call oracle.
Support Fatherhood - Stop Family Law
Vitek Pepas
Valued Contributor

Re: Rename/move LV to new name (SAP & Oracle env)

See JFR's posting in following thread:
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0xc4c04e49c5cdd5118ff40090279cd0f9%2C00.html&admit=716493758+1066421900466+28353475
The simple mv should work.
I'm not sure about implications for Oracle, bit it seems that it will be enough to correct the links.
Mike Oswald
Occasional Advisor

Re: Rename/move LV to new name (SAP & Oracle env)

Yupper.. I glance at the reference as Oracle is not what is at issue here. The OS is and how logical-volumes work within a vol-group. This I am not sure of, newbie to an EMC.

If move (mv) is clean, cool!! I like that. Just want to make sure I don't have to the tell the vol-group that, oh, by the way, btab13d_12 (lv) is now btab13d_6.

I want the data and would prefer not to 'dd' to another logical-volume. If I have to, well, okay.

So just to reiterate, is the correct way to move (mv) or am I forced to 'dd' the raw info-data to another logical-volume? Thanks!
Vitek Pepas
Valued Contributor

Re: Rename/move LV to new name (SAP & Oracle env)

I've just tested it, your VG will be fine - it will recognize the new lv name.
Make sure to move both lv and rlv.
Mike Oswald
Occasional Advisor

Re: Rename/move LV to new name (SAP & Oracle env)

Vitek... sounds good! Did you check lvdisplay before and after? Do I assume you have an Oracle test environment? Thanks!

--Mike
Mike Oswald
Occasional Advisor

Re: Rename/move LV to new name (SAP & Oracle env)

Followup .. and you also changes your sym-link as well?
-----------
Vitek... sounds good! Did you check lvdisplay before and after? Do I assume you have an Oracle test environment? Thanks!

--Mike
Vitek Pepas
Valued Contributor

Re: Rename/move LV to new name (SAP & Oracle env)

I did not test it with Oracle. I don't have much experience in this area, I only checked the impact of the lv name change on VG. I tested it on JFS filesystem and I didn't loose any data.
You wrote Oracle was not an issue here, I assumed you would handle this side on your own. Sorry.
Hein van den Heuvel
Honored Contributor
Solution

Re: Rename/move LV to new name (SAP & Oracle env)

Michael Steele wrote: Orace will refer to the device file: /dev/vg##/rlvol. Call oracle

Huh? Why? You tell it the soft link, Oracle will refer to, and follow that softlink.


Mike Oswald wrote: Vitek... sounds good! Did you check lvdisplay before and after? Do I assume you have an Oracle test environment? Thanks!

I just did. Works fine. Trivial test. I actually used two sessions, one root, one sqlplus. outputs below are alternated:
The 'vginfo' is a quick perl script I whipped up to condense the vgdisplay info to my liking. I'll attach that.

vginfo
:
VG /vg01 41004 51188 10184
LV /vg01/apps 40000 0 0
LV /vg01/hein 1004 0 0

PV /dsk/c14t1d4 0 51188 10184



$ ln -s /dev/vg01/hein /tmp/hein_test
$ chown oracle92:oinstall /dev/vg01/rhein
$ chown oracle92:oinstall /dev/vg01/hein
$ ls -l /tmp/hein_test lrwxr-xr-x 1 root sys 14 Oct 18 00:11 /tmp/hein_test -> /dev/vg01/hein
$ chmod +w /dev/vg01/rhein
$ ls -l /dev/vg01/rhein
crw-r----- 1 oracle92 oinstall 64 0x030002 Oct 17 22:55 /dev/vg01/rhein

sql> create tablespace hein datafile '/tmp/hein_test' size 1000m reuse;

Tablespace created.

SQL> alter tablespace hein offline;

Tablespace altered.

root:
$ mv /dev/vg01/rhein /dev/vg01/rtest
$ mv /dev/vg01/hein /dev/vg01/test
$ vginfo...
:
VG /vg01 41004 51188 10184
LV /vg01/apps 40000 0 0
LV /vg01/test 1004 0 0

so... at this point the rename was seen by vgdisplay, but the softlink still points to the now non-existent old name. Making Oracle used the database file should now fail:

SQL> alter tablespace hein online;
alter tablespace hein online
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/tmp/hein_test'

Now let's fix that softlink, and Oracle will be able to use (and luse :-) the tablespace:

root:
ln -sf /dev/vg01/rtest /tmp/hein_test

SQL> alter tablespace hein online;

Tablespace altered.

SQL> drop tablespace hein including contents;

Tablespace dropped.


hth,
Hein.





Mike Oswald
Occasional Advisor

Re: Rename/move LV to new name (SAP & Oracle env)

Thanks Hein. This is what I was looking for. I will let you know how things go when I get the affected systems.

--Mike