GVKun编程网logo

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

1

本文将为您提供关于UsingtheOracleASMClusterFileSystem(OracleACFS)onLinux,PartOne的详细介绍,同时,我们还将为您提供关于$file=isset

本文将为您提供关于Using the Oracle ASM Cluster File System (Oracle ACFS) on Linux, Part One的详细介绍,同时,我们还将为您提供关于$file=isset($file) && $file?$file:''index''这段代码什么意思?、$file=isset($file) && $file?$file:''index''这段代码什么意思?该怎么处理、.asm 和 .asm.1 之间的区别?、ADVM/ACFS is not supported on this OS version: 'centos-release-7-6.centos.x86_64的实用信息。

本文目录一览:

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

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

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


Introduced with Oracle ASM 11g release 2,Oracle ASM Cluster File System (Oracle ACFS) is a general purpose POSIX compliant cluster file system implemented as part of Oracle Automatic Storage Management (Oracle ASM). Being POSIX compliant,all operating system utilities we use with ext3 and other file systems can also be used with Oracle ACFS given it belongs to the same family of related standards. Oracle ACFS extends the Oracle ASM architecture and is used to support many types of files which are typically maintained outside of the Oracle database. For example Oracle ACFS can be used to store BFILEs,database trace files,executables,report files and even general purpose files like image,text,video,and audio files. In addition,Oracle ACFS can be used as a shared file system for Oracle home binaries.

The features included with Oracle ACFS allow users to create,mount,and manage ACFS using familiar Linux commands. Oracle ACFS provides support for snapshots and the ability to dynamically resize existing file systems online using Oracle ASM Dynamic Volume Manager (ADVM).

Oracle ACFS Leverages Oracle ASM functionality that enables:

  • Oracle ACFS dynamic file system resizing

  • Maximized performance through direct access to Oracle ASM disk group storage

  • Balanced distribution of Oracle ACFS across Oracle ASM disk group storage for increased I/O parallelism

  • Data reliability through Oracle ASM mirroring protection mechanisms

While Oracle ACFS is useful for storing general purpose files,there are certain files that it is not meant for. For example,Oracle ASM (Traditional disk groups) is still the preferred storage manager for all database files because Oracle ACFS does not support directIO for file read and write operations in 11g release 2 (11.2). Oracle ASM was specifically designed and optimized to provide the best performance for database file types. In addition to Oracle database files,Oracle ACFS does not support files for the Oracle grid infrastructure home. Finally,Oracle ACFS does not support any Oracle files that can be directly stored in Oracle ASM. For example,SPFILE,flashback log files,control files,archived redo log files,the grid infrastructure OCR and voting disk,etc should be stored in Oracle ASM disk groups. The key point to remember is that Oracle ACFS is the preferred file manager for non-database files and is optimized for general purpose / customer files which are maintained outside of the Oracle database.

This article describes three ways to create an Oracle ASM Cluster File System in an Oracle 11g release 2 RAC database on the Linux operating environment:

  • ASM Configuration Assistant (ASMCA)

  • Oracle Enterprise Manager (OEM)

  • Command Line / sql

There is actually a fourth method that can be employed to create an Oracle ASM Cluster File System which is to use the ASMCMD command line interface. Throughout this guide,I'll demonstrate how to use the ASMCMD command line interface in place of sql where appropriate.

The Linux distribution used in this guide is CentOS 5.5. CentOS is a free Enterprise-class Linux distribution derived from the Red Hat Enterprise Linux (RHEL) source and aims to be 100% binary compatible. Although Centos 5 is equivalent to RHEL 5,the CentOS operating system is not supported by Oracle ASM Cluster File System. Refer to the workaround documented in the prerequisites section of this article if you are using CentOS or a similar Red Hat clone. (It is assumed that an Oracle RAC database is already installed,configured,and running. For help with that,please see my article with instructions on how to build an inexpensive two-node Oracle RAC 11g release 2 database,entitled "Building an Inexpensive Oracle RAC 11g R2 on Linux - (RHEL 5.5).")

ACFS Components

Before diving into the details on how to create and manage Oracle ASM Cluster File System,it may be helpful to first discuss the major components. The figure below shows the varIoUs components that make up Oracle ACFS and provides an illustration of the example configuration that will be created using this guide.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="414" height="472" alt="t_hunter_acfs_1.jpg">

Everything starts with an Oracle ASM disk group. An Oracle ASM disk group is made up of one or more disks shown in figure 1 as DOCSDG1. The next component is an Oracle ASM volume which is created within an Oracle ASM disk group. The example configuration illustrated above shows that we will be creating three volumes named docsvol1,docsvol2,and docsvol3 on the new disk group named DOCSDG1. Finally,we will be creating a cluster file system for each volume whose mount points will be /documents1,/documents2,and /documents3 respectively.

With Oracle ACFS,as long as there exists free space within the ASM disk group,any of the volumes can be dynamically expanded which means the file system gets expanded as a result. As I will demonstrate later in this article,expanding a volume / file system is an effortless process and can be performed online without the need to take any type of outage!

Oracle ASM Dynamic Volume Manager (ADVM)

Besides an Oracle ASM disk group,another key component to Oracle ACFS is the new Oracle ASM Dynamic Volume Manager (ADVM). ADVM provides volume management services and a standard driver interface to its client (ACFS,ext3,ext4,reiserfs,OCFS2,etc.). The ADVM services include functionality to create,resize,delete,enable,and disable dynamic volumes. An ASM dynamic volume is constructed out of an ASM file with an 'ASMVOL' type attribute to distinguish it from other ASM file types (i.e. DATAFILE,TEMPFILE,ONLINELOG,etc.):

ASMFileName/VolumeName/DeviceNameBytesFileType
---------------------------------------------------------------------------------------------------
+CRS/racnode-cluster/ASMParaMETERFILE/REGISTRY.253.7345446791,536ASMParaMETERFILE
+CRS/racnode-cluster/OCRFILE/REGISTRY.255.734544681272,756,736OCRFILE
------------------
272,758,272+DOCSDG1[DOCSVOL1]/dev/asm/docsvol1-30034,359,738,368ASMVOL
+DOCSDG1[DOCSVOL2]/dev/asm/docsvol2-30034,368ASMVOL
+DOCSDG1[DOCSVOL3]/dev/asm/docsvol3-30026,843,545,600ASMVOL
------------------
95,563,022,336

+FRA/RACDB/ARCHIVELOG/2010_11_08/thread_1_seq_69.264.73456502942,991,616ARCHIVELOG
+FRA/RACDB/ARCHIVELOG/2010_11_08/thread_2_seq_2.266.73456568541,260,544ARCHIVELOG

<SNIP>+FRA/RACDB/ONLINELOG/group_3.259.73455487352,429,312ONLINELOG
+FRA/RACDB/ONLINELOG/group_4.260.73455487752,312ONLINELOG
------------------
12,227,537,408

+RACDB_DATA/RACDB/CONTROLFILE/Current.256.73455252518,890,752CONTROLFILE
+RACDB_DATA/RACDB/DATAFILE/EXAMPLE.263.734552611157,294,592DATAFILE
+RACDB_DATA/RACDB/DATAFILE/SYSAUX.260.7345525691,121,984,512DATAFILE
+RACDB_DATA/RACDB/DATAFILE/SYstem.259.734552539744,497,152DATAFILE
+RACDB_DATA/RACDB/DATAFILE/UNDOTBS1.261.734552595791,683,072DATAFILE
+RACDB_DATA/RACDB/DATAFILE/UNDOTBS2.264.734552619209,723,392DATAFILE
+RACDB_DATA/RACDB/DATAFILE/USERS.265.7345526275,251,072DATAFILE
+RACDB_DATA/RACDB/ONLINELOG/group_1.257.73455252952,312ONLINELOG
+RACDB_DATA/RACDB/ONLINELOG/group_2.258.73455253352,312ONLINELOG
+RACDB_DATA/RACDB/ONLINELOG/group_3.266.73455487152,312ONLINELOG
+RACDB_DATA/RACDB/ONLINELOG/group_4.267.73455487552,312ONLINELOG
+RACDB_DATA/RACDB/ParaMETERFILE/spfile.268.7345548794,608ParaMETERFILE
+RACDB_DATA/RACDB/TEMPFILE/TEMP.262.73455260593,331,456TEMPFILE
+RACDB_DATA/RACDB/spfileracdb.ora4,608ParaMETERFILE
------------------
3,352,382,464

Oracle ACFS and other supported 3rd party file systems can use Oracle ADVM as a volume management platform to create and manage file systems while Leveraging the full power and functionality of Oracle ASM features. A volume may be created in its own Oracle ASM disk group or can share space in an already existing disk group. Any number of volumes can be created in an ASM disk group. Creating a new volume in an Oracle ASM disk group can be performed using the ASM Configuration Assistant (ASMCA),Oracle Enterprise Manager (OEM),sql,or ASMCMD. For example:

asmcmd volcreate -G docsdg1 -s 20G docsvol3

Once a new volume is created in Linux,the ADVM device driver automatically creates a volume device on the OS that is used by clients to access the volume. These volumes may be used as block devices,may contain a file system such as ext3,OCFS2 or Oracle ACFS may used (as described in this guide) in which case the oracleacfs driver is also used for I/O to the file system. (Note that on the Linux platform,Oracle ADVM volume devices are created as block devices regardless of the configuration of the underlying storage in the Oracle ASM disk group. Do not use raw (8) to map Oracle ADVM volume block devices into raw volume devices.)

Under Linux,all volume devices are externalized to the OS and appear dynamically as special files in the /dev/asm directory. In this guide,we will use this OS volume device to create an Oracle ACFS:

$ ls -l /dev/asm
total 0
brwxrwx--- 1 root asmadmin 252,153601 Nov 28 13:49 docsvol1-300
brwxrwx--- 1 root asmadmin 252,153602 Nov 28 13:49 docsvol2-300
brwxrwx--- 1 root asmadmin 252,153603 Nov 28 13:56 docsvol3-300

$ /sbin/mkfs -t acfs -b 4k /dev/asm/docsvol3-300 -n "DOCSVOL3"


Oracle ADVM implements its own extent and striping algorithm to ensure the highest performance for general purpose files. An ADVM volume is four columns of 64MB extents and 128KB stripe width by default. ADVM writes data in 128KB stripes in a Round Robin fashion to each column before starting on the next four column extents. ADVM uses Dirty Region Logging (DRL) for mirror recovery after a node or instance failure. This DRL scheme requires a DRL file in the ASM disk group to be associated with each ASM dynamic volume.

ACFS Prerequisites

Install Oracle Grid Infrastructure

Oracle Grid Infrastructure 11g Release 2 (11.2) or higher is required for Oracle ACFS. Oracle grid infrastructure includes Oracle Clusterware,Oracle ASM,Oracle ACFS,Oracle ADVM,and driver resources software components,which are installed into the Grid Infrastructure Home using the Oracle Universal Installation (OUI) tool. Refer to this guide for instructions on how to configure Oracle grid infrastructure as part of an Oracle RAC 11g release 2 database install on Linux.

Log In as the Grid Infrastructure User

To perform the examples demonstrated in this guide,it is assumed that the Oracle grid infrastructure owner is 'grid'. If the Oracle grid infrastructure owner is 'oracle',then log in as the oracle account.

Log in as the Oracle grid infrastructure owner and switch to the Oracle ASM environment on node 1 of the RAC when performing non-root ACFS tasks:

[grid@racnode1 ~]$ id
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[grid@racnode1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? +ASM1
The Oracle base for ORACLE_HOME=/u01/app/11.2.0/grid is /u01/app/grid

[grid@racnode1 ~]$ dbhome
/u01/app/11.2.0/grid

[grid@racnode1 ~]$ echo $ORACLE_SID
+ASM1

Verify / Create ASM disk Group

After validating the Oracle grid infrastructure installation and logging in as the Oracle grid infrastructure owner (grid),the next step is to decide which Oracle ASM disk group should be used to create the Oracle ASM dynamic volume(s). The following sql demonstrates how to search the available ASM disk groups:

breakoninst_idskip1

columninst_idformat9999999heading"InstanceID"justifyleft
columnnameformata15heading"diskGroup"justifyleft
columntotal_mbformat999,999,999heading"Total(MB)"justifyright
columnfree_mbformat999,999heading"Free(MB)"justifyright
columnpct_freeformat999.99heading"%Free"justifyright

======================================================================

sql>selectinst_id,name,total_mb,free_mb,round((free_mb/total_mb)*100,2)pct_free
2fromgv$asm_diskgroup
3wheretotal_mb!=0
4orderbyinst_id,name;InstanceIDdiskGroupTotal(MB)Free(MB)%Free
---------------------------------------------------------
1CRS2,2051,80982.04
FRA33,88724,80273.19
RACDB_DATA33,88730,62390.37

2CRS2,62390.37

The same task can be accomplished using the ASMCMD command-line utility:

[grid@racnode1~]$asmcmdlsdg

If you find an existing Oracle ASM disk group that has adequate space,the Oracle ASM dynamic volume(s) can be created on that free space or a new ASM disk group can be created.

For the purpose of this guide,I will be creating a dedicated Oracle ASM disk group named DOCSDG1 which will be used for all three Oracle ASM dynamic volumes. I already setup a shared iSCSI volume and provisioned it using ASMLib. The ASMLib shared volume that will be used to create the new disk group is named ORCL:ASMDOCSVOL1.

[grid@racnode1~]$sqlplus/assysasmsql>selectpath,header_status,os_mbfromv$asm_disk;PATHNAMEHEADER_STATUSOS_MB
--------------------------------------------------------ORCL:ASMDOCSVOL1PROVISIONED98,303ORCL:CRSVOL1CRSVOL1MEMBER2,205
ORCL:DATAVOL1DATAVOL1MEMBER33,887
ORCL:FRAVOL1FRAVOL1MEMBER33,887

After identifying the ASMLib volume and verifying it is accessible from all Oracle RAC nodes,log in to the Oracle ASM instance and create the new disk group from one of the Oracle RAC nodes. After verifying the disk group was created,log in to the Oracle ASM instance on all other RAC nodes and mount the new disk group:

[grid@racnode1~]$sqlplus/assysasmsql>CREATEdisKgroupdocsdg1EXTERNALREDUNDANCYdisK'ORCL:ASMDOCSVOL1'SIZE98303M;diskgroupcreated.


sql>@asm_diskgroupsdiskGroupSectorBlockAllocation
NameSizeSizeUnitSizeStateTypetotalSize(MB)UsedSize(MB)Pct.Used
--------------------------------------------------------------------------------------
CRS5124,0961,048,576MOUNTEDEXTERN2,20539617.96DOCSDG15124,576MOUNTEDEXTERN98,30350.05FRA5124,576MOUNTEDEXTERN33,8879,08526.81
RACDB_DATA5124,8873,2649.63
-----------------------------
GrandTotal:168,28212,795


===============================================================================================


[grid@racnode2~]$sqlplus/assysasmsql>ALTERdisKgroupdocsdg1MOUNT;diskgroupaltered.


sql>@asm_diskgroupsdiskGroupSectorBlockAllocation
NameSizeSizeUnitSizeStateTypetotalSize(MB)UsedSize(MB)Pct.Used
--------------------------------------------------------------------------------------
CRS5124,795

VerifyOracleASMVolumeDriver

The operating environment used in this guide is CentOS 5.5 x86_64:

[root@racnode1~]#uname-a
Linuxracnode12.6.18-194.el5#1SMPFriApr214:58:14EDT2010x86_64x86_64x86_64GNU/Linux

On supported operating systems,the Oracle ACFS modules will be configured and the Oracle ASM volume driver started by default after installing Oracle grid infrastructure. With CentOS and other unsupported operating systems,a workaround is required to enable Oracle ACFS. One of the first tasks is to manually start the Oracle ASM volume driver:

[root@racnode1~]#/u01/app/11.2.0/grid/bin/acfsloadstart-sADVM/ACFSisnotsupportedoncentos-release-5-5.el5.centos

The Failed output from the above command should come as no surprise given Oracle ACFS is not supported on CentOS.

By default,the Oracle ACFS modules do not get installed on CentOS because it is not a supported operating environment. This section provides a simple,but unsupported,workaround to get Oracle ACFS working on CentOS. This workaround includes some of the manual steps that are required to launch the Oracle ASM volume driver when installing Oracle ACFS on a non-clustered system. (Note that the steps documented in this section serve as a workaround in order to setup Oracle ACFS on CentOS and is by no means supported by Oracle Corporation.Do not attempt these steps on a critical production environment. You have been warned!)

The following steps will need to be run from all nodes in an Oracle RAC database cluster as root.

First,make a copy of the following Perl module:

[root@racnode1 ~]#cd /u01/app/11.2.0/grid/lib
[root@racnode1 lib]#cp -p osds_acfslib.pm osds_acfslib.pm.orig

[root@racnode2 ~]#cd /u01/app/11.2.0/grid/lib
[root@racnode2 lib]#cp -p osds_acfslib.pm osds_acfslib.pm.orig

Next,edit the osds_acfslib.pm Perl module. Search for the string 'support this release' (which was line 278 in my case).

Replace

if(($release=~/enterprise-release-5/)||
($release=~/redhat-release-5/))

with

if(($release=~/enterprise-release-5/)||
($release=~/redhat-release-5/)||
($release=~/centos-release-5/))

This will get you past the supported version check; however,if you attempt to load the Oracle ASM volume driver from either Oracle RAC node,you get the following error:

[root@racnode1~]#/u01/app/11.2.0/grid/bin/acfsloadstart-sacfsload:ACFS-9129:ADVM/ACFSnotinstalled

To install ADVM/ACFS,copy the following kernel modules from the Oracle grid infrastructure home to the expected location:

[root@racnode1~]#mkdir/lib/modules/2.6.18-194.el5/extra/usm[root@racnode1~]#cd/u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5-x86_64/bin[root@racnode1bin]#cP*ko/lib/modules/2.6.18-194.el5/extra/usm/[root@racnode2~]#mkdir/lib/modules/2.6.18-194.el5/extra/usm[root@racnode2~]#cd/u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5-x86_64/bin[root@racnode2bin]#cP*ko/lib/modules/2.6.18-194.el5/extra/usm/

Once the kernel modules have been copied,we can verify the ADVM/ACFS installation by running the following from all Oracle RAC nodes:

[root@racnode1~]#cd/u01/app/11.2.0/grid/bin[root@racnode1bin]#./acfsdriverstate-orahome/u01/app/11.2.0/gridversionACFS-9205:OS/ADVM,ACFSinstalledversion=2.6.18-8.el5(x86_64)/090715.1[root@racnode2~]#cd/u01/app/11.2.0/grid/bin[root@racnode2bin]#./acfsdriverstate-orahome/u01/app/11.2.0/gridversionACFS-9205:OS/ADVM,ACFSinstalledversion=2.6.18-8.el5(x86_64)/090715.1

The next step is to record dependencies for the new kernel modules:

[root@racnode1~]#depmod[root@racnode2~]#depmod

Now,running acfsload start -s will complete without any further messages:

[root@racnode1~]#/u01/app/11.2.0/grid/bin/acfsloadstart-s[root@racnode2~]#/u01/app/11.2.0/grid/bin/acfsloadstart-s

Check that the modules were successfully loaded on all Oracle RAC nodes:

[root@racnode1~]#lsmod|greporacleoracleacfs8773204
oracleadvm2217608
oracleoks2768802oracleacfs,oracleadvm
oracleasm841361[root@racnode2~]#lsmod|greporacleoracleacfs8773204
oracleadvm2217608
oracleoks2768802oracleacfs,oracleadvm
oracleasm841361

Configure the Oracle ASM volume driver to load automatically on system startup on all Oracle RAC nodes. You will need to create an initialization script (/etc/init.d/acfsload) that contains the runlevel configuration and the acfsload command. Change the permissions on the /etc/init.d/acfsload script to allow it to be executed by root and then create links in the rc2.d,rc3.d,rc4.d,and rc5.d runlevel directories using 'chkconfig --add':

[root@racnode1~]#chkconfig--list|grepacfsload[root@racnode2~]#chkconfig--list|grepacfsload=======================================================

[root@racnode1~]#cat>/etc/init.d/acfsload<<EOF
#!/bin/sh

#chkconfig:23453021
#description:LoadOracleASMvolumedriveronsystemstartup

ORACLE_HOME=/u01/app/11.2.0/grid
exportORACLE_HOME

\$ORACLE_HOME/bin/acfsloadstart-s
EOF[root@racnode2~]#cat>/etc/init.d/acfsload<<EOF
#!/bin/sh

#chkconfig:23453021
#description:LoadOracleASMvolumedriveronsystemstartup

ORACLE_HOME=/u01/app/11.2.0/grid
exportORACLE_HOME

\$ORACLE_HOME/bin/acfsloadstart-s
EOF=======================================================

[root@racnode1~]#chmod755/etc/init.d/acfsload[root@racnode2~]#chmod755/etc/init.d/acfsload=======================================================

[root@racnode1~]#chkconfig--addacfsload[root@racnode2~]#chkconfig--addacfsload=======================================================

[root@racnode1~]#chkconfig--list|grepacfsloadacfsload0:off1:off2:on3:on4:on5:on6:off

[root@racnode2~]#chkconfig--list|grepacfsloadacfsload0:off1:off2:on3:on4:on5:on6:off

If the Oracle grid infrastructure 'ora.registry.acfs' resource does not exist,create it. This only needs to be performed from one of the Oracle RAC nodes:

[root@racnode1~]#su-grid-ccrs_stat|grepacfs[root@racnode2~]#su-grid-ccrs_stat|grepacfs=======================================================

[root@racnode1~]#/u01/app/11.2.0/grid/bin/crsctladdtypeora.registry.acfs.type\
-basetypeora.local_resource.type\
-file/u01/app/11.2.0/grid/crs/template/registry.acfs.type[root@racnode1~]#/u01/app/11.2.0/grid/bin/crsctladdresourceora.registry.acfs\
-attrACL=\'owner:root:rwx,pgrp:oinstall:r-x,other::r--\'\
-typeora.registry.acfs.type-f=======================================================

[root@racnode1~]#su-grid-ccrs_stat|grepacfsNAME=ora.registry.acfs
TYPE=ora.registry.acfs.type

[root@racnode2~]#su-grid-ccrs_stat|grepacfsNAME=ora.registry.acfs
TYPE=ora.registry.acfs.type

Next,copy the Oracle ACFS executables to /sbin and set the appropriate permissions. The Oracle ACFS executables are located in the GRID_HOME/install/usm/EL5/<ARCHITECTURE>/<KERNEL_VERSION>/<FULL_KERNEL_VERSION>/bin directory (12 files) and include any file without the*.koextension:

[root@racnode1~]#cd/u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5-x86_64/bin[root@racnode1bin]#cpacfs*/sbin;chmod755/sbin/acfs*[root@racnode1bin]#cpadvmutil*/sbin;chmod755/sbin/advmutil*[root@racnode1bin]#cpfsck.acfs*/sbin;chmod755/sbin/fsck.acfs*[root@racnode1bin]#cpmkfs.acfs*/sbin;chmod755/sbin/mkfs.acfs*[root@racnode1bin]#cpmount.acfs*/sbin;chmod755/sbin/mount.acfs*[root@racnode2~]#cd/u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5-x86_64/bin[root@racnode2bin]#cpacfs*/sbin;chmod755/sbin/acfs*[root@racnode2bin]#cpadvmutil*/sbin;chmod755/sbin/advmutil*[root@racnode2bin]#cpfsck.acfs*/sbin;chmod755/sbin/fsck.acfs*[root@racnode2bin]#cpmkfs.acfs*/sbin;chmod755/sbin/mkfs.acfs*[root@racnode2bin]#cpmount.acfs*/sbin;chmod755/sbin/mount.acfs*

As a final step,modify any of the Oracle ACFS shell scripts copied to the /sbin directory (above) to include the ORACLE_HOME for grid infrastructure. The successful execution of these scripts requires access to certain Oracle shared libraries that are found in the grid infrastructure Oracle home. Since many of the Oracle ACFS shell scripts will be executed as the root user account,the ORACLE_HOME environment variable will typically not be set in the shell and will result in the executable to fail. An easy workaround to get past this error is to set the ORACLE_HOME environment variable for the Oracle grid infrastructure home in the Oracle ACFS shell scripts on all Oracle RAC nodes. The ORACLE_HOME should be set at the beginning of the file after the header comments as shown in the following example:

#!/bin/sh
#
#copyright(c)2001,2009,Oracleand/oritsaffiliates.Allrightsreserved.
#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
...

Add the ORACLE_HOME environment variable for the Oracle grid infrastructure home as noted above to the following Oracle ACFS shell scripts on all Oracle RAC nodes:

  • /sbin/acfsdbg
  • /sbin/acfsutil
  • /sbin/advmutil
  • /sbin/fsck.acfs
  • /sbin/mkfs.acfs
  • /sbin/mount.acfs

Verify ASM disk Group Compatibility Level

The compatibility level for the Oracle ASM disk group must be at least 11.2 in order to create an Oracle ASM volume. From the Oracle ASM instance,perform the following checks:

sql>SELECTcompatibility,database_compatibility
2FROMv$asm_diskgroup
3WHEREname='DOCSDG1';COMPATIBILITYDATABASE_COMPATIBILITY
---------------------------------------
10.1.0.0.010.1.0.0.0

If the results show something other than 11.2 or higher (as the above example shows),we need to set the compatibility to at least 11.2 by issuing the following series of sql statements from the Oracle ASM instance:

[grid@racnode1~]$sqlplus/assysasmsql>ALTERdisKgroupdocsdg1SETATTRIBUTE'compatible.asm'='11.2';diskgroupaltered.


sql>ALTERdisKgroupdocsdg1SETATTRIBUTE'compatible.rdbms'='11.2';diskgroupaltered.


sql>ALTERdisKgroupdocsdg1SETATTRIBUTE'compatible.advm'='11.2';diskgroupaltered.

If you receive an error while attempting to set the 'compatible.advm' attribute,verify that the Oracle ASM volume driver is running:

sql>ALTERdisKgroupdocsdg1SETATTRIBUTE'compatible.advm'='11.2';ALTERdisKgroupdocsdg1SETATTRIBUTE'compatible.advm'='11.2'
*
ERRORatline1:
ORA-15032:notallalterationsperformed
ORA-15242:Couldnotsetattributecompatible.advm
ORA-15238:11.2isnotavalidvalueforattributecompatible.advm
ORA-15477:cannotcommunicatewiththevolumedriver

Verify the changes to the compatibility level:

sql>SELECTcompatibility,database_compatibility
2FROMv$asm_diskgroup
3WHEREname='DOCSDG1';COMPATIBILITYDATABASE_COMPATIBILITY
---------------------------------------
11.2.0.0.011.2.0.0.0

ASM Configuration Assistant (ASMCA)

This section includes step-by-step instructions on how to create an Oracle ASM cluster file system using the Oracle ASM Configuration Assistant (ASMCA). Note that at the time of this writing,ASMCA only supports the creation of volumes and file systems. Deleting an Oracle ASM volume or file system requires the command-line.

Create Mount Point

From each Oracle RAC node,create a directory that will be used to mount the new Oracle ACFS:

[root@racnode1~]#mkdir/documents1[root@racnode2~]#mkdir/documents1

Create ASM Cluster File System

As the Oracle grid infrastructure owner,run the ASM Configuration Assistant (asmca) from only one node in the cluster (racnode1 for example):

[grid@racnode1~]$asmca

The following are the screen names and responses with the ASM Configuration Assistant

disk Groups:When the Oracle ASM configuration assistant starts you are presented with the 'disk Groups' tab as shown here.


Volumes:Click on the 'Volumes' tab then click the[Create]button.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="875" height="525" alt="t_hunter_acfs_3.gif">

Create ASM Volume:Then create a new ASM volume by supplying a "Volume Name","disk Group Name",and "Size". For the purpose of this example,I will be creating a 32GB volume named "docsvol1" on the "DOCSDG1" ASM disk group. After verifying all values in this dialog are correct,click the[OK]button.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="600" height="250" alt="t_hunter_acfs_4.gif">

Volume Created:After the volume is created,ackNowledge the 'Volume: Creation' dialog. When returned to the "Volumes" tab,the "State" for the new ASM volume should beENABLEDfor all Oracle RAC nodes(i.e.'ENABLED(2 of 2)')..

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="875" height="525" alt="t_hunter_acfs_5.gif">

ASM Cluster File Systems:Click on the 'ASM Cluster File Systems' tab then click the[Create]button.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="875" height="525" alt="t_hunter_acfs_6.gif">

Create ASM Cluster File System:Verify that the newly created volume (DOCSVOL1) is selected in the 'Volume' list. Select the 'General Purpose File System' option. Enter the prevIoUsly created mount point directory (/documents1) or leave the suggested mount point. Select the 'Yes' option for 'Register MountPoint'. After verifying all values in this dialog are correct,click the[OK]button.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="650" height="550" alt="t_hunter_acfs_7.gif">

ASM Cluster File System Created:After the ASM Cluster File System is created,ackNowledge the 'ASM Cluster File System: Creation' dialog.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="322" height="245" alt="t_hunter_acfs_8.gif">

ASM Cluster File Systems:The newly created Oracle ASM cluster file system is Now listed under the 'ASM Cluster File Systems' tab. Note that the new clustered file system is not mounted. That will need to be performed manually on all Oracle RAC nodes as a privileged user (root) after exiting from the ASMCA. Exit the ASM Configuration Assistant by clicking the[Exit]button.

650) this.width=650;" border="0" src="http://img.jb51.cc/vcimg/static/loading.png" width="875" height="525" alt="t_hunter_acfs_9.gif">

Inpart twoof this installment,we will pick up on this process by mounting the new Oracle ASM cluster file system!

转自:http://www.rampant-books.com/t_hunter_using_oracle_acfs_on_linux_part1.htm

$file=isset($file) && $file?$file:''index''这段代码什么意思?

$file=isset($file) && $file?$file:''index''这段代码什么意思?

$file=isset($file) && $file?$file:''index'';
上面代码什么意思?最好能举个例子,上面实际执行了什么?


回复讨论(解决方案)

判断是否存在$file变量,如果存在则取值为$file 如果不存在则为index

? : 三目运算符
等价于
if(isset($file) && $file){
   $file=$file;
}else{
   $file=''index'';
}

? : 三元运算符 (?)问号前面是判断条件 如果条件为真则取:(冒号)前面的值 如果判断条件为假则取:(冒号)后面的值

$file=isset($file) && $file?$file:''index''这段代码什么意思?该怎么处理

$file=isset($file) && $file?$file:''index''这段代码什么意思?该怎么处理

$file=isset($file) && $file?$file:''index''这段代码什么意思?
$file=isset($file) && $file?$file:''index'';
上面代码什么意思?最好能举个例子,上面实际执行了什么?
------解决方案--------------------
判断是否存在$file变量,如果存在则取值为$file 如果不存在则为index
------解决方案--------------------
? : 三目运算符
等价于
if(isset($file) && $file){
   $file=$file;
}else{
   $file=''index'';
}
------解决方案--------------------
? : 三元运算符 (?)问号前面是判断条件 如果条件为真则取:(冒号)前面的值 如果判断条件为假则取:(冒号)后面的值

.asm 和 .asm.1 之间的区别?

.asm 和 .asm.1 之间的区别?

如何解决.asm 和 .asm.1 之间的区别?

我试图在 Fusion Autodesk 中打开一个保存为 .asm.1 文件的文件。 Fusion Autodesk 说它可以处理 .asm 文件,我很困惑,不知道有什么区别,或者是否有办法从 .asm.1 转换为 .asm 以便我可以在软件中处理这个文件?>

ADVM/ACFS is not supported on this OS version: 'centos-release-7-6.centos.x86_64

ADVM/ACFS is not supported on this OS version: 'centos-release-7-6.centos.x86_64

ADVM/ACFS is not supported on this OS version: ''centos-release-7-6.centos.x86_64

从Oracle11.2开始,ASM不仅是一个磁盘组,他还提供了了一个卷管理器,称为ADVM(asm dynamic volume manager)。ADVM向用户提供卷管理服务,并提供标准的磁盘设备驱动程序。利用ADVM,可以在卷组中创建一个或多个卷,每个卷对应操作系统中的一个设备文件,这些卷是可以动态扩展的,就像操作系统中的卷或者利用第三方软件创建的卷一样,应用程序也可以对ADVM卷中的数据进行读写操作。
在ADVM卷中可以创建ACFS文件系统,ACFS是一种跨平台的、可扩展的集群文件系统,多个节点可以同时访问asfs中的文件。ACFS不仅可以作为oracle数据库软件的安装路径,还可以用来存储数据库中的警告文件和跟踪文件,还可以存储诸如视频、声音、图像、文本等类型的文件。

但是在CentOS5.8上面安装rac的时候,却发现ADVM/ACFS is not supported on this OS version: ''centos-release-7-6.centos.x86_64(同样适用于单机环境的asm安装,在安装grid的最后执行root.sh的时候出现的。)

这是由于oracle软件对系统版本做了限制,解决方法如下:

可以看到报错:

1 [root@rac1 ~]# /opt/app/grid/bin/acfsload start -s
2 ADVM/ACFS is not supported on centos-release-5-8.el5.centos

 

1、备份要修改的文件,两个节点都要做

1 [root@rac1 ~]# cd /opt/app/grid/lib
2 [root@rac1 lib]# cp -p osds_acfslib.pm osds_acfslib.pm.orig

 

2、修改文件osds_acfslib.pm,同样两个节点都做

1 replace
2 
3 if (($release =~ /enterprise-release-5/) ||
4 ($release =~ /redhat-release-5/))
5 with
6 
7 if (($release =~ /enterprise-release-5/) ||
8 ($release =~ /redhat-release-5/) ||
9 ($release =~ /centos-release-5/))

 

3、把支持ADVM/ACFS相关的module放在系统module目录下,两个节点都做

1 [root@rac1 ~]# mkdir /lib/modules/2.6.18-348.12.1.el5/extra/usm
2 [root@rac1 ~]# cd /u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5-x86_64/bin/
3 [root@rac1 bin]# cp *ko /lib/modules/2.6.18-348.12.1.el5/extra/usm/

 

4、安装ADVM/ACFS驱动

 1 [root@rac1 ~]# cd /opt/app/grid/bin
 2 [root@rac1 bin]# ./acfsdriverstate -orahome /opt/app/grid version
 3 acfsdriverstate: ACFS-9129: ADVM/ACFS not installed
 4 
 5 安装网上说的方法无法安装,下面尝试以下安装方式:
 6 
 7 [root@rac1 ~]# cd /opt/app/grid/bin
 8 
 9 [root@rac1 bin]#./acfsroot install
10 
11 CRS-10001:ACFS-9300: ADVM/ACFS distribution files found.
12 CRS-10001:ACFS-9307: Installing requested ADVM/ACFS software.
13 CRS-10001:ACFS-9308: Loading installed ADVM/ACFS drivers.
14 CRS-10001:ACFS-9321: Creating udev for ADVM/ACFS.
15 CRS-10001:ACFS-9323: Creating module dependencies – this may take some time.
16 CRS-10001:ACFS-9327: Verifying ADVM/ACFS devices.
17 CRS-10001:ACFS-9309: ADVM/ACFS installation correctness verified.

 

说明安装成功。

5、启动服务

1 [root@rac1 ~]# /opt/app/grid/bin/acfsload start -s
2 
3 [root@rac2 ~]# /opt/app/grid/bin/acfsload start -s

 

6、在所有的节点上,检查kernel是否成功的加载了相关的驱动

1 [root@rac1 ~]# lsmod | grep oracle
2 oracleacfs 877320 4
3 oracleadvm 221760 8
4 oracleoks 276880 2 oracleacfs,oracleadvm
5 oracleasm 84136 1

 

posted on 2020-06-12 21:05  数据与人文  阅读(423)  评论(0)  编辑  收藏

关于Using the Oracle ASM Cluster File System (Oracle ACFS) on Linux, Part One的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于$file=isset($file) && $file?$file:''index''这段代码什么意思?、$file=isset($file) && $file?$file:''index''这段代码什么意思?该怎么处理、.asm 和 .asm.1 之间的区别?、ADVM/ACFS is not supported on this OS version: 'centos-release-7-6.centos.x86_64等相关知识的信息别忘了在本站进行查找喔。

本文标签: