分类: Oracle
2010-10-09 09:22:42
Asm安装文档
Before installing asm,you want to install the asm support library,ASMlib
See the ASM page of the Oracle Technology Network web site at for more information on ASMLib. To download ASMLib for Linux, go to .
安装环境
Centos5.2
Oracle 10g R2
查看系统环境
#uname -r
2.6.18-92.el5
下载asmlib,安装
官方下载
oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.3-1.el5.i386.rpm
安装顺序
#rpm -Uvh oracleasm-support-2.1.3-1.el5.i386.rpm
#rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
#rpm -Uvh oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm
{
解决oracleasm>=1.0.4错误,先安装oracleasm update-driver
Oracleasm update-driver
}
查看安装的包
#rpm -qa |grep oracleasm
Configure 配置
Init 启动加载驱动,mount上asm文件系统,手工卸载或加载asllib
Exit
Status 查看状态
增加磁盘,分区
Fisk /dev/hdb
Asmlib配置
增加磁盘(不可以配置整个磁盘,可以配置磁盘分区)
#oracleasm createdisk DISK /dev/hdb
分成4个区
Hdb1
Hdb2
Hdb3
Hdb4
启动asmlib
#/ect/init.d/oracleasm configure -i
设置
#/etc/init.d/oracleasm init
ASM创建磁盘
#oracleasm createdisk HBD1 /dev/hdb1
#oracleasm createdisk HBD2 /dev/hdb2
#oracleasm createdisk HBD3 /dev/hdb3
#oracleasm createdisk HBD4 /dev/hdb4
显示当前磁盘
#oracleasm listdisks
HBD1
HBD2
HBD3
HBD4
以oracle身份创建ASM实例
Root身份开启css
#/u01/app/oracle/product/10.2.0.1/bin/localconfig add
运行DBCA
创建组,
结束
登录
$sqlplus / as sysdba
安装好ASM,启动ASM数据过程
$export ORACLE_SID=+ASM
$sqlplus / as sysdba
SQL>startup
SQL>exit
$export ORACLE_SID=anktest
$sqlplus / as sysdba
SQL>startup
Asm(asmlib,asm实例)
删除ASM实例
登录
Export ORACLE_SID=+ASM
Sqlplus / as sysdba
确定是否有数据库实例在使用asm
SQL>select instance_name from v$asm_client;
只有没有存在实例,才能删除
则删除相关联的磁盘组
SQL>select name from v$asm_diskgroup
SQL>grop diskgroup
SQL>shutdown
SQL>exit
删除+ASM服务
Oradim -delete -asmsid +ASM
///////////////////////////////////////////////////////////////////////////////////////////////////////
ASM实例初始化文件
Create pfile from spfile
+ASM.asm_diskgroups='DATA','DATA2'#Manual Mount
*.asm_diskgroups='DATA','DATA2'
*.asm_diskstring='/dev/oracleasm/disks/HDB*'
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
*.instance_type='asm' //对于ASM实例,为asm
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'
///////////////////////////////////////////////////////////////////////////////////////////////////////
创建和删除磁盘组
Creating a disk group
/devices/diska1
/devices/diska2
/devices/diska3
/devices/diska4
/devices/diskb1
/devices/diskb2
/devices/diskb3
/devices/diskb4
控制器a,控制器b
Create diskgroup dgroupa normal redundancy
Failgroup controller1 disk
'/devices/diska1'
'/devices/diska2'
'/devices/diska3'
'/devices/diska4'
Failgrop controller2 disk
'/devices/diskb1'
'/devices/diskb2'
'/devices/diskb3'
'/devices/diskb4'
Add disks to diskgroup
Alter diskgroup dgroup1 add disk
'/devices/diska5' name diska5
'/devices/diska6' name diska6
Alter diskgroup dgroup1 add disk
'/devices/disk*4'
'/devices/diskd*'
Rebalance power 5 wait
This statement runs with a rebalance power of 5,and does not return until the rebalance operation is complete
删除磁盘
Alter diskgrop dgroupa drop disk diska5
挂载
Alter diskgroup dgroupa mount|dismount |check all
Creating a new directory
Alter diskgroup dgroupa add directory '+dgroupa/mydir'
Rename a directory
ALTER DISKGROUP dgroup1 RENAME DIRECTORY '+dgroup1/mydir'
TO '+dgroup1/yourdir';
Drop a directory
ALTER DISKGROUP dgroup1 DROP DIRECTORY '+dgroup1/yourdir' FORCE;
先卸载磁盘组,在删除,指定including context参数,如果除内部asm元数据外磁盘
组中还包含其他文件
Drop diskgroup droup_name including contents
////////////////////////////////////////////////////////////////////////////////////////////////////////
创建ASM文件
Crate tablespace sample datafile '+dgroupa'
chinaunix网友2011-06-05 02:13:57
大连法律咨询在线 http://www.fabowang.com 大连律师在线咨询 http://www.fabowang.com 大连法律顾问网 http://www.fabowang.com 大连律师咨询 http://www.fabowang.com