[转] 手把手安装设置ASM

一.安装设置ASM
(包的下载地址 http://www.oracle.com/technology/software/tech/linux/asmlib/rhel5.html)

[root@dbatest1 asm]# ll
total 180
-rw-r--r-- 1 root root 125743 Aug 31 18:15 oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm
-rw-r--r-- 1 root root  13658 Aug 31 18:15 oracleasmlib-2.0.3-1.el5.i386.rpm
-rw-r--r-- 1 root root  22936 Aug 31 18:15 oracleasm-support-2.0.4-1.el5.i386.rpm
[root@dbatest1 asm]#
[root@dbatest1 asm]#
[root@dbatest1 asm]#
[root@dbatest1 asm]# rpm -ivh oracleasm-support-2.0.4-1.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@dbatest1 asm]# rpm -ivh oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-8.el5 ########################################### [100%]

[root@dbatest1 asm]#
[root@dbatest1 asm]# rpm -ivh oracleasmlib-2.0.3-1.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]

[root@dbatest1 asm]#  /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: mount: block device oracleasmfs is write-protected, mounting read-only
mount: cannot mount block device oracleasmfs read-only
Unable to mount ASMlib driver filesystem
[FAILED]


[root@dbatest1 asm]#
[root@dbatest1 asm]#  tail -100 /var/log/messages
Aug 31 04:02:02 dbatest1 syslogd 1.4.1: restart.
Aug 31 19:29:32 dbatest1 kernel: SELinux: initialized (dev asmdisk, type asmdisk), not configured for labeling
Aug 31 19:29:32 dbatest1 kernel: SELinux: initialized (dev oracleasmfs, type oracleasmfs), not configured for labeling
Aug 31 19:29:32 dbatest1 kernel: audit(1220182172.412:4): avc:  denied  { mount } for  pid=18013 comm="mount" name="/" dev=oracleasmfs ino=-706892268 scontext=root:system_r:mount_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=filesystem
Aug 31 19:29:32 dbatest1 kernel: SELinux: initialized (dev oracleasmfs, type oracleasmfs), not configured for labeling
Aug 31 19:29:32 dbatest1 kernel: audit(1220182172.413:5): avc:  denied  { mount } for  pid=18013 comm="mount" name="/" dev=oracleasmfs ino=-706892268 scontext=root:system_r:mount_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=filesystem


   
[root@dbatest1 asm]# vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
SELINUX=disabled ---加入这行

[root@dbatest1 asm]# setenforce 0  ---直接禁止SElinux
[root@dbatest1 asm]#
[root@dbatest1 asm]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: [  OK  ]
Mounting ASMlib driver filesystem: [  OK  ]
Scanning system for ASM disks: [  OK  ]


二.确定硬盘分区情况

[root@dbatest1 ~]# fdisk -l
Disk /dev/sda: 146.8 GB, 146815733760 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       17849   143267670   8e  Linux LVM

Disk /dev/sdb: 146.8 GB, 146815733760 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   83  Linux
/dev/sdb2            1218        1340      987997+  83  Linux

Disk /dev/sdc: 36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1217     9775521   83  Linux
/dev/sdc2            1218        2434     9775552+  83  Linux


三.创建ASM磁盘

[root@dbatest1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [  OK  ]

[root@dbatest1 ~]# /etc/init.d/oracleasm deletedisk VOL2
Removing ASM disk "VOL2": [  OK  ]


[root@dbatest1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdb2
Marking disk "/dev/sdb2" as an ASM disk: [  OK  ]

[root@dbatest1 ~]#
[root@dbatest1 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [  OK  ]

[root@dbatest1 ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdc2
Marking disk "/dev/sdc2" as an ASM disk: [  OK  ]


四.使用ASM

oracle@dbatest1:/home/oracle #export ORACLE_SID=+ASM
oracle@dbatest1:/home/oracle #sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Sun Aug 31 21:34:30 2008

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started

Total System Global Area   83886080 bytes
Fixed Size                  1260216 bytes
Variable Size              57460040 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> create diskgroup dgroup1 normal redundancy
  2  failgroup fgroup1 disk 'ORCL:VOL1','ORCL:VOL2'
  3  failgroup fgroup2 disk 'ORCL:VOL3','ORCL:VOL4';

Diskgroup created.


SQL> col name for a10
SQL> select name,state from v$asm_diskgroup;

NAME       STATE
---------- ----------------------
DGROUP1    MOUNTED


SYS@dbatest>create tablespace ts_test datafile '+DGROUP1' size 200M autoextend off ;



SYS@dbatest>select file_name,tablespace_name from dba_data_files where tablespace_name='TS_TEST';

FILE_NAME                                                    TABLESPACE_NAME
------------------------------------------------------------ --------------------
+DGROUP1/dbatest/datafile/ts_test.256.664235297              TS_TEST


五.参数文件配置

oracle@dbatest1:/home/oracle #cat /u01/oracle/product/10.2.0.3/dbs/init+ASM.ora

*.asm_diskstring='ORCL:VOL*'
*.background_dump_dest='/u01/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/oracle/admin/+ASM/udump'
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/266281/viewspace-498330/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/266281/viewspace-498330/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>