【原创】 DBCA_RAW_CONFIG 参数和裸设备

DBCA_RAW_CONFIG 参数用来在建库的时候指定映射关系
如果建库的时候是文件系统,只是后来新建的表空间采用裸设备根本不必设置此参数。

例如:

[@more@]

[root@tserver ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 144 1052257+ 82 Linux swap
/dev/sda3 145 275 1052257+ 83 Linux
/dev/sda4 276 9730 75947287+ 5 Extended
/dev/sda5 276 9730 75947256 83 Linux

Disk /dev/sdb: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
[root@tserver ~]#
[root@tserver ~]#
[root@tserver ~]#
[root@tserver ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 9730.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-9730, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-9730, default 9730): +210M

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@tserver ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 144 1052257+ 82 Linux swap
/dev/sda3 145 275 1052257+ 83 Linux
/dev/sda4 276 9730 75947287+ 5 Extended
/dev/sda5 276 9730 75947256 83 Linux

Disk /dev/sdb: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 27 216846 83 Linux

[root@tserver ~]# /usr/bin/raw /dev/raw/raw1 /dev/sdb1
/dev/raw/raw1: bound to major 8, minor 17

[root@tserver ~]# chown -R oracle:oinstall /dev/raw
[root@tserver ~]#
[root@tserver ~]#
[root@tserver ~]# vi /etc/sysconfig/rawdevices

# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdb1

[root@tserver test]# /bin/ln -s /dev/raw/raw1 /oradata/test/ct01.dbf

[root@tserver test]# ls -l
total 1214400
-rw-r----- 1 oracle oinstall 7061504 May 2 14:35 control01.ctl
-rw-r----- 1 oracle oinstall 7061504 May 2 14:35 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 May 2 14:35 control03.ctl
lrwxrwxrwx 1 root root 13 May 2 14:35 ct01.dbf -> /dev/raw/raw1
drwxr-xr-x 2 oracle oinstall 4096 May 2 01:50 dump
-rw-r----- 1 oracle oinstall 52436992 May 2 04:22 index1_01.dbf
-rw-r----- 1 oracle oinstall 104858112 May 2 14:35 redo01.log
-rw-r----- 1 oracle oinstall 104858112 May 2 01:27 redo02.log
-rw-r----- 1 oracle oinstall 104858112 May 2 04:17 redo03.log
-rw-r----- 1 oracle oinstall 262152192 May 2 14:35 sysaux01.dbf
-rw-r----- 1 oracle oinstall 503324672 May 2 14:32 system01.dbf
-rw-r----- 1 oracle oinstall 52436992 May 2 04:22 tb1_01.dbf
-rw-r----- 1 oracle oinstall 20979712 May 2 07:23 temp01.dbf
-rw-r----- 1 oracle oinstall 26222592 May 2 14:35 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 May 2 04:22 users01.dbf

[oracle@tserver ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 2 14:36:11 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> conn / as sysdba
Connected.
SQL>
SQL>
SQL>
SQL> create tablespace ct datafile '/oradata/test/ct01.dbf' size 200M autoextend off;

Tablespace created.

SQL> create table tt(a int) tablespace ct;

Table created.

SQL>
SQL>
SQL> insert into tt values(0);

1 row created.

SQL> commit;

Commit complete.

SQL>
SQL> select * from tt;

A
----------
0


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7437037/viewspace-913138/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7437037/viewspace-913138/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值