一.检查虚拟机的相关配置:
[root@rac1 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:E3:7D:59
inet addr:10.1.1.210 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee3:7d59/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7957 errors:0 dropped:0 overruns:0 frame:0
TX packets:1314 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:615293 (600.8 KiB) TX bytes:103970 (101.5 KiB)
Interrupt:10 Base address:0x1480
[root@rac1 ~]# ping 10.1.1.1
PING 10.1.1.1 (10.1.1.1) 56(84) bytes of data.
64 bytes from 10.1.1.1: icmp_seq=1 ttl=64 time=58.8 ms
--- 10.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 58.860/58.860/58.860/0.000 ms
[root@rac1 ~]# rpm -qa |grep oracleasm
oracleasmlib-2.0.3-1.el5
oracleasm-2.6.18-128.el5-2.0.5-1.el5
oracleasm-2.6.18-128.el5debug-2.0.5-1.el5
oracleasm-support-2.1.2-1.el5
oracleasm-2.6.18-128.el5PAE-2.0.5-1.el5
oracleasm-2.6.18-128.el5xen-2.0.5-1.el5
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 765 6144831 83 Linux
/dev/sda2 766 956 1534207+ 82 Linux swap / Solaris
/dev/sda3 957 1566 4899825 83 Linux
Disk /dev/sdb: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 512 524272 83 Linux
Disk /dev/sdc: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 391 3140676 83 Linux
Disk /dev/sdd: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 391 3140676 83 Linux
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 261 2096451 83 Linux
[root@rac1 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda1 5.7G 3.0G 2.5G 55% /
/dev/sda3 4.6G 138M 4.2G 4% /u01
tmpfs 349M 0 349M 0% /dev/shm
[root@rac1 ~]#
二.上传database安装介质
安装软件不建库
more ~/.bash_profile
PATH=$PATH:$HOME/bin
export PS1="`/bin/hostname -s`->"
export EDITOR=vim
export ORACLE_SID=up
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/b
in:/usr/X11R6/bin
umask 022
rac1->cd admin
rac1->mkdir +ASM
rac1->cd +ASM
rac1->mkdir {a,b,c,u}dump
rac1->ll
总计 16
drwxr-xr-x 2 oracle oinstall 4096 08-12 18:33 adump
drwxr-xr-x 2 oracle oinstall 4096 08-12 18:33 bdump
drwxr-xr-x 2 oracle oinstall 4096 08-12 18:33 cdump
drwxr-xr-x 2 oracle oinstall 4096 08-12 18:33 udump
rac1->pwd
/u01/app/oracle/admin/+ASM
$ORACLE_HOME/dbs
$ vi init+ASM.ora
*.asm_diskstring='ORCL:VOL*'
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
rac1->orapwd file=orapw+ASM password=oracle
rac1->export ORACLE_SID=+ASM
rac1->sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 12 18:39:43 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORA-29701: unable to connect to Cluster Manager
[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin
[root@rac1 bin]# ./localconfig delete
/etc/oracle does not exist. Creating it now.
./localconfig: line 715: /etc/init.d/init.cssd: 没有那个文件或目录
[root@rac1 bin]# ./localconfig add
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.
rac1->sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 12 18:43:52 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
SQL> create spfile from pfile;
File created.
SQL> startup force
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
[root@rac1 soft]# /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
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@rac1 soft]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@rac1 soft]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@rac1 soft]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [ OK ]
[root@rac1 soft]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
SQL> create diskgroup dg1 external redundancy disk 'ORCL:VOL1';
SQL> select NAME,TYPE,STATE from v$asm_diskgroup;
NAME TYPE STATE
------------------------------ ------ -----------
DG1 EXTERN MOUNTED
如果上述命令返回的 state是 DISMOUNTED,那么我们需要手工将挂载 diskgroup
SQL> ALTER DISKGROUP dgroup1 MOUNT;
Diskgroup altered.
SQL> show parameter asm_diskgroups
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
asm_diskgroups string DGROUP1
三、创建ASM数据库
接下来,创建ASM数据库的工作就非常的简单了。执行dbca实用程序,在第六步“storage options”部分选择“Automatic Storage Management ”,在接下来的“ASM Disk Groups”步骤中,选择之前创建的“DGROUP1”,再按照普通建库的方式完成数据库的创建就OK了。
[root@rac1 soft]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdb1
Marking disk "VOL4" as an ASM disk: [ OK ]
SQL> alter diskgroup dg2 add disk 'ORCL:VOL4';
Diskgroup altered.
SQL> select NAME,TOTAL_MB,STATE from v$asm_diskgroup;
NAME TOTAL_MB STATE
------------------------------ ---------- -----------
DG1 3067 MOUNTED
DG2 5625 MOUNTED
监听状态:
rac1->lsnrctl stat
Service "+ASM" has 1 instance(s).
Instance "+ASM", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
Instance "+ASM", status BLOCKED, has 1 handler(s) for this service...
Service "up" has 1 instance(s).
Instance "up", status READY, has 1 handler(s) for this service...
Service "upXDB" has 1 instance(s).
Instance "up", status READY, has 1 handler(s) for this service...
Service "up_XPT" has 1 instance(s).
Instance "up", status READY, has 1 handler(s) for this service...
The command completed successfully
关闭asm实例,数据库也会自动关闭:
需要先停止数据库实例:
export ORACLE_SID=orcl
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
export ORACLE_SID=+ASM
SQL> shutdown normal
ASM diskgroups dismounted
ASM instance shutdown
SQL> ho lsnrctl stat
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-AUG-2010 21:39:06
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 12-AUG-2010 21:27:19
Uptime 0 days 0 hr. 11 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.mycorpdomain.com)(PORT=1521)))
The listener supports no services
The command completed successfully
启动asm实例后,数据库需要再次启动
SQL> STARTUP
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> ho lsnrctl stat
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-AUG-2010 21:40:21
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 12-AUG-2010 21:27:19
Uptime 0 days 0 hr. 13 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.mycorpdomain.com)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).ol4;
Instance "+ASM", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
《Dropping Disk Groups》
SQL> alter diskgroup dg2 add disk 'ORCL:VOL4';
SQL> alter diskgroup dg2 drop disk vol4;
SQL> create diskgroup dg3 eXternal redundancy disk 'ORCL:VOL4';
SQL> drop diskgroup dg3;
《Create controlfile》
CREATE CONTROLFILE REUSE DATABASE "SAMPLE" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 (
'+DGROUP1/db/onlinelog/group_1.258.541956457',
'+DGROUP2/db/onlinelog/group_1.256.541956473'
) SIZE 100M,
GROUP 2 (
'+DGROUP1/db/onlinelog/group_2.257.541956477',
'+DGROUP2/db/onlinelog/group_2.258.541956487'
) SIZE 100M
DATAFILE
'+DGROUP1/db/datafile/system.260.541956497',
'+DGROUP1/db/datafile/sysaux.259.541956511'
CHARACTER SET US7ASCII
;
《Adding New Redo Log Files》
DB_CREATE_ONLINE_LOG_DEST_1 = '+dgroup1'
DB_CREATE_ONLINE_LOG_DEST_2 = '+dgroup2'
ALTER DATABASE ADD LOGFILE;
eg:
SQL> alter system set db_create_online_log_dest_1='+DG1';
System altered.
SQL> alter system set db_create_online_log_dest_2='+DG2';
System altered.
SQL> ALTER database add logfile;
Database altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DG2/up/onlinelog/group_3.263.726866059
+DG1/up/onlinelog/group_3.259.726866065
+DG2/up/onlinelog/group_2.262.726866045
+DG1/up/onlinelog/group_2.258.726866055
+DG2/up/onlinelog/group_1.261.726866037
+DG1/up/onlinelog/group_1.257.726866041
+DG1/up/onlinelog/group_4.260.726875773
+DG2/up/onlinelog/group_4.266.726875777
8 rows selected.
SQL> ALTER database add logfile;
Database altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DG2/up/onlinelog/group_3.263.726866059
+DG1/up/onlinelog/group_3.259.726866065
+DG2/up/onlinelog/group_2.262.726866045
+DG1/up/onlinelog/group_2.258.726866055
+DG2/up/onlinelog/group_1.261.726866037
+DG1/up/onlinelog/group_1.257.726866041
+DG1/up/onlinelog/group_4.260.726875773
+DG2/up/onlinelog/group_4.266.726875777
+DG1/up/onlinelog/group_5.261.726875799
+DG2/up/onlinelog/group_5.267.726875803
10 rows selected.
《Creating a Tablespace in ASM》
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '+dgroup1(my_template)';
SQL> CREATE TABLESPACE tspace3;
SQL> create tablespace tb1 datafile size 20m;
《asmcmd》
rac1->asmcmd
ASMCMD> ls
DG1/
DG2/
ASMCMD> cd +DG1
ASMCMD> ls
UP/
ASMCMD> cd UP
ASMCMD> ls
CONTROLFILE/
ONLINELOG/
ASMCMD> mkdir mydir
ASMCMD> ls
CONTROLFILE/
ONLINELOG/
mydir/
ASMCMD> cd mydir
ASMCMD> ls
ASMCMD> pwd
+DG1/UP/mydir
ASMCMD> cd ..
ASMCMD> ls
CONTROLFILE/
ONLINELOG/
mydir/
ASMCMD> rm mydir
ASMCMD> ls
CONTROLFILE/
ONLINELOG/
ASMCMD> du
Used_MB Mirror_used_MB
1192 2391
ASMCMD> find +dg2 undo*
+dg2/UP/DATAFILE/UNDOTBS1.258.726865825
ASMCMD> find +dg2 spfi
ASMCMD> find +dg2 spfil*
+dg2/UP/PARAMETERFILE/spfile.265.726866225
+dg2/UP/spfileup.ora
- ASM安装总结.zip (9.7 KB)
- 下载次数: 2
相关推荐
AMS添加磁盘的操作如果添加不当会造成很大问题,这里自己的一些操作步骤说明和体会,希望对大家有用!
oracleasm-support、oracleasmlib、kernel-firmware、bfa-firmware、kmod-oracleasm及安装步骤
Oracle11R2安装ASM+RAC配置步骤.pdf
详细描述在OEL6 的上如何搭建oracle11g rac的过程,每个步骤都有详细描述
安装手册,在某个地方安装实施手册。其中有较为详细的安装步骤
RAC生产环境asm扩容详细步骤,oracle,数据库,存储,ASM
Oracle11R2安装ASM+RAC配置步骤.doc
此文档本人按步骤已做成功,适合做安装ASM的经典文档。
oracle 11.2.0.2集群软件安装,数据库软件安装,步骤截图。
在oracle 10g环境下字符界面或者图形化界面创建ASM磁盘组,步骤详细,适合学习ORACLE的新手!
本文档是基于linux SUSE 11 SP4 64bit系统编写的,描述的是在此系统上安装oracle11g r2 asm的操作步骤。
在oracle 11g 中,更推荐直接使用Clusterware 来管理其他的设备,因此,我们这个...我们这里的操作步骤模仿RAC 搭建来操作,也让你们熟悉一下过程。 环境使用VBOX 虚拟机,使用其他虚拟机的同学,自己研究怎么操作了。
redhat5 ASMlib软件包+安装步骤,内含kernel、oracleasm、oracleasmlib、oracleasm-support及安装步骤
以下操作如果没有特殊说明在两个节点都做相同操作 网络及主机名规划 #public 192.168.10.10 node1 192.168.10.20 node2 #vip 192.168.10.100 node1vip 192.168.10.200 node2vip #private 192.168.20.10 node1priv ...
(八) 创建Oracle实例 81 (九) 在ASM当中创建数据文件路径 93 (十) 为船联网应用创建用户和表空间 93 (十一) 为开发者平台及公众应用、计费创建数据库用户和表空间 95 (十二) 为短信网关创建用户和表空间 97
重建ASM磁盘组的,1: 保证使用ASM的数据库事先已经用RMAN做了备份 2: 关闭ASM实例 3: 使用dd命令清除ASM磁盘上的元数据 4: 重建ASM磁盘组 5: 恢复数据库
oracle常用操作技巧,包括oracle安装步骤、网络配制、EM、备份、RMAN的备份与恢复、逻辑备份、闪回、ASM(管理存储软件)、数据迁移、安全控制、oracle安装及常规操作、SQL语句、函数、SQL语句、权限、体系结构、空间...
Oracle RAC环境搭建,共2部分,讲解其中的第2部分——环境准备及安装步骤。文章中详细地讲述了Oracle RAC搭建的环境准备和安装步骤。
oracle在solaris下面安装很详细的