[
Linux ASMLib 的发现字符串
| |
![]() | |
ASMLib 使用发现字符串来确定 ASM 正在请求哪些磁盘。一般的 Linux ASMLib 使用 glob 字符串。字符串必须以 "ORCL:" 为前缀。磁盘通过名称来指定。可以通过发现字符串 "ORCL:VOL1" 在 ASM 中,发现以名称 "VOL1" 创建的磁盘。类似地,可以用发现字符串 "ORCL:VOL*" 来查询所有以字符串 "VOL" 开始的磁盘。 不能在发现字符串中用路径名称来发现磁盘。如果缺少前缀,那么一般的 Linux ASMLib 将完全忽略发现字符串,认为它适用于一个不同的 ASMLib。唯一的例外是空字符串 ( ""),它被认为是一个全通配符。这与发现字符串 "ORCL:*" 完全等价。 |
单机搭建ASM环境
准备:
1.centos系统
2.Oracle database10G+instance
3.与系统匹配的ASMlib包
4. 3块磁盘
一、安装ASMlib,初始化ASMlib
创建asm能识别的disk。
/dev/sdb1 > VOL1
/dev/sdc1 > VOL2
/dev/sdd1 > VOL3
二、需要创建一份pfile(init+ASM.ora)如下
*.background_dump_dest='/u01/app/admin/+ASM/bdump' *.core_dump_dest='/u01/app/admin/+ASM/cdump' *.user_dump_dest='/u01/app/admin/+ASM/udump' *.asm_diskstring='ORCL:VOL*' *.instance_type='asm' *.large_pool_size=12M *.remote_login_passwordfile='exclusive' |
三、启动ORALCE_HOME下面的css
$ORACLE_HOME/bin/localconfig add
/etc/oracle does not exist. Creating it now. Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Configuration for local CSS has been initialized
Adding to inittab Startup will be queued to init within 90 seconds. Checking the status of new Oracle init process... Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. asmdemo CSS is active on all nodes. Oracle CSS service is installed and running under init(1M) |
四、启动asm
export ORACLE_SID=+ASM sqlplus / as sysdba SQL> startup ASM instance started
Total System Global Area 130023424 bytes Fixed Size 2019032 bytes Variable Size 102838568 bytes ASM Cache 25165824 bytes ORA-15110: no diskgroups mounted |
五、创建磁盘组 DATA、RECOVERY
create diskgroup DATA external redundancy disk 'ORCL:VOL1','ORCL:VOL2'; create diskgroup RECOVERY external redundancy disk 'ORCL:VOL3'; |
六、创建spfile
create spfile from pfile; |
Shutdown à startup
七、mount asm磁盘组
alter diskgroup DATA mount; alter diskgroup RECOVERY mount;
SQL> select name,state from v$asm_diskgroup;
NAME STATE ------------------------------ ----------- DATA MOUNTED RECOVERY MOUNTED |
八、测试ASM。有可能需要 alter system register 在rdbms 中注册asm
Export ORACLE_SID=asmdemo Sqlplus / as sysdba Create tablespace test datafile ‘+DATA/test.dbf’ size 50m; 进入asm查看文件 Export ORACLE_SID=ASM Asmcmd Cd data Ls 有test.dbf文件就代表成功搭建。 drop tablespace test including contents and datafiles; |
* 上述少了创建ASM口令文件和创建ASM dump的路径步骤,此处可以参考:http://space.itpub.net/?uid-27042095-action-viewspace-itemid-742332
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-741974/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27042095/viewspace-741974/