aix5.3上使用裸裝置建立表空間

guyuanli發表於2009-06-26

建立卷組
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章