VMware虛擬機器搭建Linux Oracle 10g ASM環境
1.新增磁碟進行分割槽
這裡我們將新增磁碟分成3部分:/dev/sdb1,/dev/sdb2,/dev/sdb3
2.安裝asm包
4.建立asm磁碟
這裡我們將新增磁碟分成3部分:/dev/sdb1,/dev/sdb2,/dev/sdb3
[root@ocp db10g]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-783, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-783, default 783): +2G
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 244 1959898+ 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (245-783, default 245):
Using default value 245
Last cylinder or +size or +sizeM or +sizeK (245-783, default 783): +2g
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 244 1959898+ 83 Linux
/dev/sdb2 245 488 1959930 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (489-783, default 489):
Using default value 489
Last cylinder or +size or +sizeM or +sizeK (489-783, default 783):
Using default value 783
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 244 1959898+ 83 Linux
/dev/sdb2 245 488 1959930 83 Linux
/dev/sdb3 489 783 2369587+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
2.安裝asm包
[root@ocp asm2.6.18.164-el5]# rpm -ivh oracleasm-support-2.1.7-1.el5.i386.rpm
warning: oracleasm-support-2.1.7-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@ocp asm2.6.18.164-el5]# rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-164.el########################################### [100%]
[root@ocp asm2.6.18.164-el5]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
3.初始化ASM
3.初始化ASM
[root@ocp asm2.6.18.164-el5]# /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 []: orainstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
4.建立asm磁碟
[root@ocp asm2.6.18.164-el5]# /etc/init.d/oracleasm createdisk vol1 /dev/sdb1
Marking disk "vol1" as an ASM disk: [ OK ]
[root@ocp asm2.6.18.164-el5]# /etc/init.d/oracleasm createdisk vol2 /dev/sdb2
Marking disk "vol2" as an ASM disk: [ OK ]
[root@ocp asm2.6.18.164-el5]# /etc/init.d/oracleasm createdisk vol3 /dev/sdb3
Marking disk "vol3" as an ASM disk: [ OK ]
列出所有asm磁碟
列出所有asm磁碟
[root@ocp ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
掃描asm磁碟
[root@ocp ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
5.建立ASM例項
5.建立ASM例項
設定當前sid為asm
[oracle@ocp ~]$ export ORACLE_SID=+ASM
取一個pfile模板檔案,並進行修改
因為我們還沒有進行磁碟組的分配,所以報錯ORA-15110是正常的。
ASM例項已經啟動,這個時候我們就可以用DBCA來建立資料庫了,唯一需要注意的是在選擇資料檔案和閃回區存放位置的時候設定一下
[oracle@ocp ~]$ cat $ORACLE_HOME/dbs/init.ora |grep -v ^# >$ORACLE_HOME/dbs/init+ASM.ora
[oracle@ocp ~]$ mkdir /u01/oracle/admin/+ASM/{b,c,u}dump -p
[oracle@ocp ~]$ cd $ORACLE_HOME/dbs
修改初始化檔案
修改初始化檔案
[oracle@ocp dbs]$ vi init+ASM.ora
注意:這裡需要刪除原先的內容,新增以下內容:
注意:這裡需要刪除原先的內容,新增以下內容:
asm_diskstring='ORCL:VOL*'
background_dump_dest='/u01/oracle/admin/+ASM/bdump'
user_dump_dest='/u01/oracle/admin/+ASM/udump'
instance_type='asm'
large_pool_size=30m
core_dump_dest='/u01/oracle/admin/+ASM/cdump'
6.建立密碼檔案,注意在dbs目錄下
[oracle@ocp dbs]$ orapwd file=orapw+ASM password=oracle
6.建立密碼檔案,注意在dbs目錄下
[oracle@ocp dbs]$ orapwd file=orapw+ASM password=oracle
7.啟動css叢集服務
[oracle@ocp dbs]$ exit
[root@ocp ~]# cd /u01/oracle/product/10gr2/db10g/bin
[root@ocp 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.
ocp
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
8.啟動asm例項
8.啟動asm例項
[root@ocp bin]# su - oracle
[oracle@ocp ~]$ export ORACLE_SID=+ASM
[oracle@ocp ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 7 14:17:19 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 104857600 bytes
Fixed Size 1217956 bytes
Variable Size 78473820 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
因為我們還沒有進行磁碟組的分配,所以報錯ORA-15110是正常的。
建立磁碟組
第一個我們是用來放資料檔案的用的是normal方式
SQL> create diskgroup oradata normal redundancy disk 'ORCL:VOL1','ORCL:VOL2';
Diskgroup created.
這裡我們是用來放閃回區的,選擇為外部冗餘的方式
SQL> create diskgroup fla external redundancy disk 'ORCL:VOL3' size 2G;
Diskgroup created.
檢視一下我們的磁碟組
SQL> select GROUP_NUMBER,NAME,BLOCK_SIZE,STATE,TYPE from v$asm_diskgroup;
GROUP_NUMBER NAME BLOCK_SIZE STATE TYPE
------------ ------------------------------ ---------- ----------- ------
1 ORADATA 4096 MOUNTED NORMAL
2 FLA 4096 MOUNTED EXTERN
ASM例項已經啟動,這個時候我們就可以用DBCA來建立資料庫了,唯一需要注意的是在選擇資料檔案和閃回區存放位置的時候設定一下
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15592508/viewspace-734962/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 虛擬機器arm虛擬環境搭建虛擬機
- Linux環境搭建 | 手把手教你配置Linux虛擬機器Linux虛擬機
- 虛擬機器環境搭建之vagrant虛擬機
- 使用VMware Workstation安裝 Linux虛擬環境Linux
- 虛擬環境搭建
- 本地訪問虛擬機器(Vmware)環境下配置的域名虛擬機
- RHEL9.4搭建虛擬機器實驗環境虛擬機
- 虛擬機器搭建測試環境解決方案虛擬機
- vmware虛擬機器linux重置密碼虛擬機Linux密碼
- VMware虛擬機器虛擬機
- python虛擬環境搭建Python
- Python搭建虛擬環境Python
- 一、虛擬機器環境配置虛擬機
- 第4篇 虛擬機器搭建gitlab環境步驟虛擬機Gitlab
- 虛擬機器搭建rac ASM盤啟動失敗虛擬機ASM
- 在Window系統中安裝VMware虛擬機器搭建Linux伺服器虛擬機Linux伺服器
- python virtualenv虛擬環境搭建Python
- CentOS 7.6虛擬環境搭建CentOS
- KVM虛擬化環境搭建
- Ubuntu虛擬機器進入虛擬環境的流程Ubuntu虛擬機
- 虛擬機器基礎環境配置虛擬機
- vmware虛擬機器環境下配置centos為靜態IP的步驟虛擬機CentOS
- 零報錯基於Virtualbox虛擬機器搭建Linux(Ubuntu)的Android開發環境虛擬機LinuxUbuntuAndroid開發環境
- 在Linux使用虛擬環境Linux
- 學習CDH叢集環境的搭建(虛擬機器可演示)虛擬機
- 虛擬機器巢狀 VMWare虛擬機巢狀
- 虛擬機器 VM virtualBox && VMware虛擬機
- Windows逆向之配置虛擬機器環境Windows虛擬機
- 【虛擬機器】VMware-VMware Tool安裝虛擬機
- 虛擬機器快速搭建弱網測試環境 ATC (適合新手)虛擬機
- mac虛擬機器搭建自動化環境-wda和python wda clientMac虛擬機Pythonclient
- VMware 虛擬機器一鍵去虛擬化工具虛擬機
- VMware虛擬機器linux系統開機一直黑屏虛擬機Linux
- linux虛擬機器環境快速搭建redis5.x版本的主從叢集總結Linux虛擬機Redis
- VMware虛擬機器遷移到PVE虛擬機
- VMware Workstation Pro建立虛擬機器虛擬機
- VMware虛擬機器獲取教程虛擬機
- VMware虛擬機器如何設定使主機和虛擬機器不同IP虛擬機
- 07、環境-虛擬機器網路設定虛擬機