完成asm的从无到有共需下面几步
(1、下载安装与内核对应的asm包。
2、配置asm
3、添加css服务
4、创建参数文件
5、创建密码文件
6、创建相关目录
7、启动实例、创建磁盘组。)
1、寻找与内核版本一致的asm包,uname -a 查看内核版本。
2、安装oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-support-2.1.7-1.el4.i386.rpm
3、配置asm
[root@dbs ~]# /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 <ENTER> 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 设置系统启动时一起启动asm驱动
Scan for Oracle ASM disks on boot (y/n) [y]: y 启动时进行扫描
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@dbs ~]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
配置磁盘
[root@dbs ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@dbs ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk "VOL2" as an ASM disk: [ OK ]
4、使用asm必须启动css服务
[root@dbp ~]# /u01/oracle/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.
dbp
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
5、创建参数文件
init+ASM.ora 在$ORACLE_HOME/dbs下
+ASM.asm_diskgroups='DATA','FLA'#Manual Mount
*.asm_diskgroups='DATA','FLA'
*.background_dump_dest='/u01/admin/+ASM/bdump'
*.core_dump_dest='/u01/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/admin/+ASM/udump'
7、创建密码文件在$ORACLE_HOME/dbs下
orapwd file=orapw+ASM password=password entries=30
8、创建相关目录
mkdir -p /u01/admin/+ASM/bdump
mkdir -p /u01/admin/+ASM/cdump
mkdir -p /u01/admin/+ASM/udump
mkdir -p /u01/admin/+ASM/pfile
9、启动实例
export ORACLE_SID=+ASM
sqlplus / as sysdba
startup
10、添加磁盘组
create diskgroup DATA external rendundancy disk 'ORCL:VOL1';
create diskgroup FLA external rendundancy disk 'ORCL:VOL2';
11、查询磁盘组情况
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
FLA MOUNTED