1843935 Members
1758 Online
110226 Solutions
New Discussion

Making a raw log file?

 
SOLVED
Go to solution
Michael D. Zorn
Regular Advisor

Making a raw log file?

My database suggests using a raw log file. The installation procedure set up two log files of 367MB, and the documantation says you can change them to raw files. But right after that, it says "just go ahead and create the raw devices - see your OS documentation".

The two created files are obviously mounted, and raw files don't seem to get mounted.

How do I create the raw device files? I have locations where they'll go (/dev/dsk/cNtNdN - or maybe rcNtNdN?).

3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Making a raw log file?

As a general rule, one does not use the raw disk device directly but rather a raw logical volume. That will allow one to mirror (if desired) and the extra overhead of the logical to physical disk translation is all but zero. Moreover, unlike actual disks, it is very easy to resize LVOL's.

You don't mention your database but the procedure is essentially the same.

Shutdown the database.

Create an additional LVOL using lvcreate and make sure that it is at least as large as your current cooked file. Use lvextebd to mirror it, if you like so that a disk failure will not cause a database failure.

Now copy your cooked file to the raw lvol. Let's pretend that your cooked file is /xxx/yyy/mydb.log and your new raw lvol is /dev/vg10/rlvol1

dd if=/xxx/yyy/mydb.log of=/dev/vg10/rlvol1 bs=256k

Next, do an ls -l /xxx/yyy/mydb.log and note the owner, group, and mode (permissions) of the file and do a chown and chmod /dev/vg10/rlvol1 to match those of the cooked file.

Now, we need to create a symbolic link because the database doesn't know about the raw LVOL (the symbolic link also serves as documentation so that one is somewhat less likely to overwrite what someone might mistake for an unused LVOL):


mv /xxx/yyy/mydb.log /xxx/yyy/mydb.log.save # just in case

ln -s /dev/vg10/rlvol1 /xxx/yyy/mydb.log

Start your database.

After you confirm that all is well, you can remove the original cooked files which has been renamed /xxx/yyy/mydb.log.save.

If it ain't broke, I can fix that.
rariasn
Honored Contributor

Re: Making a raw log file?

Hi Michael,

The "raw" files are created with you use de "lvcreate" command.

Umount /dev/vgxx/lvyyy and use /dev/vgxx/rlvyyy

Create new controlfiles for use this devices.

Verify permission for raw devices. Sample:

crw-r----- 1 oracle dba 64 0x76000e Oct 18 01:01 /dev/vgxx/lvyyy


rgs
Frank de Vries
Respected Contributor

Re: Making a raw log file?

Indeed raw files don't get mounted.
(Socalled cooked files do.)

You create the raw filesystem with
mknod , just like logical volume.

You need to specify in your db this path
as the location of your log.

The advantage is that even when you
inadvertently delete the raw device,
i.e. the logical volume, you will not
lose your data.

The device is just a pointer to a location on the disk. So you can just re-make your device with mknod. You need however need to document the major and minor number to be sure what is what.

Look before you leap