您的位置:首页 > 数据库 > Oracle

Using the Oracle ASM Cluster File System (Oracle ACFS) on Linux,Part Two

2016-10-28 15:48 573 查看

Using the Oracle ASM Cluster File System (Oracle ACFS) on Linux,Part Two

This article, part two of this three part series on ACFS, continues on with the description of how to create an Oracle ASM Cluster File System in an Oracle 11g release 2 RAC database on the Linux operating environment, picking up where we left off in part one where we had finished with the creation of a new Oracle ASM cluster file system and registered in the Oracle ACFS mount registry. We are now ready to log in to all Oracle RAC nodes as root and run the mount command.

Mount the ASM Cluster File System

Now that the new Oracle ASM cluster file system has been created and registered in the Oracle ACFS mount registry, log in to all Oracle RAC nodes as root and run the following mount command:
[root@racnode1 ~]# /bin/mount -t acfs /dev/asm/docsvol1-300 /documents1/sbin/mount.acfs.bin: error while loading shared libraries: libhasgen11.so:
cannot open shared object file: No such file or directory[root@racnode2 ~]# /bin/mount -t acfs /dev/asm/docsvol1-300 /documents1/sbin/mount.acfs.bin: error while loading shared libraries: libhasgen11.so:
cannot open shared object file: No such file or directory
If you don't have the ORACLE_HOME environment variable set to the Oracle grid infrastructure home as explained in the prerequisites section to this guide, the mount command will fail as shown above. In order to mount the new cluster file system, the Oracle ASM ACFS binaries need access to certain shared libraries in the ORACLE_HOME for grid infrastructure. An easy workaround to get past this error is to set the ORACLE_HOME environment variable for grid infrastructure in the file /sbin/mount.acfs on all Oracle RAC nodes. The ORACLE_HOME should be set at the beginning of the file after the header comments as follows:
#!/bin/sh
#
# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
#ORACLE_HOME=/u01/app/11.2.0/gridORA_CRS_HOME=%ORA_CRS_HOME%
if [ ! -d $ORA_CRS_HOME ]; then
ORA_CRS_HOME=$ORACLE_HOME
fi
...
You should now be able to successfully mount the volume:
[root@racnode1 ~]# /bin/mount -t acfs /dev/asm/docsvol1-300 /documents1[root@racnode2 ~]# /bin/mount -t acfs /dev/asm/docsvol1-300 /documents1

Verify Mounted Cluster File System

To verify that the new cluster file system mounted properly, run the following mount command from all Oracle RAC nodes:

[root@racnode1 ~]# mount/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sdb1 on /local type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
domo:PUBLIC on /domo type nfs (rw,addr=192.168.1.121)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)/dev/asm/docsvol1-300 on /documents1 type acfs (rw)[root@racnode2 ~]# mount/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sdb1 on /local type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
domo:Public on /domo type nfs (rw,addr=192.168.1.121)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)/dev/asm/docsvol1-300 on /documents1 type acfs (rw)

Set Permissions for ACFS

With the new cluster file system now mounted on all Oracle RAC nodes, change the permissions to allow user access. For the purpose of this example, I want to grant the oracle user account and dba group read/write permissions. Run the following as root from only one node in the Oracle RAC:
[root@racnode1 ~]# chown oracle.dba /documents1[root@racnode1 ~]# chmod 775 /documents1
Test
Now let's perform a test to see if all of our hard work paid off.

Node 1
Log in to the first Oracle RAC node as the oracle user account and create a test file on the new cluster file system:

[oracle@racnode1 ~]$ iduid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

[oracle@racnode1 ~]$ echo "The Hunter Family: Jeff, Melody, and Alex" > /documents1/test.txt[oracle@racnode1 ~]$ ls -l /documents1total 72
drwxr-xr-x 5 root   root      4096 Nov 23 21:17 .ACFS/
drwx------ 2 root   root     65536 Nov 23 21:17 lost+found/
-rw-r--r-- 1 oracle oinstall    42 Nov 23 21:25 test.txt

Node 2

Log in to the second Oracle RAC node as the oracleuser account and verify the presence and content of the test file:
[oracle@racnode2 ~]$ iduid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

[oracle@racnode2 ~]$ ls -l /documents1total 72
drwxr-xr-x 5 root   root      4096 Nov 23 21:17 .ACFS/
drwx------ 2 root   root     65536 Nov 23 21:17 lost+found/
-rw-r--r-- 1 oracle oinstall    42 Nov 23 21:25 test.txt

[oracle@racnode2 ~]$ cat /documents1/test.txtThe Hunter Family: Jeff, Melody, and Alex
Oracle Enterprise Manager (OEM)
This section presents a second method that can be used to create an Oracle ASM cluster file system; namely, Oracle Enterprise Manager (OEM). Similar to the ASM Configuration Assistant (ASMCA), OEM provides a convenient graphical user interface for creating and maintaining ASM cluster file systems.

Create Mount Point
From each Oracle RAC node, create a directory that will be used to mount the new Oracle ACFS:
[root@racnode1 ~]# mkdir /documents2[root@racnode2 ~]# mkdir /documents2


转自:http://www.rampant-books.com/t_hunter_using_oracle_acfs_on_linux_part2.htm
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  acfs
相关文章推荐