Oracle11gR2在Oracle linux6.3上使用裸设备

来源:互联网 发布:js的封装继承多态 编辑:程序博客网 时间:2024/05/17 04:52

增加了1块1G的盘

[root@OEL63 u01]# fdisk -l

Disk /dev/sdb: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

Sector size (logical/physical): 512 bytes /512 bytes

I/O size (minimum/optimal): 512 bytes / 512bytes

Disk identifier: 0x00000000

分区

[root@OEL63 u01]# fdisk /dev/sdb

Device contains neither a valid DOSpartition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with diskidentifier 0x3d49ddef.

Changes will remain in memory only, untilyou decide to write them.

After that, of course, the previous contentwon't be recoverable.

 

Warning: invalid flag 0x0000 of partitiontable 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated.It's strongly recommended to

        switch off the mode (command 'c') and change display units to

        sectors (command 'u').

 

Command (m for help): n

Command action

  e   extended

  p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-130, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G}(1-130, default 130):

Using default value 130

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@OEL63 u01]#

配置裸设备

Linux5之后管理裸设备的方法有变化。

 


 

[root@OEL63 rules.d]# vi/etc/udev/rules.d/60-raw.rules

ACTION=="add",KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"

KERNEL=="raw*",OWNER="oracle", GROUP="oinstall", MODE="740"

然后重启机器

 

使用裸设备

[oracle@OEL63 qing]$ ls /dev/raw/raw*

/dev/raw/raw1  /dev/raw/rawctl

[oracle@OEL63 qing]$ ln -s /dev/raw/raw1redo04.raw

[oracle@OEL63 qing]$ pwd

/u01/oracle/oradata/qing

[oracle@OEL63 qing]$ ls -l/u01/oracle/oradata/qing/redo04.raw

lrwxrwxrwx 1 oracle oinstall 13 Sep 1604:49 /u01/oracle/oradata/qing/redo04.raw -> /dev/raw/raw1

 


 

SQL> alter database add logfile group 4('/u01/oracle/oradata/qing/redo04.raw') size 50m;

 

Database altered.

 

切换试试:

SQL> alter system switch logfile;