Oracle 10gR2 下配置簡單ASM例項
1. 從Oracle官方網站根據自己的作業系統下載 oracleasmlib 包,oracleasm-support 包 和 oracleasm-
下載地址:http://www.oracle.com/technology/software/tech/linux/asmlib/rhel4.html
2. 下載完成後以root使用者安裝
[root@localhost ~]# rpm -qa |grep oracleasm
[root@localhost software]# rpm -Uvh oracleasm-support-2.1.3-1.el4.x86_64.rpm \
> oracleasm-2.6.9-55.ELsmp-2.0.3-1.x86_64.rpm \
> oracleasmlib-2.0.4-1.el4.x86_64.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-55.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@localhost software]#
3. 以root身份做localconfig 配置
[orarms@localhost bin]$ ./localconfig add
You must be logged in as root to run ./localconfig.
Log in as root and restart ./localconfig execution.
[orarms@localhost bin]$
[root@localhost ~]# /home/orarms/product/10.2.0/db_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 30 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.
localhost
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
【附】可以通過crsclt check cssd命令檢查cssd service的狀態是否正常
[orarms@localhost ~]$ crsctl check cssd
CSS appears healthy
[orarms@localhost ~]$
4. 以root身份做oracleasm的配置
[root@localhost software]# /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
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: orarms
Default group to own the driver interface []: dba
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 ]
[root@localhost software]#
5. 以root身份做新增磁碟和分割槽操作
[root@localhost ~]# fdisk /dev/sdb
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 51200 411263968+ 83 Linux
/dev/sdb2 51201 121601 565496032+ 83 Linux
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601): 10145
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10145 81489681 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (10146-121601, default 10146):
Using default value 10146
Last cylinder or +size or +sizeM or +sizeK (10146-121601, default 121601):
Using default value 121601
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10145 81489681 83 Linux
/dev/sdb2 10146 121601 895270320 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]#
6. 建立ASM磁碟
[root@localhost software]# /etc/init.d/oracleasm listdisk
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@localhost software]# /etc/init.d/oracleasm listdisks
MYVOL1
[root@localhost software]# /etc/init.d/oracleasm deletedisk MYVOL1
Removing ASM disk "MYVOL1": [ OK ]
[root@localhost software]# /etc/init.d/oracleasm listdisks
[root@localhost software]# /etc/init.d/oracleasm createdisk MYVOL1 /dev/sda8
Marking disk "MYVOL1" as an ASM disk: [ OK ]
[root@localhost software]# /etc/init.d/oracleasm createdisk MYVOL2 /dev/sdb2
Marking disk "MYVOL2" as an ASM disk: [ OK ]
[root@localhost software]# /etc/init.d/oracleasm listdisks
MYVOL1
MYVOL2
【注】oracleasm scandisks 可以用在rac環境下同步ASM磁碟資訊,包含作業系統中獲取的磁碟資訊。
7. 切換使用者為oracle或者其他安裝了oracle的使用者,本例中為orarms。在$ORACLE_HOME/dbs/下建立+ASM例項的init.ora檔案和密碼檔案
[orarms@localhost ~]$ cd $ORACLE_HOME
[orarms@localhost db_1]$ cd dbs
[orarms@localhost dbs]$ vi init+ASM.ora
*.asm_diskstring='ORCL:MYVOL*'
*.background_dump_dest='/home/orarms/admin/+ASM/bdump'
*.core_dump_dest='/home/orarms/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/home/orarms/admin/+ASM/udump'
[orarms@localhost dbs]$ orapwd file=orapw+ASM password=dba
8. 設定SID,啟動例項,建立磁碟組
[orarms@localhost ~]$ export ORACLE_SID=+ASM
[orarms@localhost dbs]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Sep 8 16:45:00 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 130023424 bytes
Fixed Size 2082208 bytes
Variable Size 102775392 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
【注】啟動例項的時候出現ORA-15110錯誤非常正常,因為我們還沒有建立diskgroup
SQL> select path,mount_status from v$asm_disk order by disk_number;
PATH
--------------------------------------------------------------------------------
MOUNT_S
-------
ORCL:MYVOL1
CLOSED
ORCL:MYVOL2
CLOSED
【注】此時查詢 v$asm_disk,可以看到我們之前建立的ASM磁碟MYVOL1和MYVOL2,如果沒有看到,則是設定的asm_diskstring引數不正確,需要調整。
-- 開始建立磁碟組
SQL> create diskgroup diskgrp1 normal redundancy
2 failgroup failgrp1 disk 'ORCL:MYVOL1'
3 failgroup failgrp2 disk 'ORCL:MYVOL2';
Diskgroup created.
SQL> select path,mount_status from v$asm_disk order by disk_number;
PATH
--------------------------------------------------------------------------------
MOUNT_S
-------
ORCL:MYVOL1
CACHED
ORCL:MYVOL2
CACHED
【注】建立磁碟組後,再次查詢v$asm_disk檢視,發現ASM磁碟的狀態由closed變成cached
9. 建立spfile,重啟例項
-- 建立spfile
SQL> create spfile from pfile;
File created.
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 130023424 bytes
Fixed Size 2082208 bytes
Variable Size 102775392 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
【注】非常奇怪,這個地方有提示沒有磁碟組mounted,決定手動mount看看
SQL> alter diskgroup all mount;
alter diskgroup all mount
*
ERROR at line 1:
ORA-15110: no diskgroups mounted
【注】手動mount失敗,繼續提示沒有磁碟組,參考oracle錯誤資訊,看一下asm的引數設定,發現asm_diskgroups 沒有值,設定上,手動mount成功,再次重啟成功。
ORA-15110: no diskgroups mounted
Cause: No diskgroups were specified in the ASM_DISKGROUPS parameter, so instance startup or the ALTER DISKGROUP ALL MOUNT command did not mount any diskgroups.
Action: Specify valid diskgroups in the ASM_DISKGROUPS parameter or ignore the error.
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string ORCL:MYVOL*
asm_power_limit integer 1
SQL> alter system set asm_diskgroups="diskgrp1" scope=both;
System altered.
SQL> alter diskgroup all mount;
Diskgroup altered.
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 130023424 bytes
Fixed Size 2082208 bytes
Variable Size 102775392 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL>
至此,ASM簡單例項配置成功,建立使用ASM管理儲存的資料庫就很簡單了,dbca一路下去就ok
下面我在配置ASM出現問題和解決方法:
db_Standby-> export ORACLE_SID=+ASM
db_Standby-> sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Nov 9 12:52:48 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> select path,mount_status from v$asm_disk order by disk_number;
PATH MOUNT_S
-------------------- -------
ORCL:VOL1 CLOSED
ORCL:VOL2 CLOSED
ORCL:VOL3 CLOSED
ORCL:VOL4 CLOSED
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string
asm_power_limit integer 1
alter system set asm_diskgroups="DATA" ;
System altered.
SQL> show parameter asm
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string DATA
asm_diskstring string
asm_power_limit integer 1
SQL> alter diskgroup all mount;
Diskgroup altered.
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
【參考資料】
1. http://www.oracle.com/technology/tech/linux/asmlib/install.html
2. http://www.oracle.com/technology/global/cn/pub/articles/10gdba/week8_10gdba.html
3. http://jackjw.itpub.net/post/602/487507
4. http://blog.csdn.net/wyzxg/archive/2008/03/13/2176517.aspx
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13024285/viewspace-677847/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Oracle】ASM例項安裝入門OracleASM
- RAC+DG(asm單例項)ASM單例
- 【ASK_ORACLE】Relink ASM單例項資料庫詳細步驟OracleASM單例資料庫
- Oracle 11gR2 ASM例項記憶體管理OracleASM記憶體
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- 【ASK_ORACLE】Oracle RAC配置ASM Filter Driver(ASMFD)(一)ASMFD簡介OracleASMFilter
- ORACLE11GR2 RAC解除安裝ASM例項步驟OracleASM
- oracle10gR1 asm儲存簡單示例OracleASM
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- opengl簡單入門例項
- Spark 簡單例項(基本操作)Spark單例
- oracle之 單例項監聽修改埠Oracle單例
- 11.2.0.4單例項ASM安裝報錯ohasd failed to ... line 73.單例ASMAI
- EventBus詳解及簡單例項單例
- canal同步mysql,監聽單例項,多例項配置MySql單例
- Java的Socket通訊簡單例項Java單例
- ElasticSearch客戶端簡單操作例項Elasticsearch客戶端
- 呀!ASM例項起不來可咋整ASM
- Oracle 11g RAC到單例項OGG同步Oracle單例
- oracle一個listener偵聽多個例項的配置Oracle
- 4.1. Oracle例項Oracle
- Oracle Far Sync例項Oracle
- Oracle Linux 6.5 安裝Oracle 10gR2LinuxOracle 10g
- 超級簡單入門vuex 小例項Vue
- 淡入淡出效果簡單程式碼例項
- XML節點自動生成簡單例項XML單例
- C#out引數的簡單例項C#單例
- C++學習隨筆——簡單的單例設計模式例項C++單例設計模式
- oracle資料庫與oracle例項Oracle資料庫
- ORACLE-LINUX環境字元介面單例項安裝OracleLinux字元單例
- Oracle 11G資料庫單例項安裝Oracle資料庫單例
- 【PSU】Oracle打PSU及解除安裝PSU(單例項)Oracle單例
- 【BUILD_ORACLE】Oracle RAC配置ASM Filter Driver(ASMFD)(二)詳細配置步驟UIOracleASMFilter
- oracle 例項表查詢Oracle
- phpqrcode生成動態二維碼簡單例項PHP單例
- Python簡單函式迴圈綜合例項Python函式
- 分享一下 Laravel 的中時間的簡單處理方式例項Laravel
- oracle資料庫跨平臺(AIX)從RAC恢復至(linux)下的單例項Oracle資料庫AILinux單例
- oracle 11g 單例項資料庫的安裝Oracle單例資料庫