单实例环境下安装ASM_第1页
单实例环境下安装ASM_第2页
单实例环境下安装ASM_第3页
免费预览已结束,剩余12页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、单实例环境下安装ASM说明:紫红色字体部分是与我安装环境相关的信息或补充的安装说明,其他是网上下载的原文(<< 单实例环境下安装ASM>>)环境:版本:操作系统: Red Hat En terpriseLi nux Server release 5.5 (Tika nga)测试的环境是 Red Hat Enterprise Linux Server release 4.41、首先安装oracle数据库软件,然后向虚拟机中添加三块2G的硬盘,重启虚拟机2、安装软件包:2. 1、查看好系统版本,本机是redhat 5,核版本如下:rootserver3 dev# un am

2、e -ai386 GNU/Li nuxrootfwy # cat /proc/vers ion2006或rootfwy a# un ame -r2.2、上oracle官方,搜索关键字oracle asm red hat 5。去下载如下asm的三个 rpm软件包(本机器下载的是标红的三个软件包,安装包一定要下载正确的版本 否则第五步会出错,导致后续配置无法进行):v.oracle./tech network/topics/li nu x/dow nloads/rhel5-084877.html>Intel IA32 (x86) ArchitectureLibrary and Tools?2

3、.3、安装上述的三个rpm软件包:rootserver3 asm# rpm -ivh *.rpmDSA sig nature: NOKEY, key ID 1e5e0159Preparing. #67%3:oracleasmlib # 100%3、对在1中添加进来的三个磁盘进行分区(我们添加了sdb、sdc和sdd。注意:这里是仅进行分区,而不需要进行格式化。rootserver3 dev# ls sd*sda sda1 sda2 sdb sdc sddrootserver3 dev# fdisk /dev/sdbComma nd (m for help): nComma nd acti on

4、e exte ndedp primary partiti on (1-4)pPartition number (1-4):1First cyli nder (1-261, default 1):1Last cyli nder or +size or +sizeM or +sizeK (1-261, default 261):261Comma nd (m for help):wThe partiti on table has bee n altered!Calli ng ioctl() to re-read partiti on table.Syncing disks.同样执行如下的命令,来对s

5、dc和sdc进行分区:rootserver3 dev# fdisk /dev/sdcrootserver3 dev# fdisk /dev/sdd查看并确认分区的情况:rootserver3 dev# fdisk -lDisk /dev/sda: 21.4 GB, bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice BootStartEndBlocksId System/dev/sda1 *11310439183 Linux/dev/sda2

6、14261020860402+ 8e Linux LVMDisk /dev/sdb: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start/dev/sdb11End Blocks Id System261 2096451 83 LinuxDisk /dev/sdc: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cy

7、lindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start/dev/sdc11End Blocks Id System261 2096451 83 LinuxDisk /dev/sdd: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot StartEnd Blocks Id System/dev/sdd126

8、1 2096451 83 Linux4、配置 ASM:rootserver3 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

9、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 :oinstall Start Oracle ASM library driver on boot

10、 (y/n) y: Scan for Oracle ASM disks on boot (y/n) y: Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: OK Scanning the system for Oracle ASMLib disks: OK 5、系统添加磁盘: rootserver3 asm# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1 Marking disk "VOL1"

11、; as an ASM disk: OK rootserver3 asm# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1 Marking disk "VOL2" as an ASM disk: OK rootserver3 asm# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1 Marking disk "VOL3" as an ASM disk: OK 6 创建ASM初始化文件init+ASM.ora,在$ORACLE_HOME/目)录下(可以理解为是

12、ASM实例的pfile文件):> *.asm_diskstring='ORCL:VOL*'> *.background_dump_dest='/opt/ora10g/admin/+ASM/bdump'> *.core_dump_dest='/opt/ora10g/admin/+ASM/cdump'> *.instance_type='asm'> *.large_pool_size=24M > *.remote_login_passwordfile='SHARED' > *.

13、user_dump_dest='/opt/ora10g/admin/+ASM/udump' > EOF注: 是本机器的 $ORACLE_HOME 路径。7、创建结构目录oracleserver3 db_1$ mkdir -p /opt/ora10g/admi n/+ASM/udumporacleserver3 db_1$ mkdir -p /opt/ora10g/admi n/+ASM/bdumporacleserver3 db_1$ mkdir -p /opt/ora10g/admi n/+ASM/cdump8、创建asm实例的密码文件:oraclelocalhost

14、dbs$ orapwd file=orapw+ASM password=minnow9、我们来测试一个asm实例能否启动:oracleserver3 $ sqlplus- Productio n on Tue Aug 31 20:10:11 2010Copyright (c) 1982, 2005 <javascript:;> , Oracle. All rights reserved.En ter user- name:sys as sysdbaEn ter password:Conn ected to an idle in sta nee.SQL> startupORA-

15、29701: un able to conn ect to Cluster Man ager10、下面来添加CSS,以解决9中出现的问题。oraclelocalhost dbs$ localc onfig add提示需要以root来执行命令:/etc/oracle does not exist. Creating it now.Successfully accumulated n ecessary OCR keys.Creati ng OCR keys for user 'root', privgrp 'root'.Operati on successful.C

16、onfiguration for local CSS has been initializedAddi ng to in ittabStartup will be queued to in it withi n 90 sec onds.Check ing the status of new Oracle in it process.Expect ing the CRS daem ons to be up with in 600 sec on ds.CSS is active on these no des.localhostCSS is active on all no des.mount d

17、iskgroup 正常:Oracle CSS service is in stalled and running un der in it(1M)11、我们再启动以下ASM实例,由于我们没有创建磁盘组,所以提示没有rootserver3 # su - oracleoracleserver3 $ echo $ORACLE_SID+ASMoracleserver3 $ sqlplus- Production on Tue Aug 31 20:16:46 2010Copyright (c) 1982, 2005, Oracle. All rights reserved.En ter user- na

18、me: sys as sysdbaEn ter password:Conn ected to an idle in sta nee.SQL> startupASM in sta nee startedTotal System Global Area 96468992 bytesFixed Size1217908 bytesVariable Size70085260 bytesASM Cache25165824 bytesORA-15110: no diskgroups mounted 12、下面,可以执行dbca,开始创建数据库<javascript:;> 了:第一步的时候,

19、选择新建数据:Databnfv ConTiguration AuHtnnt. St*p 1 of 1? : Op»rktlon(Sfitetf tbfi £kpri|H>n IHa w« 虫环 W ptrtrfn Create a Dai abase广 C onfl fare D at abaft? 0 ptforre广 De! pf£ n。删t 吕 te广TempuiesCanfigiure ALoaidiiic 5lorag« Wan age men*Cancel » H«lp I4&屈第三步的时候,数据库

20、实例的SID要和ASM中的asm_diskstring参数中的SID 致本例中是SID)第六步时。指定存储项为 ASM :ih” sTorge "理(hsism 阳muici 'ike io unfl for wt J.irabjier Fne Sterni帕 Fit 5iiem 北rm対咻* AuioSiht Stongji WAnimtnd (ASM)uaiv-uUHFLBUJdHUM uum I m5 I !. MHU KMJAiflcjmarkSimoe Manwmen: ikfnptfief <JaiaMst fiorane aumdntjiraiion ar

21、a optltrUEtj1WJI4 fbr iJO performvw«. To UM ihis ofrtkwt vou mutt «hh«r沖輕Ty* j*t c-f U'5K5tc jt悶t电綁囑m ack roup pr pettfYin <Km5 asm q曲 jnfrupr RswDeutcciKaw uaniAi or volumes tai croue ihf required shared si ora-je for Re 白l 坤 RlKauon Ctu r s U门 dtkba绝t rr vou da n;f ihe Autfii

22、r jik 甕那和屯 Mifiaemtw /id 3 Clutstr h a Slsm h rt)t a.¥*alNijce fou ned ta ri-/e creld oa-e device for g* Paafii% (DOtFO川也 肿日 *eg filDU ire pfUroeg lain W aal>a$«匚简CMHelp点击Next的时候,提示需要关闭asm实例:第七步时,点击 Create New创建新的Disk Group :$瞅pik QraP冋弊也阳呷存酉 拿卸住血阳wtTM 口麻 GnjujiE闊埠cr tjnf pt m(jre ai5tc

23、 gojupf gu我<1 番 灯帖呻w 加厂站=口a*诵衬号“n qhoQe *ncttp idi?k QUMiUT sid dr出 曲iWin? f界 qtqugNflic Feo (M0) tpcecu r*e 阴 pa;( 嗣qt)>p ryrkifta mKrofm imo ircountfcrtsteNe#nriti D:sk,+ :-:Maw 坤Cancel Help给新的磁盘组取名为 DATA1,并把三块硬盘都加入到改组,冗余项选择normal:经过上述操作后,一个磁盘组 DATA1已经创建好,并且已经加载上:指定数据文件创建的位置,默认创建在DATA1磁盘组下:第

24、九步,指定Flash Recovery Area的位置和大小,按照默认的即可:第十步,选择安装样例数据库:第十一步,字符集我们可以进行如下的选择:第十二步,查看数据库存储相关信息:第十三步,点击 Finish 来结束配置过程,进行数据库的创建安装过程中的截图:安装完成后的截图:至此,单机上安装 ASM 已经完成。我们现在可以登陆asm实例,查看下一些相关的视图:oracleserver3 $ echo $ORACLE_SID+ASMoracleserver3 $ sqlplusSQL*Plus: Release Production on Tue Aug 31 20:56:29 2010Cop

25、yright (c) 1982, 2005, Oracle. All rights reserved.Enter user-name: sys as sysdbaEn ter password:Conn ected to:- ProductionWith the Partiti oning, OLAP and Data <javascript:;> Mining opti onsSQL> SELECT GROUP_NUMBER,INSTANCE_NAME,DB_NAME,STATUS2 FROM v$asm_clie nt;GROUP_NUMBER INSTANCE_NAME

26、 DB_NAME STATUS1ORCLORCLCONNECTED查看ASM中的数据文件:SQL> set lin esize 500SQL> SELECT FILE_NUMBER,BLOCKS,BLOCK_SIZE/1024 BLOCK_KB,BYTES/1024/1024AS MB,SPACE/1024/1024 AS MB,TYPE FROM v$asm_file;FILE_NUMBERBLOCKSBLOCK_KBMBMB TYPE256614418 480.007813965 DATAFILE257307218 240.007813485 DATAFILE25844818

27、35.007812575 DATAFILE2596418 5.007812512 DATAFILE260431166.73437524 CONTROLFILE261431166.73437524 CONTROLFILE262102401.5 50.0004883115 ONLINELOG263102401.5 50.0004883115 ONLINELOG264102401.5 50.0004883115 ONLINELOG265102401.5 50.0004883115 ONLINELOG266102401.5 50.0004883115 ONLINELOGFILE_NUMBERBLOCK

28、SBLOCK_KBMBMB TYPE267102401.5 50.0004883115 ONLINELOG26825618 20.007812542 TEMPFILE269128018 100.007813205 DATAFILE2705.5 .0024414062 PARAMETERFILE登陆ORCL实例oracleserver3 $ export ORACLE_SID=ORCLoracleserver3 $ sqlplus- Production on Tue Aug 31 20:53:52 2010Copyright (c) 1982, 2005, Oracle. All rights

29、 reserved.En ter user- name: sys as sysdbaEn ter password:Conn ected to:- ProductionWith the Partitio ning, OLAP and Data Mi ning opti onsSQL> select in sta nce_n ame from v$in sta nee;INSTANCE_NAMEORCL查看表空间及其所对应的文件名。发现具体的路径不详,由ASM自动给我们的文件命名进行 管理 <javascript:;> :SQL> select FILE_NAME ,TA

30、BLESPACE_NAME from dba_data_files;FILE_NAMETABLESPACE_NAME+DATA1/orcl/datafile/users.259.728512919USERS+DATA1/orcl/datafile/sysaux.257.728512919SYSAUX+DATA1/orcl/datafile/u ndotbs1.258.728512919UNDOTBS1+DATA1/orcl/datafile/system.256.728512919SYSTEM+DATA1/orcl/datafile/example.269.728513077EXAMPLE用命

31、令行添加新硬盘:1、以root命令来运行oracleasm命令rootserver3 dev# /etc/i nit.d/oracleasm createdisk VOL4 /dev/sde1Marking disk "VOL4" as an ASM disk: OK 2、登陆至ASM实例中,输入如下命令,需要有 add failgroup子句:SQL> alter diskgroup DATA1 add failgroup VOL4 disk 'ORCL:VOL4'可以看到,添加好了 VOL4 之后,会进行 "重平衡 " ,每个磁盘的使用容量是相同的: SQL> SELECT GROUP_NUMBER,DISK_NUMBER,NAME,TOTAL_MB,FREE_MB2 FROM v$asm_disk;GROUP_NUMBER DISK_NUMBER NAME TOTAL_MB FREE_MB10VOL12047137711VOL22047137612VOL32047137613VOL420471377As

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论