1752467 Members
6258 Online
108788 Solutions
New Discussion юеВ

Re: reducing raw volume

 
SOLVED
Go to solution
himacs
Super Advisor

reducing raw volume

Hi Admins,

can i do a lvreduce on raw database file..
Actaully i want to shrink a database raw file rxxx.dbf

I have heard the lvreduce will destroy all data on any LV.

<<< LVM does not store any information about which physical extents within a logical volume contain useful data; therefore, reducing the space allocated to a logical volume without doing a prior backup of the data could lead to the loss of useful data"
If you lvreduce a LVOL you "delete" the data on this disk. >>>

As per my understanding,
1. In raw device file data will be written serially that means data will be written continously with no gap in between.So we can do lvreduce without data loss.
2.In LV wich holds file system,data will be written randomly.So doing a lvreduce here is not recommended.

Please suggest on this.

6 REPLIES 6
Kanagaraj
Regular Advisor

Re: reducing raw volume

himacs,

To find out what applications are using the logical volume, use the fuser command

Example:
fuser -cu /dev/vg01/lvol5

IF any application/user is accessing this file system,you may stop that applciation before resuce this LV.

You can reduce that lv but new size of lv should be higher than data already occufied on LV.

Before reducing the lv,better take data backup.

example.

total lv size 5GB
data occufied 3.5GB

you want to reduce that lv to 4.5GB,it is possible.use lvreduce -L lv_path
Johnson Punniyalingam
Honored Contributor
Solution

Re: reducing raw volume

using raw devices, since a write to a raw device bypasses the UNIX buffer cache; the data is transferred
direct from the Oracle buffer cache to the disk

More over "Logical volumes can be assigned to
file systems,
used as swap or dump devices,
or used for raw access

so when you talk about "raw device files" its totlay raw -> nothing stored "while all you Database / Application has been stopped"
make sure "NO I/O activity " (meaning make sure all your Database & application complted down) and you do this activity.

You can use either "use" lvreduce or
"lvremove " and "lvcreate" to actual size.what do you " and inform your " DBA admin", can help you reconfugre or something drop and recreat .etc.. (whatever from Databse point of view).

HTH,

Johnson
Problems are common to all, but attitude makes the difference
himacs
Super Advisor

Re: reducing raw volume

Hi Johnson.

>>so when you talk about "raw device files" its totlay raw -> nothing stored "while all you Database / Application has been stopped>>

So you are telling when DB is down raw database file will be empty.This is new thing to me.
So where data will be stored while DB is down.

Please clarify

Regards
himacs
Johnson Punniyalingam
Honored Contributor

Re: reducing raw volume

as per below document from "it says" you need "only recreate raw device file" you can't lvreduce on the "raw device file"

Please read document for "Better understanding" for raw device use in Oracle Database.

http://www.rdbconsulting.com/files/Raw%20devices%20versus%20file%20systems%20v2.pdf

>>So where data will be stored while DB is down.<<

Again read post " since a write to a raw device bypasses the UNIX buffer cache;"

So it use "bypasse" to "when you database is up data "bypasses. no data is stored.

purpose of having raw devic file "

Improves I/O performance if system is I/O bound

Problems are common to all, but attitude makes the difference
himacs
Super Advisor

Re: reducing raw volume

Hi Johnson,

Thanks for the document.I have logged a call with HP to confirm the same.But according to them we can reduce the raw device.

<< first tell Oracle to shrink
the tablespace, and then you can go ahead and shrink the LV. The LV operations can be done online. Make
sure you do not shrink the LV by a larger space than you shrunk the tablespace in Oracle, or data will be lost
with no way to recover it! >>

Regards
himacs

Johnson Punniyalingam
Honored Contributor

Re: reducing raw volume

>>sure you do not shrink the LV by a larger space than you shrunk the tablespace in Oracle, or data will be lost<<<

Yes, Please, d'not shrink too much. also can you check whether is better you "lvremove" & "lvcreate" ? hence from system point of view its straight forward. (meant say all "Lv operations can be done") from Oracle point view check with your "DBA Admin"

Just a thought.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference