RedHat5.2下Linux Oracle 10g ASM 安裝詳細實錄-第二篇-ASM安裝

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

五、安裝ASM

1、在oracle網站下載支持包:
http://www.oracle.com/technology ... x/asmlib/rhel5.html
2、根據linux內核下載相應的asm安裝包:
根據uname –a查看內核(黃底紅字為內核): $ uname -a Linux L-DB-3-6 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux 如下為查詢結果: Library and Tools(別光顧內核查出來的四個RPM包遺漏這兩個關鍵的包哦!) · oracleasm-support-2.1.3-1.el5.x86_64.rpm · oracleasmlib-2.0.4-1.el5.x86_64.rpm Drivers for kernel 2.6.18-92.el5 · oracleasm-2.6.18-92.el5xen-2.0.5-1.el5.x86_64.rpm · oracleasm-2.6.18-92.el5debug-2.0.5-1.el5.x86_64.rpm · oracleasm-2.6.18-92.el5-debuginfo-2.0.5-1.el5.x86_64.rpm · oracleasm-2.6.18-92.el5-2.0.5-1.el5.x86_64.rpm
3、安裝 rpm -Uvh .......... --nodeps
注意:需要在root下安裝,在oracle下有如下錯誤: warning: oracleasm-2.6.18-92.el5xen-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 error: can't create transaction lock on /var/lib/rpm/__db.000

4、安裝完成後對用來做asm的磁碟進行分區(採用已經劃分好的三個分區:/dev/sda11、/dev/sda12、/dev/sda13):
fdisk /dev/sda
n
p
1


回車
回車
w
根據以上參數對所有硬碟都進行進行分區 示例:查看劃分好的分區 Last login: Mon Oct 18 15:58:24 2010 from 172.16.4.41 [root@L-DB-3-6 ~]# vi /etc/redhat-release [root@L-DB-3-6 ~]# vi /etc/oratab [root@L-DB-3-6 ~]# vi /etc/redhat-release [root@L-DB-3-6 ~]# fdisk -l Disk /dev/sda: 291.9 GB, 291999055872 bytes 255 heads, 63 sectors/track, 35500 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 255 2048256 83 Linux /dev/sda2 256 2805 20482875 83 Linux /dev/sda3 2806 4080 10241437 83 Linux /dev/sda4 4081 35500 252381150 5 Extended /dev/sda5 4081 19378 122881153 83 Linux /dev/sda6 19379 21928 20482843 83 Linux /dev/sda7 21929 23203 10241406 83 Linux /dev/sda8 23204 24478 10241406 83 Linux /dev/sda9 24479 25753 10241406 83 Linux /dev/sda10 25754 26263 4096543 82 Linux swap / Solaris /dev/sda11 26264 28696 19543041 83 Linux /dev/sda12 28697 31129 19543041 83 Linux /dev/sda13 31130 33562 19543041 83 Linux 5、創建asm磁碟
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk ORACLEASM1 /dev/sda11
/etc/init.d/oracleasm createdisk ORACLEASM2 /dev/sda12
/etc/init.d/oracleasm createdisk ORACLEASM3 /dev/sda13 6、查看asm磁碟:/etc/init.d/oracleasm listdisks 示例: [root@L-DB-3-6 ~]# /etc/init.d/oracleasm listdisks ORACLEASM1 ORACLEASM2 ORACLEASM3 7、安裝oracle(只裝軟體,以後通過dbca創建asm和資料庫) $ cd /database $ ls $./runInstaller 8、安裝過程中只選擇資料庫軟體(不選資料庫和ASM) 註:如下圖選擇第三個選項(Install database Software only) 9、創建asm實例 A.在$ORACLE_HOME/dbs下創建初始化文件init ASM.ora內容如下: vi init ASM.ora *.asm_diskstring='ORCL:ORACLEASM*' *.background_dump_dest='/home/oracle/admin/ ASM/bdump' *.core_dump_dest='/home/oracle/admin/ ASM/cdump' *.instance_type='asm' *.large_pool_size=12M *.remote_login_passwordfile='SHARED' *.user_dump_dest='/home/oracle/admin/ ASM/udump' 說明:第一行的ORCL:ORACLEASM*中ORCL為固定格式,ORACLEASM*代表asm磁碟,別的一目了然 B.創建目錄結構 mkdir -p /home/oracle/admin/ ASM/udump mkdir -p /home/oracle/admin/ ASM/bdump mkdir -p /home/oracle/admin/ ASM/cdump 示例: [oracle@L-DB-3-6 dbs]$ mkdir -p /home/oracle/admin/ ASM/udump [oracle@L-DB-3-6 dbs]$ mkdir -p /home/oracle/admin/ ASM/bdump [oracle@L-DB-3-6 dbs]$ mkdir -p /home/oracle/admin/ ASM/cdump C.啟動實例


export ORACLE_SID= ASM
sqlplus /as sysdba
startup 事例: [oracle@L-DB-3-6 dbs]$ export ORACLE_SID= ASM [oracle@L-DB-3-6 dbs]$ sqlplus /as sysdba
會報一個ORA-29701 :unable to connect to Cluster Manager錯誤
此時需要切換到root用戶執行:$ORACLE_HOME/bin/localconfig add 示例: [root@L-DB-3-6 ~]# cd /home/oracle/product/10.2.0/db_1/bin/ [root@L-DB-3-6 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. l-db-3-6 CSS is active on all nodes. Oracle CSS service is installed and running under init(1M)
做完后切換到oracle下就可以啟動了,不過會報一個:
ORA-15110: no diskgroups mounted 示例: 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
因為沒有創建磁碟組,那麼是正常的報錯,先不用理會.
D.創建spfile
create spfile from pfile;
創建完后spfile,關閉實例(shutdown immediate),再利用startup啟動一下. 示例: SQL> create spfile from pfile; File created.
E.創建磁碟組(一般最好成對添加,此處沒有)
SQL> create diskgroup dgroup1 normal redundancy
2 failgroup fgroup1 disk 'ORCL:ORACLEASM1','ORCL:ORACLEASM2'
3 failgroup fgroup2 disk 'ORCL:ORACLEASM3';



Diskgroup created.
查看掛載情況:
SQL> select name,state from v$asm_diskgroup;

NAME STATE
------------------------------ -----------
DGROUP1 MOUNTED

若沒有自動掛在,則需要手工掛在:
SQL> alter diskgroup dgroup1 mount;
alter diskgroup dgroup1 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DGROUP1" cannot be mounted
ORA-15030: diskgroup name "DGROUP1" is in use by another diskgroup
因為已經掛載,會報錯,是正常的.
查看參數:
SQL> show parameter asm_diskgroup;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string DGROUP1

本文出自 「麥地塢」 博客,請務必保留此出處http://yunlongzheng.blog.51cto.com/788996/407561





[火星人 ] RedHat5.2下Linux Oracle 10g ASM 安裝詳細實錄-第二篇-ASM安裝已經有355次圍觀

http://coctec.com/docs/linux/show-post-49540.html