aix5.3上使用裸设备创建表空间

创建卷组
mkvg -B -f -s 64 -V50 -y oradatavg vpath0 vpath1

[@more@]

1.在本地AIX磁盘上创建
创建裸设备
mklv -t raw -y btas_sta01 -a e -e x -o y oradatavg 40 --pp大小为256m
mklv -t raw -y btas_sta02 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta03 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta04 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta05 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta06 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta07 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta08 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta09 -a e -e x -o y oradatavg 40
mklv -t raw -y btas_sta10 -a e -e x -o y oradatavg 40

-e x设置裸设备划分到多盘

赋予裸设备权限
chown -R oracle:oinstall /dev/r*
chown -R oracle:oinstall /dev/btas_sta*

创建表空间
create tablespace btas_sta
datafile '/dev/rbtas_sta01' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta02' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta03' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta04' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta05' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta06' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta07' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta08' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta09' size 10230m;
alter tablespace btas_sta add datafile '/dev/rbtas_sta10' size 10230m;

2.以下是在存储上创建裸设备的脚本:

在aix下使用raw device建oracle分配vg和lv的shell

###
# 机器上有16个vpath,2T的容量,存储为IBM DS8000。2块光纤卡,2个通道。
# 文件系统用2个vpath,数据库用剩下的14个vpath
# lspv可以看到有几个vpath
#
# 建文件系统vg,64mb一个pp,为oracle achive log使用
#
####
mkvg -B -f -s 64 -V51 -y fsvg vpath14 vpath15

#
# ora_vg1有14个vpath,mklv是 upperbound最大只能14故 -u 14
#
mkvg -B -f -s 64 -V50 -y ora_vg1 vpath0 vpath1 vpath2 vpath3 vpath4 vpath5 vpath6 vpath7 vpath8 vpath9 vpath10 vpath11 vpath12 vpath13

###
# 建数据库用的lv -u 14 upbound 14个vpath,条带化为1mb -S 1m
#
# -e Range
# Sets the inter-physical volume allocation policy (the number of physical volumes to extend across, using the
# volumes that provide the best allocation). The Range value is limited by the UpperBound variable, (set with the
# -u flag) and can be one of the following:
# x
# Allocates across the maximum number of physical volumes.
# m
# Allocates logical partitions across the minimum number of physical volumes. This is the default range.
#
####

# 第一组数据库lv
mklv -u 14 -t raw -S 1m -y db1_redolv1 ora_vg1 14 --14 pp
mklv -u 14 -t raw -S 1m -y db1_redolv2 ora_vg1 14
mklv -u 14 -t raw -S 1m -y db1_redolv3 ora_vg1 14
mklv -u 14 -t raw -S 1m -y db1_syslv ora_vg1 42
mklv -u 14 -t raw -S 1m -y db1_undolv ora_vg1 420
mklv -u 14 -t raw -S 1m -y db1_templv ora_vg1 420
mklv -u 14 -t raw -S 1m -y db1_userslv ora_vg1 280
mklv -u 2 -t raw -S 1m -y db1_ctllv1 ora_vg1 2
mklv -u 1 -t raw -e x -y db1_spfilelv ora_vg1 1

# 第二组数据库lv
mklv -u 14 -t raw -S 1m -y db2_redolv1 ora_vg1 14
mklv -u 14 -t raw -S 1m -y db2_redolv2 ora_vg1 14
mklv -u 14 -t raw -S 1m -y db2_redolv3 ora_vg1 14
mklv -u 14 -t raw -S 1m -y db2_syslv ora_vg1 42
mklv -u 14 -t raw -S 1m -y db2_undolv ora_vg1 420
mklv -u 14 -t raw -S 1m -y db2_templv ora_vg1 420
mklv -u 14 -t raw -S 1m -y db2_userslv ora_vg1 280
mklv -u 2 -t raw -S 1m -y db2_ctllv1 ora_vg1 2
mklv -u 1 -t raw -e x -y db2_spfilelv ora_vg1 1


chown -R oracle:dba /dev/r*
chown -R oracle:dba /dev/btas_infor*

create tablespace CTAISD_DAT
datafile '/dev/rCTAISD_DAT01' size 20400;

1G可以创建960M表空间

###
# 数据文件的lv,280*64MB
# -u 使用条带化时最大不能超过vg上vpath的数目,mkvg时ora_vg1有14个vpath,故这里用14
# -u UpperBound
# Sets the maximum number of physical volumes for new allocation. The value of the Upperbound variable should be
# between one and the total number of physical volumes. When using super strictness, the upper bound indicates
# the maximum number of physical volumes allowed for each mirror copy. When using striped l

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

转载于:http://blog.itpub.net/7490392/viewspace-1023532/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值