oralce ASM install

1. create virtual disk
[root@localhost~]# fdisk -l

/dev/sda1

/dev/sdb1

/dev/sdc1

/dev/sdd1

/dev/sde1

2. install oracle asm lib
rpm -ivh oracleasm-support-2.0.3-1

rpm -ivh oracleasm-2.6.18-8.el5-2.0.4-1.el5

rpm -ivh oracleasmlib-2.0.3-1.el5

== create user and group == [root@localhost~]# groupadd oinstall

[root@localhost~]# groupadd dba

[root@localhost~]# useradd -g oinstall -G dba -d /u01/oracle oracle

3. 配置rawdevices
# vi /etc/udev/rules.d/60-raw.rules

添加以下部分的内容

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"

# start_udev

Starting udev: [ OK ]

4. configure oracleasm
[root@localhost~]# /etc/init.d/oracleasm configure

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) [y]:

Fix permissions of Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: [  OK  ]

Loading module "oracleasm": [  OK  ]

Mounting ASMlib driver filesystem: [  OK  ]

Scanning system for ASM disks:

[  OK  ]

[root@localhost~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1

[root@localhost~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1

[root@localhost~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1

[root@localhost~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sde1
 
[root@localhost ~]# /etc/init.d/oracleasm listdisks

[root@localhost ~]# /etc/init.d/oracleasm scandisks

Scanning system for ASM disks:

[  OK  ]

5. install Oracle
不要安装实例

6. create asm.ora
创建初始化文件
 
#touch $ORACLE_HOME/dbs/init+ASM.ora

*.asm_diskstring='/dev/oracleasm/disks/VOL*'

*.asm_diskgroups='dgroup1'

*.background_dump_dest='/u01/admin/+ASM/bdump'

*.core_dump_dest='/u01/admin/+ASM/cbump'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='SHARED'

*.user_dump_dest='/u01/admin/+ASM/udump'
[root@localhost~]# export ORACLE_SID=+ASM

创建密码文件

[oracle]$ orapwd file=orapwd+ASM password=dba
创建目录结构

[oracle]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
[oracle]$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
[oracle]$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump
SQL>create spfile from pfile

SQL> create diskgroup dgroup1 normal redundancy

2> failgroup fgroup1 disk '/dev/oracleasm/disks/VOL1','/dev/oracleasm/disks/VOL2'

3> failgroup fgroup2 disk '/dev/oracleasm/disks/VOL3','/dev/oracleasm/disks/VOL4'

#create asm database

[oracle@localhost~]$dbca

[oracle@localhost~]$export ORACLE_SID=+ASM

[oracle@localhost~]$sqlplus / as sysdba

SQL>startup

SQL>exit

[oracle]$export ORACLE_SID=asmdemo

[oracle]$sqlplus / as sysdba

SQL>startup

#测试

v$asm_operation

v$asm_diskgroup

v$asm_disk }}}

你可能感兴趣的:(oracle,sql)