單機搭建ASM環境

perfychi發表於2012-08-27

[

Linux ASMLib 的發現字串
  ASMLib 使用發現字串來確定 ASM 正在請求哪些磁碟。一般的 Linux ASMLib 使用 glob 字串。字串必須以 "ORCL:" 為字首。磁碟通過名稱來指定。可以通過發現字串 "ORCL:VOL1" 在 ASM 中,發現以名稱 "VOL1" 建立的磁碟。類似地,可以用發現字串 "ORCL:VOL*" 來查詢所有以字串 "VOL" 開始的磁碟。

不能在發現字串中用路徑名稱來發現磁碟。如果缺少字首,那麼一般的 Linux ASMLib 將完全忽略發現字串,認為它適用於一個不同的 ASMLib。唯一的例外是空字串 ( ""),它被認為是一個全萬用字元。這與發現字串 "ORCL:*" 完全等價。

注意:一旦您用 Linux ASMLib 標記了磁碟,那麼 Oracle 資料庫 10g R1 (10.1) OUI 將不能發現您的磁碟。建議您完成“僅限於軟體” (Software Only) 的安裝,然後使用 DBCA 來建立資料庫(或者使用自定義安裝)。

]

 

單機搭建ASM環境

準備:

1.centos系統

2.Oracle database10G+instance

3.與系統匹配的ASMlib包

4.  3塊磁碟

 

一、安裝ASMlib,初始化ASMlib

建立asm能識別的disk。

/dev/sdb1 > VOL1

/dev/sdc1 > VOL2

/dev/sdd1 > VOL3

 

二、需要建立一份pfile(init+ASM.ora)如下

 

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

*.core_dump_dest='/u01/app/admin/+ASM/cdump'

*.user_dump_dest='/u01/app/admin/+ASM/udump'

*.asm_diskstring='ORCL:VOL*'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='exclusive'

 

三、啟動ORALCE_HOME下面的css

$ORACLE_HOME/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.

        asmdemo

CSS is active on all nodes.

Oracle CSS service is installed and running under init(1M)

 

四、啟動asm

export ORACLE_SID=+ASM

sqlplus / as sysdba

SQL> startup 

ASM instance started

 

Total System Global Area  130023424 bytes

Fixed Size                  2019032 bytes

Variable Size             102838568 bytes

ASM Cache                  25165824 bytes

ORA-15110: no diskgroups mounted

 

五、建立磁碟組 DATA、RECOVERY

create diskgroup DATA external redundancy disk 'ORCL:VOL1','ORCL:VOL2';

create diskgroup RECOVERY external redundancy disk 'ORCL:VOL3';

六、建立spfile

create spfile from pfile;

Shutdown à startup

七、mount asm磁碟組

alter diskgroup DATA mount;

alter diskgroup RECOVERY mount;

 

SQL> select name,state from v$asm_diskgroup;

 

NAME                           STATE

------------------------------ -----------

DATA                           MOUNTED

RECOVERY                       MOUNTED

八、測試ASM。有可能需要 alter system register 在rdbms 中註冊asm

Export ORACLE_SID=asmdemo

Sqlplus / as sysdba

Create tablespace test datafile ‘+DATA/test.dbf’ size 50m;

進入asm檢視檔案

Export ORACLE_SID=ASM

Asmcmd

Cd  data

Ls

有test.dbf檔案就代表成功搭建。

drop tablespace test including contents and datafiles;

 

 

*  上述少了建立ASM口令檔案和建立ASM dump的路徑步驟,此處可以參考:http://space.itpub.net/?uid-27042095-action-viewspace-itemid-742332

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-741974/,如需轉載,請註明出處,否則將追究法律責任。

相關文章