您好,登錄后才能下訂單哦!
Oracle DataBase單實例使用ASM案例(4)--AIX系統Oracle 10g應用
系統環境:
操作系統: AIX5300-08
Oracle 軟件: Oracle 10gR2
對于AIX系統,在Oracle 10g下使用ASM非常方便,在安裝Oracle 數據庫軟件后,不需要安裝任何其他軟件,就可以使用ASM存儲數據。
1、建立ASM Instance
[oracle@aix211 dbs]$cat init+ASM.ora
instance_type='asm'
asm_diskstring='/dev/rlv*'
large_pool_size=12m
asm_diskgroups='DG1','RCY1'
background_dump_dest=/u01/app/oracle/admin/+ASM/bdump
core_dump_dest=/u01/app/oracle/admin/+ASM/cdump
user_dump_dest=/u01/app/oracle/admin/+ASM/udump
2、建立Instance運行相關目錄
[oracle@aix211 dbs]$mkdir -p /u01/app/oracle/admin/+ASM/bdump
[oracle@aix211 dbs]$mkdir -p /u01/app/oracle/admin/+ASM/cdump
[oracle@aix211 dbs]$mkdir -p /u01/app/oracle/admin/+ASM/udump
3、啟動CSS進程
CSS進程用于ASM Instance和 RDBMS之間通訊
[oracle@aix211 bin]$./localconfig add
You must be logged in as root to run ./localconfig.
Log in as root and restart ./localconfig execution.
[oracle@aix211 bin]$su -
root's Password:
[u@h W]$bash
[root@aix211 /]#cd /u01/app/oracle/product/10.2.0/db_1/bin
[root@aix211 bin]#./localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'system'..
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.
aix211
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
4、啟動ASM Instance
[oracle@aix211 ~]$export ORACLE_SID=+ASM
[oracle@aix211 ~]$sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 27 16:22:40 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ASM instance started
Total System Global Area 130023424 bytes
Fixed Size 2019136 bytes
Variable Size 102838464 bytes
ASM Cache 25165824 bytes
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string
db_unique_name string +ASM
global_names boolean FALSE
instance_name string +ASM
lock_name_space string
log_file_name_convert string
service_names string +ASM
SQL>
5、通過LV建立ASM磁盤
[root@aix211 /]#lsvg asmvg
VOLUME GROUP: asmvg VG IDENTIFIER: 00040f8a00004c00000001463c91f6ec
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 480 (30720 megabytes)
MAX LVs: 256 FREE PPs: 480 (30720 megabytes)
LVs: 0 USED PPs: 0 (0 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
1)建立邏輯卷
[root@aix211 /]#mklv -y lv_asm1 asmvg 64
lv_asm1
[root@aix211 /]#mklv -y lv_asm2 asmvg 64
lv_asm2
[root@aix211 /]#mklv -y lv_asm3 asmvg 64
lv_asm3
[root@aix211 /]#mklv -y lv_asm4 asmvg 64
lv_asm4
[root@aix211 /]#lsvg -l asmvg
asmvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lv_asm1 jfs 64 64 1 closed/syncd N/A
lv_asm2 jfs 64 64 1 closed/syncd N/A
lv_asm3 jfs 64 64 1 closed/syncd N/A
lv_asm4 jfs 64 64 1 closed/syncd N/A
[root@aix211 /]#
2)設置邏輯卷屬性
[root@aix211 /]#chown oracle:dba /dev/*lv_asm*
[root@aix211 /]#ls -l /dev/|grep asm
crw-rw---- 1 root system 88, 0 May 27 16:25 asmvg
brw-rw---- 1 oracle dba 88, 1 May 27 16:28 lv_asm1
brw-rw---- 1 oracle dba 88, 2 May 27 16:29 lv_asm2
brw-rw---- 1 oracle dba 88, 3 May 27 16:29 lv_asm3
brw-rw---- 1 oracle dba 88, 4 May 27 16:29 lv_asm4
crw-rw---- 1 oracle dba 88, 1 May 27 16:28 rlv_asm1
crw-rw---- 1 oracle dba 88, 2 May 27 16:29 rlv_asm2
crw-rw---- 1 oracle dba 88, 3 May 27 16:29 rlv_asm3
crw-rw---- 1 oracle dba 88, 4 May 27 16:29 rlv_asm4
3)查看ASM磁盤信息
[oracle@aix211 ~]$kfod
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
+ASM /u01/app/oracle/product/10.2.0/db_1
[oracle@aix211 ~]$kfod status=TRUE asm_diskstring='/dev/rlv*' disk=all
--------------------------------------------------------------------------------
Disk Size Header Path
================================================================================
1: 4096 Mb FOREIGN /dev/rlv_asm1 //這個裸設備信息和其他lv不一致
2: 4096 Mb CANDIDATE /dev/rlv_asm2
3: 4096 Mb CANDIDATE /dev/rlv_asm3
4: 4096 Mb CANDIDATE /dev/rlv_asm4
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
+ASM /u01/app/oracle/product/10.2.0/db_1
6、建立ASM磁盤組
[oracle@aix211 ~]$export ORACLE_SID=+ASM
[oracle@aix211 ~]$sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 27 16:36:03 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create diskgroup dg1
2 normal redundancy
3 failgroup fg1 disk '/dev/rlv_asm1'
4 failgroup fg2 disk '/dev/rlv_asm2';
create diskgroup dg1
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15201: disk /dev/rlv_asm1 contains a valid RDBMS file
報錯信息:rlv_asm1被數據庫實例占用
清除ASM磁盤頭部信息:
[oracle@aix211 ~]$dd if=/dev/zero of=/dev/rlv_asm1 bs=8192 count=2560
2560+0 records in
2560+0 records out
[oracle@aix211 ~]$kfod status=TRUE asm_diskstring='/dev/rlv*' disk=all
--------------------------------------------------------------------------------
Disk Size Header Path
================================================================================
1: 4096 Mb CANDIDATE /dev/rlv_asm1 //此時,rlv_asm1和其他lv保持一致
2: 4096 Mb CANDIDATE /dev/rlv_asm2
3: 4096 Mb CANDIDATE /dev/rlv_asm3
4: 4096 Mb CANDIDATE /dev/rlv_asm4
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
+ASM /u01/app/oracle/product/10.2.0/db_1
再建立磁盤組:
[oracle@aix211 ~]$sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 27 16:44:16 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create diskgroup dg1
2 normal redundancy
3 failgroup fg1 disk '/dev/rlv_asm1'
4 failgroup fg2 disk '/dev/rlv_asm2';
Diskgroup created.
SQL> create diskgroup rcy1
2 normal redundancy
3 failgroup fg1 disk '/dev/rlv_asm3'
4 failgroup fg2 disk '/dev/rlv_asm4';
Diskgroup created.
7、查看磁盤組信息
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DG1 MOUNTED
RCY1 MOUNTED
SQL> select name,path,state from v$asm_disk
NAME PATH STATE
------------------------------ -------------------------------------------------- --------
DG1_0000 /dev/rlv_asm1 NORMAL
DG1_0001 /dev/rlv_asm2 NORMAL
RCY1_0000 /dev/rlv_asm3 NORMAL
RCY1_0001 /dev/rlv_asm4 NORMAL
@至此,在AIX系統通過Oracle 10g建立ASM存儲系統成功,可以通過ASM 磁盤組進行DataBase的存儲,發揮ASM存儲系統的有時,提高Oracle數據庫I/O的性能。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。