單機環境安裝配置ASM例項
ASM是oracle針對rac釋出的儲存產品,雖然是針對叢集環境設定的,在單機環境上我們也可以採用ASM例項來管理磁碟。
(一)安裝配置
一、確認linux核心版本
[root@sigleNode ~]# uname -r
2.6.18-53.el5xen
需要根據上面核心版本去oracle官網上下載指定的ASMLib包,連結地址
<
下載的具體包如下:
kernel-debug-2.6.18-53.el5.i686.rpm
kernel-PAE-2.6.18-53.el5.i686.rpm
oracleasm-2.6.18-53.el5-2.0.4-1.el5.i686.rpm
oracleasm-2.6.18-53.el5debug-2.0.4-1.el5.i686.rpm
oracleasm-2.6.18-53.el5PAE-2.0.4-1.el5.i686.rpm
oracleasm-2.6.18-53.el5xen-2.0.4-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.0.4-1.el5.i386.rpm
其中前兩個包在oracle官網上是下載不到的,需要在csdn上下載,也可以聯絡我
二、安裝asmlib包
[root@sigleNodeasm]# rpm -ivh *.rpm
三、新增兩塊硬碟,然後分割槽,不需要格式化
[root@sigleNodedev]# fdisk /dev/hda
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):1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):261
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
執行同樣命令對/dev/hdb進行分割槽即可
分割槽之後的結果如下:
[root@sigleNode ~]# fdisk -l
Disk /dev/hda: 2147 MB, 2147483648 bytes
16 heads, 63 sectors/track, 4161 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 4161 2097112+ 83 Linux
Disk /dev/hdb: 2147 MB, 2147483648 bytes
16 heads, 63 sectors/track, 4161 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 4161 2097112+ 83 Linux
四、配置ASM環境
[root@sigleNode~]# /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 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 [ ]:dba
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 ]
五、新增磁碟
[root@sigleNodeasm]# /etc/init.d/oracleasm createdisk VOL1 /dev/ hda1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@sigleNodeasm]# /etc/init.d/oracleasm createdisk VOL2 /dev/ hdb1
Marking disk "VOL2" as an ASM disk: [ OK ]
可以透過以下命令查詢已經新增的ASM磁碟
[root@sigleNode ~]# /etc/init.d/oracleasm listdisks;
VOL1
VOL2
(二)建立ASM例項
oracle10g中建立ASM例項和資料庫都可以採用DBCA,這在一定程度上隱藏了相關細節,下面採用手工建立ASM例項,其實和手工建立資料庫大體類似建立引數檔案,密碼檔案,dump路徑
1、建立引數檔案
[oracle@singleNode db_1]$ vi $ORACLE_HOME/dbs/init+ASM.ora
*.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'
*.user_dump_dest='/opt/ora10g/admin/+ASM/udump'
儲存修改
2、建立dump目錄
[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE /admin/+ASM/bdump
[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE g/admin/+ASM/cdump
3、建立密碼檔案
[oracle@localhost ~]$ orapwd file=orapw+ASM password=asm
4、啟動ASM例項
[oracle@sigleNode ~]$ export ORACLE_SID=+ASM
[oracle@sigleNode ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 18 06:38:08 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-29701: unable to connect to Cluster Manager
由於單例項環境下預設不啟動CSS,所以啟動失敗
需要新增CSS配置之後啟動ASM例項
[oracle@sigleNode ~]$ localconfig add
You must be logged in as root to run /u01/app/oracle/product/10.2.0.1/bin/localconfig.
Log in as root and restart /u01/app/oracle/product/10.2.0.1/bin/localconfig execution.
系統提示必須以root使用者執行localconfig命令
[oracle@sigleNode ~]$ su -
Password:
[root@sigleNode ~]# /u01/app/oracle/product/10.2.0.1/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.
siglenode
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
CSS配置完畢,再次啟動ASM例項
[oracle@sigleNode ~]$ su -
Password:
[root@sigleNode ~]# su - oracle
[oracle@sigleNode ~]$ export ORACLE_SID=+ASM
[oracle@sigleNode ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 18 06:42:03 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 96468992 bytes
Fixed Size 1217908 bytes
Variable Size 70085260 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
提示沒有磁碟組需要載入
首先我們建立一下磁碟組
SQL> create diskgroup oradg1 external redundancy disk ‘ORCL:VOL1’;
SQL>diskGroup created
可以向現有磁碟組中增加磁碟
SQL> alter diskgroup oradg1 add disk ‘ORCL:VOL2’;
SQL>diskGroup altered
設定磁碟組oradg1為ASM例項預設載入的磁碟組
我們一開始沒有建立spfile,所以需要建立一下
SQL>create spfile from pfile;
SQL> alter system set asm_diskgroups=oradg1 scope=spfile;
System altered.
SQL> shutdown
關閉ASM例項之後重新啟動
SQL> startup
ASM instance started
Total System Global Area 96468992 bytes
Fixed Size 1217908 bytes
Variable Size 70085260 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
發現磁碟組已經載入成功,ASM例項成功建立並啟動成功
轉自:http://space.itpub.net/?uid-7483882-action-viewspace-itemid-755700
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/438414/viewspace-755932/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 單機環境配置ASM例項ASM
- ASM單例項(Oracle 11.2.0.4)環境(一)ASM單例Oracle
- ASM單例項(Oracle 11.2.0.4)環境(二)ASM單例Oracle
- Windows平臺模擬單例項ASM環境Windows單例ASM
- 單機搭建ASM環境ASM
- ORACLE-LINUX環境字元介面單例項安裝OracleLinux字元單例
- 【ASM學習】在windows 環境下建立ASM例項ASMWindows
- Rman 單例項filesystem(Windows)恢復到ASM環境(Linux)單例WindowsASMLinux
- (轉)Oracle rac環境下清除asm例項OracleASM
- Window下安裝Oracle ASM單例項資料庫OracleASM單例資料庫
- 【Oracle】ASM例項安裝入門OracleASM
- 在HACMP環境下裝單例項9IACM單例
- 單例項刪除ASM例項單例ASM
- 清除安裝失敗的asm例項ASM
- jenkins簡單安裝及配置(Windows環境JenkinsWindows
- 在linux環境安裝單機RocketMQLinuxMQ
- 5.6單例項安裝單例
- Redis單例項安裝Redis單例
- kafka環境安裝及簡單使用(單機版)Kafka
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- angular環境配置及安裝Angular
- Java安裝和環境配置Java
- scala安裝及環境配置
- GoLand安裝及環境配置GoLand
- Git環境配置與安裝Git
- Windows單機配置Zookeeper環境Windows
- 11.2環境ASM例項spfile放在ASM磁碟組的訪問方式ASM
- 刪除Linux非rac環境下的ASM例項LinuxASM
- mysql 5.7單例項安裝MySql單例
- [JAVA] JAVA 8 環境安裝配置Java
- QT Creator配置環境和安裝QT
- Linux環境HBase安裝配置Linux
- Linux環境Azkaban安裝配置Linux
- MacOS Flutter環境配置和安裝MacFlutter
- 安裝gnome桌面環境配置工具
- Docker 下安裝配置 lnmp 環境DockerLNMP
- Expo 環境配置和安裝指南
- jdk安裝,環境變數配置JDK變數