登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

飞哥的技术博客

世上无难事,只怕有心人!

 
 
 

日志

 
 
 
 

Linux 下裸设备创建Oracle数据库 - 转  

2009-05-25 00:19:40|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |


Linux 下裸设备创建Oracle数据库
Disk /dev/sda: 255 heads, 63 sectors, 652 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 38 200812+ 82 Linux swap
/dev/sda3 39 652 4931955 83 Linux
Disk /dev/sdh: 128 heads, 32 sectors, 512 cylinders
Units = cylinders of 4096 * 512 bytes
Disk /dev/sdh doesn't contain a valid partition table
2.对Disk /dev/sdh分区成LVM格式(8e的分区类型)
Disk /dev/sdh: 128 heads, 32 sectors, 512 cylinders
Units = cylinders of 4096 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdh1 1 512 1048560 8e Linux LVM
3.创建物理卷,逻辑卷(组)
执行如下shell:
pvcreate /dev/sdh1
vgcreate oravg /dev/sdh1
lvcreate -L8M -nlv_spfile oravg
lvcreate -L20M -nlv_control1 oravg
lvcreate -L20M -nlv_control2 oravg
lvcreate -L20M -nlv_control3 oravg
lvcreate -L20M -nlv_redo1_1 oravg
lvcreate -L20M -nlv_redo1_2 oravg
lvcreate -L20M -nlv_redo1_3 oravg
lvcreate -L500M -nlv_system oravg
lvcreate -L20M -nlv_temp oravg
lvcreate -L20M -nlv_users oravg
lvcreate -L20M -nlv_undo oravg
lvcreate -L20M -nlv_users oravg
lvcreate -L20M -nlv_tools oravg
lvcreate -L20M -nlv_indx oravg
vgchange -a y
[root@rac1 oracle]# lvscan
lvscan -- ACTIVE "/dev/oravg/lv_spfile" [8 MB]
lvscan -- ACTIVE "/dev/oravg/lv_control1" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_control2" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_control3" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_redo1_1" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_redo1_2" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_redo1_3" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_system" [500 MB]
lvscan -- ACTIVE "/dev/oravg/lv_temp" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_users" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_undo" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_tools" [20 MB]
lvscan -- ACTIVE "/dev/oravg/lv_indx" [20 MB]
lvscan -- 14 logical volumes with 4.62 GB total in 2 volume groups
lvscan -- 14 active logical volumes
4.绑定到裸设备上
执行如下shell
raw /dev/raw/raw1 /dev/oravg/lv_spfile
raw /dev/raw/raw2 /dev/oravg/lv_control1
raw /dev/raw/raw3 /dev/oravg/lv_control2
raw /dev/raw/raw4 /dev/oravg/lv_control3
raw /dev/raw/raw5 /dev/oravg/lv_redo1_1
raw /dev/raw/raw6 /dev/oravg/lv_redo1_2
raw /dev/raw/raw7 /dev/oravg/lv_redo1_3
raw /dev/raw/raw8 /dev/oravg/lv_system
raw /dev/raw/raw9 /dev/oravg/lv_temp
raw /dev/raw/raw10 /dev/oravg/lv_users
raw /dev/raw/raw11 /dev/oravg/lv_undo
raw /dev/raw/raw12 /dev/oravg/lv_tools
raw /dev/raw/raw13 /dev/oravg/lv_indx
raw –qa
5.修改/etc/sysconfig/rawdevices文件如下,以开机时自动加载裸设备
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/oravg/lv_spfile
/dev/raw/raw2 /dev/oravg/lv_control1
/dev/raw/raw3 /dev/oravg/lv_control2
/dev/raw/raw4 /dev/oravg/lv_control3
/dev/raw/raw5 /dev/oravg/lv_redo1_1
/dev/raw/raw6 /dev/oravg/lv_redo1_2
/dev/raw/raw7 /dev/oravg/lv_redo1_3
/dev/raw/raw8 /dev/oravg/lv_system
/dev/raw/raw9 /dev/oravg/lv_temp
/dev/raw/raw10 /dev/oravg/lv_users
/dev/raw/raw11 /dev/oravg/lv_undo
/dev/raw/raw12 /dev/oravg/lv_tools
/dev/raw/raw13 /dev/oravg/lv_indx
6.将卷组及设备属主
chown oracle:oinstall /dev/oravg
chmod +xwr /dev/raw/*
chmod +xrw /dev/raw/
7.创建裸设备映射文件DBCA_RAW_CONFIG.txt并加入环境变量如下:
spfile=/dev/raw/raw1
control1=/dev/raw/raw2
control2=/dev/raw/raw3
control3=/dev/raw/raw4
redo1_1=/dev/raw/raw5
redo1_2=/dev/raw/raw6
redo1_3=/dev/raw/raw7
system=/dev/raw/raw8
temp=/dev/raw/raw9
users=/dev/raw/raw10
undotbs1=/dev/raw/raw11
tools=/dev/raw/raw12
indx=/dev/raw/raw13
export DBCA_RAW_CONFIG=/home/oracle/DBCA_RAW_CONFIG.txt
export LANG=zh_CN
8.运行DBCA创建数据库(注意选择裸设备创建数据库及数据文件略小于裸设备定义大小)
9.将vgchange -a y加到/etc/rc.local中,启动是自动激活所有卷组
文档上说7.0以后自动激活,可我的8.0就是不激活 ?,不知道为什么
10.扩大数据文件大小
a)扩大逻辑卷
lvextend -L100M /dev/oravg/lv_undo
b)扩大数据文件
SQL> alter database datafile '/dev/raw/raw11' resize 90m;
发表于: 2008-11-30 ,修改于: 2008-11-30 16:35,已浏览149次,有评论0条 推荐 投诉




引文来源  Linux 下裸设备创建Oracle数据库 - LINUX -
  评论这张
 
阅读(785)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018