一、文件系统
(最简单的方式)
从本机存储划分出一部分空间给数据提供存储。
1.使用方式:
① 对这块区域做一个格式化(这是windows的称呼。在Linux和Unix系统中,叫创建文件系统。)
② 对磁盘进行挂载(windows中叫盘符)
##
对访问区域的一个接口
2.特点:
优点:数据文件容易访问,管理方便。
缺点:访问性能受到影响,中间多了一层文件系统
二、裸设备
该存储空间没有经过格式化,数据直接存放在该存储空间上。
普通用户无法访问,只有数据库软件才能够直接访问。
1.特点
优点:少了文件系统中间层,访问更加快捷,I/O性能比文件系统会提高20%
缺点:管理不方便,不能够cp,rf等操作。但是可以用Oracle工具处理(dd、RMAN)
三、ASM磁盘
ASM:Automatic
Storage Management(Oracle 10g以后)
提供OMF管理方式:
手工建库时:db_create_file_dest=+DISK1
日志文件: db_create_logfile_dest=+DISK1
ASM磁盘,通过asm instance进行管理。数据库实例直接访问asm实例,这样访问方式更加紧密直接。
Oracle
11g以后,允许操作系统和ASM之间进行交互
四、启动管理ASM的实例
1.编辑ASM初始化参数文件内容
$ORACLE_HOME/dbs/init+ASM.ora
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
2.启用ASM实例
$ export
ORACLE_SID=+ASM
$
sqlplus / as sysdba
SQL>
startup nomount
ASM
instance started
Total
System Global Area 82736155 bytes
Fixed
Size 6254372 byyes
Variable
Size 73625362 bytes
ASM
Cache 25173827
bytes
3.(第一次使用ASM)启动时会报错
ORA-29701
unable to connect to Cluster Manager
需要做如下处理:
$ cd
$ORACLE_HOME/bin
$ su
root(以root身份执行,但是不更改环境变量)
$
./localconfig delete
$
./localconfig add
5.裸设备绑定关系
/dev/raw/raw2:
bound to major 58,minor 0
/dev/raw/raw3:
bound to major 58,minor 1
/dev/raw/raw4:
bound to major 58,minor 2
/dev/raw/raw5:
bound to major 58,minor 3
6.创建磁盘组
create
diskgroup disk1 normal
redundancy
failgroup
fg1 disk '/dev/raw/raw1' name d1
failgroup
fg2 disk '/dev/raw/raw2' name d2
failgroup
fg3 disk '/dev/raw/raw3' name d3
failgroup
fg4 disk '/dev/raw/raw4' name d4
failgroup
fg5 disk '/dev/raw/raw5' name d5
failgroup
fg6 disk '/dev/raw/raw6' name d6;
注:external redundancy (主)表明冗余度仅要求一个故障组,假设这个磁盘对 于正在运行的数据库操作
normal
redundancy 标准冗余度提供双向镜像,要求一个磁盘中要有两个故 障组
high
redundancy 提供三向镜像,要求一个磁盘中要有三个磁盘组
create
diskgroup disk1 external redundancy disk '/dev/raw/raw3';
在一个磁盘组中的各个磁盘中的文件,被粗糙的或精细的分割,粗糙分割为1M为单位分布于所有的磁盘中,适用于数据仓库,精细分割为128KB位单位分布文件,适用于OLTP。
7.查看新的可用磁盘组
SQL> select
GROUP_NUMBER,name,type,total_mb,free_mb from v$asm_diskgroup;
SQL> select
group_number,disk_number,name,failgroup,create_date,path from v$asm_disk;
8.删除磁盘组
drop
diskgroup disk1
drop
diskgroup disk1 including contents;(磁盘组中有数据库对象)
9.为磁盘组添加磁盘
alter
diskgroup disk1 ass failgroup fg4 disk '/dev/raw/raw4' name d4;
10.从磁盘组中删除一个磁盘成员
alter
diskgroup disk1 drop disk d4;
11.可以同时对磁盘组进行DROP和ADD操作,这样只发生一次平衡操作,减少CPU和I/O时间
aletr
diskgroup disk1 add failgroup fg4 disk '/dev/raw/raw4' name d4 group disk d3;
———— end ————-