ASM之建立ASM例項

Michael_DD發表於2014-12-04
ASM之建立ASM例項

(下面基於VMware + RHEL 5.4 + Oracle 10g R2演示)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.安裝ASM包 使用ASM例項,需要到Oracle官方網站下載所需的ASM包。
   下載路徑:ASMLib下載 注意下載支援該核心的包,分為兩部分,一是Library and Tools,二是Drivers for kernel
如本人的Linux的核心為:
[root@oradb ~]# uname -rm 2.6.18-164.el5 i686
則下載對應的包為:
Library and Tools oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.3-1.el5.i386.rpm
Drivers for kernel 2.6.18-164.el5 oracleasm-2.6.18-164.el5xen-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5debug-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5PAE-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm

使用下面類似的方式來安裝這些包,關於RPM 的使用請參考:RPM 使用簡介

[root@oradb asm]# rpm -Uvh oracleasm-support-2.1.3-1.el5.i386.rpm

驗證安裝的包
[root@oradb asm]#
rpm -qa | grep asm oracleasm-support-2.1.3-1.el5
rpm -qa | grep oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5
rpm -qa | grep oracleasm-2.6.18-164.el5-2.0.5-1.el5


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2.啟用css服務(Cluster Synchronization Services )

用於同步ASM例項與RDBMS例項 使用root帳戶進行配置,配置程式位於$ORACLE_HOME/bin
[root@oradb ~]# /u01/oracle/10g/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. oradb CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.建立ASM引數檔案(使用VI或VIM)

[oracle@oradb dbs]$ cat /u01/oracle/10g/dbs/init+ASM.ora

*.asm_diskstring='' #為空表示可以搜尋任意的ASM磁碟
*.background_dump_dest='/u01/oracle/admin/+ASM/bdump' #後臺程式存放位置
*.core_dump_dest='/u01/oracle/admin/+ASM/cdump' #核心程式存放位置
*.user_dump_dest='/u01/oracle/admin/+ASM/udump' #使用者程式存放位置
*.instance_type='ASM' #例項型別,普通例項預設則為RDBMS *.instance_name='+ASM' #例項名字
*.large_pool_size=12M #為例項分配large_pool的大小
*.remote_login_passwordfile='SHARED' #登陸認證方式
*.asm_power_limit=1 #控制均衡操作的資源,預設為

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4.建立ASM後臺程式目錄,

參照引數檔案中的配置來建立
[oracle@oradb ~]$ echo $ORACLE_BASE /u01/oracle/10g
[oracle@oradb ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
[oracle@oradb ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
[oracle@oradb ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5.建立密碼檔案及spfile引數檔案
[oracle@oradb ~]$ orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=redhat entries=8
[oracle@oradb ~]$ export ORACLE_SID=+ASM
SQL> conn / as sysdba Connected to an idle instance.
SQL> startup ASM instance started
ORA-15110: no diskgroups mounted
SQL> create spfile from pfile;
SQL> select * from v$asm_diskgroup;
no rows selected

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7.建立ASM磁碟及配置ASMlib驅動

在Vmware分配幾個空閒的磁碟用於建立ASM磁碟,建議使用不同的磁碟控制器
下面使用個磁碟來組建ASM磁碟組,分別為sdd,sde,sdf,sdg 分別對個磁碟進行分割槽,列出sdd的分割槽樣例,其餘如法炮製
[root@oradb ~]# fdisk /dev/sdd
Command (m for help): n
Command action e
extended p
primary partition (1-4) p
Partition number (1-4): 1
First cylinder (1-261, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261 Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8.建立ASM資料庫 使用dbca工具根據提示來建立使用ASM儲存的資料庫
建立使用ASM儲存的資料庫完畢之後,對於ASM資料庫啟動應首先保證ASM例項先被啟動,因為RDBMS是ASM例項服務的一個客戶端
接下來再來啟動RDBMS

--首先啟動asm例項
export ORACLE_SID=+ASM sqlplus / as sysdba startup exit --接下來啟動rdbms資料庫
export ORACLE_SID=orcl
sqlplus / as sysdba startup




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

相關文章