11gr2新增ACFS檔案系統(一)

yangtingkun發表於2011-04-19

11.2中,Oracle利用ASM的功能提供了ACFS檔案系統功能。

 

 

9中,RAC環境可以使用Oracle提供的ocfs cluster檔案系統。而11.2中,ACFS檔案系統是OCFS的替代功能,ACFS同樣可以提供CLUSTER共享。

對於Linux系統,Oracle11.2.0.1提供了這個功能,在11.2.0.2中,Solaris系統支援這個功能。

bash-3.00$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Tue Dec 28 23:09:14 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select instance_name from gv$instance;

INSTANCE_NAME
----------------
+ASM1
+ASM2

首先確認CLUSTERASM已經配置成功,然後利用ASM建立VOLUME

SQL> host asmcmd
ASMCMD> volcreate -G data oravolume
ASMCMD> volcreate -G data -s 20G oravolume
ASMCMD> volinfo -G data oravolume
Diskgroup Name: DATA

         Volume Name: ORAVOLUME
         Volume Device: /dev/asm/oravolume-39
         State: ENABLED
         Size (MB): 20480
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:

ASMCMD> exit

SQL> select volume_name, volume_device
  2  from v$asm_volume;

VOLUME_NAME                    VOLUME_DEVICE
------------------------------ --------------------------------------------------
ORAVOLUME                      /dev/asm/oravolume-39

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

下面利用作業系統mkfs來建立檔案系統:

bash-3.00$ su -
口令:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
# mkfs -F acfs /dev/asm/oravolume-39
mkfs: version                   = 11.2.0.2.0
mkfs: on-disk version           = 39.0
mkfs: volume                    = /dev/asm/roravolume-39
mkfs: volume size               = 21474836480
mkfs: Format complete.
# mount -F acfs /dev/asm/oravolume-39 /data/oracle/product/11.2
# chown -R oracle:oinstall /data/oracle/product/11.2
chown: .ACFS:
許可權被否定
chown: .fileid:
許可權被否定
chown: repl:
許可權被否定
chown: staging:
許可權被否定
chown: ready:
許可權被否定
chown: processed:
許可權被否定
chown: logs:
許可權被否定
chown: snaps:
許可權被否定
chown: lost+found:
許可權被否定

至此檔案系統已經載入到作業系統中,且給oracle使用者授權,下面可以用oracle使用者訪問:

bash-3.00$ echo "racnode1" >> /data/oracle/product/11.2/test.log
bash-3.00$ more /data/oracle/product/11.2/test.log
racnode1

如果想要載入的檔案系統變成CLUSTER檔案系統,還需要在其他節點上執行:

bash-3.00$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Wed Dec 29 00:02:00 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
+ASM2

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
bash-3.00$ asmcmd
ASMCMD> volenable -G data oravolume
ASMCMD> volinfo -G data oravolume
Diskgroup Name: DATA

         Volume Name: ORAVOLUME
         Volume Device: /dev/asm/oravolume-39
         State: ENABLED
         Size (MB): 20480
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /data/oracle/product/11.2

ASMCMD> exit
bash-3.00$ su -
口令:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
# mount -F acfs /dev/asm/oravolume-39 /data/oracle/product/11.2
# chown -R oracle:oinstall /data/oracle/product/11.2
chown: .ACFS:
許可權被否定
chown: .fileid:
許可權被否定
chown: repl:
許可權被否定
chown: staging:
許可權被否定
chown: ready:
許可權被否定
chown: processed:
許可權被否定
chown: logs:
許可權被否定
chown: snaps:
許可權被否定
chown: lost+found:
許可權被否定
# exit
bash-3.00$ more /data/oracle/product/11.2/test.log
racnode1

可以登陸asm例項檢查acfs檔案系統資訊:

bash-3.00$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Wed Dec 29 00:09:41 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> set pages 100 lines 120
SQL> col volume_name format a12
SQL> col volume_device format a22
SQL> col mountpath format a25
SQL> select group_number, volume_name, size_mb, volume_device, mountpath
  2  from v$asm_volume;

GROUP_NUMBER VOLUME_NAME     SIZE_MB VOLUME_DEVICE          MOUNTPATH
------------ ------------ ---------- ---------------------- -------------------------
           1 ORAVOLUME         20480 /dev/asm/oravolume-39  /data/oracle/product/11.2

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-692924/,如需轉載,請註明出處,否則將追究法律責任。

相關文章