分类目录归档:Oracle ASM

ASM简单管理(1)

一、ASM磁盘和磁盘组管理
1、创建磁盘组
create diskgroup DG2 EXTERNAL REDUNDANCY DISK ‘ORCL:A1′;
Note:1)磁盘名称需要大写
2)磁盘名称使用V$asm_disk.path

2、磁盘组中添加磁盘
alter diskgroup dg2 add disk ‘ORCL:A2′;
Note:磁盘名称使用V$asm_disk.path

3、磁盘组中删除磁盘
alter diskgroup dg2 drop disk ‘a1′;
Note:磁盘名称使用的是V$asm_disk.name

4、删除磁盘组
drop diskgroup dg2 including contents;

二、ASM相关视图
1、查看是否有数据库实例连接上ASM实例
select instance_name,db_name,status from v$asm_client;

2、记录BALANCE操作
select operation,state,power,actual,sofar from v$asm_operation;

3、ASM DISK信息
select path, state, total_mb, free_mb from v$asm_disk;

4、ASM DISKGROUP信息
select name,state,type,total_mb,free_mb from v$asm_diskgroup;

三、ASM和表空间管理
1、ASM中创建表空间
create tablespace xff datafile ‘+DG2′ SIZE 100M;

2、ASM表空间中添加数据文件
alter tablespace xff add datafile ‘+dg2′ size 10m;

3、ASM表空间中删除数据文件
alter tablespace xff drop datafile ‘+DG2/xff/datafile/xff.257.747278679′;
或者
alter tablespace xff drop datafile 7;

4、删除表空间
drop tablespace xff including contents;

发表在 Oracle ASM | 一条评论

配置Oracle ASM磁盘

1、确定Linux版本
uname -a
Note:我的系统是redhat 5.5

2、下载asm的lib包

http://www.oracle.com/technetwork/topics/linux/index-101839.html

根据Linux版本,选择合适版本下载(redhat 5.5 32位系统)
oracleasm-support-2.1.4-1.el5.i386.rpm
oracleasm-2.6.18-194.26.1.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm

3、安装ams包(root)
rpm -Uvh oracleasm-support-2.1.4-1.el5.i386.rpm
rpm -Uvh oracleasm-2.6.18-194.26.1.el5-2.0.5-1.el5.i686.rpm
rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm

4、配置ASM的库文件(root)
/etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]’). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module “oracleasm”: [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
Note:需要实现创建oracle用户和dba组(一般安装oracle的系统上都会创建)

5、创建ASM磁盘(root)
/etc/init.d/oracleasm createdisk XFF1 /dev/sdb1
/etc/init.d/oracleasm createdisk XFF2 /dev/sdc1

6、配置CSS(root)
$ORACLE_HOME/bin/localconfig add

发表在 Oracle ASM | 一条评论