【BUILD_ORACLE】使用ASMLib包搭建ASM磁碟
前言
雖然目前主流使用的是UDEV去搭建ASM磁碟,但ASMLib包依舊是Oracle官方推薦的搭建方式,此文件適用於Linux 6和Linux 7,也適用於ASM單例項和RAC環境(唯一的區別是ASMLib包需要分別下載對應OS支援的版本)。本文件以Linux 6的ASM單例項資料庫舉例。
注:udev繫結的方式參考:
http://blog.itpub.net/69992972/viewspace-2754349/
實驗環境準備
OS:RHEL 6.4
ASM&DB:Oracle 11.2.0.4
RPM:oracleasm-support-2.1.8-1.el6.x86_64.rpm,kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm,oracleasmlib-2.0.4-1.el6.x86_64.rpm(缺一不可)
RPM下載地址:
OL6:
OL7:
安裝步驟
1. 給磁碟分割槽
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x37d16a21.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
p
##只需要一個主分割槽就行,不需要擴充套件分割槽,邏輯分割槽這些
Partition number (1-4, default 1): 1
First sector (2048-106587366, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-106587366, default 106587366):
+2G ##隨便給個大小,全部劃分給主分割槽都行
Partition 1 of type Linux and of size 2 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
2. 安裝Oracle缺失rpm包:
# rpm -ivh libaio-devel-0.3.106-3.2.x86_64.rpm
# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
# rpm -ivh elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
3. 安裝ASMLIB包:
# rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
# rpm -ivh kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm
# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
# oracleasm -V ##安裝後檢視oracleasm命令是否可用
4. 建立相關使用者,組,環境變數和安裝目錄:
DB:
# groupadd -g 501 oinstall
# groupadd -g 502 dba
# groupadd -g 503 oper
# groupadd -g 504 asmadmin
# groupadd -g 505 asmoper
# groupadd -g 506 asmdba
Grid:
# useradd -g oinstall -G dba,asmdba,oper -u 501 oracle
# passwd oracle
# useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -u 502 grid
# passwd grid
# Oracle Settings oracle使用者環境變數
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG=american_america.zhs16cgb231280
$source .bash_profile生效
# grid Settings grid使用者環境變數
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM
export ORACLE_BASE=/oracle/app/grid
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG=american_america.zhs16cgb231280
$source .bash_profile生效
# mkdir -p /oracle/app/oracle/product/11.2.0/db_1 ##oracle使用者$ORACLE_HOME
# mkdir -p /oracle/app/grid/product/11.2.0/db_1 ##grid使用者$GI_HOME
# chown -R oracle:oinstall /oracle/
# chown -R grid:oinstall /oracle/app/grid
# chmod -R 775 /oracle
5. 建立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 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 []: grid
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (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 ]
# fdisk -l
# oracleasm createdisk ORACLEASM1 /dev/sdb1 ##建立ASM
# oracleasm listdisks ##檢視是否建立成功
# ls -l /dev/oracleasm/disks ##檢視建立的asm磁碟
6. 後續操作
接下來就可以安裝grid軟體,db軟體和建庫了
注意:
單例項在安裝Grid軟體的時候,需要選擇下圖的第二項,因為需要選擇ASM磁碟(RAC可以直接選第一項):
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69992972/viewspace-2751793/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用udev擴充套件ASM磁碟組dev套件ASM
- ASM磁碟組限制ASM
- linux vdo驗證 oracle asm diskgroup sector_size 4096 udev asmlibLinuxOracleASMdev
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- 遷移ASM磁碟組ASM
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- ASM磁碟組更換磁碟的操作方法ASM
- ASM 磁碟組的建立及擴容ASM
- ORACLE ASM磁碟組空間溢位OracleASM
- ASM磁碟組擴容操作文件ASM
- 【BUILD_ORACLE】Oracle RAC配置ASM Filter Driver(ASMFD)(二)詳細配置步驟UIOracleASMFilter
- ASM磁碟簡單維護,新增,刪除ASM
- Oracle RAC日常運維-ASM磁碟擴容Oracle運維ASM
- Oracle ASM磁碟組擴容(AIX7.1)OracleASMAI
- ASM磁碟組ORA-15042 ORA-15096ASM
- ORACLE ASM的SSD磁碟空間回收分析OracleASM
- Oracle asm磁碟損壞異常恢復OracleASM
- 一次ASM新增新的磁碟組ASM
- 【BUILD_ORACLE】Oracle 19c RAC搭建(三)使用UDEV配置共享儲存UIOracledev
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- Oracle資料庫 ASM磁碟線上擴容Oracle資料庫ASM
- ASM重新命名包含OCR/vote file的磁碟組ASM
- 關於Oracle 10g ASM磁碟大小的限制Oracle 10gASM
- RAC之grid叢集安裝及ASM磁碟組配置ASM
- ASM磁碟頭資訊損壞和修復(kfed/dd)ASM
- 遷移OCR和VotingDisk並刪除原ASM磁碟組ASM
- Oracle RAC ASM磁碟組擴容時遇到的VIP漂移OracleASM
- 基於裸裝置的ASM磁碟組擴容方案ASM
- 東南亞 ASM 資料包告(2019):ASM
- 12C__單機安裝Grid+Oracle的方法,ASM使用UDEV進行磁碟繫結OracleASMdev
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- 【BUILD_ORACLE】Oracle 19c RAC搭建(五)DB軟體安裝UIOracle
- 【BUILD_ORACLE】Oracle 19c RAC搭建(四)Grid軟體安裝UIOracle
- 使用 Satis 搭建私有的 Composer 包倉庫
- ASM磁碟空間假裝耗盡,ORA-15041: diskgroup space exhaustedASM
- 如何檢視Oracle RAC的asm磁碟的udev對應關係OracleASMdev