Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the relevant knowledge points of Oracle ASM Filter Driver

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the relevant knowledge points of Oracle ASM Filter Driver". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the relevant knowledge points of Oracle ASM Filter Driver"?

Oracle ASM Filter Driver (Oracle ASMFD) eliminates the need for Oracle ASM to rebind disk devices after each system restart to simplify the configuration and management of disk devices. Oracle ASM Filter Driver (Oracle ASMFD) is a kernel module built into the IO path of the Oracle ASM disk. Oracle ASM uses filter driver to verify write IO operations to Oracle ASM disks. Oracle ASM Filter Driver rejects any invalid IO requests. This operation eliminates the damage to disks and files in the disk group due to accidental overwriting of Oracle ASM disks. For example, Oracle ASM Filter Driver filters out all non-Oracle IO operations that may accidentally overwrite the disk. Since Oracle 12.2, Oracle ASM Filter Driver (Oracle ASMFD) cannot be installed when Oracle ASMLIB is installed on the system. If you want to install and configure Oracle ASMFD, you must first uninstall Oracle ASMLIB. ASMFD of Oracle 12.2 does not support extended partition tables.

Configure Oracle ASM Filter Driver

You can permanently configure Oracle ASM Filter Driver (Oracle ASMFD) on disk devices when you install Oracle Grid Infrastructure or after you install Oracle Grid Infrastructure.

Configure Oracle ASM Filter Driver when installing Oracle Grid Infrastructure

When installing Oracle Grid Infrastructure, you can choose to enable automatic installation and configuration of Oracle ASM Filter Driver. If udev is not used on the system where Oracle Grid Infrastructure is installed, you can do the following to prepare the disk for Oracle ASMFD before installing Oracle Grid Infrastructure. The following actions must be performed after the Oracle Grid Infrastructure package must be unzipped in the Oracle Grid Infrastructure home directory, but before ASMFD is configured.

1. To configure the shared disk using Oracle ASM Filter Driver, set the environment variable $ORACLE_HOME to the Grid Home directory and the environment variable $ORACLE_BASE to the temporary directory with the root user

# set ORACLE_HOME=/u01/app/oracle/12.2.0/grid# set ORACLE_BASE=/tmp

The ORACLE_BASE variable is set to a temporary directory to avoid creating diagnostics or trace files in the Grid Home directory before installing Oracle Grid Infrastructure. Before you do the following, make sure you execute the command in the $ORACLE_HOME/bin directory.

two。 Use the ASMCMD afd_label command to prepare the disk for Oracle ASM Filter Driver.

# asmcmd afd_label DATA1 / dev/disk1a-- init

3. Use the ASMCMD afd_lslbl command to verify that the disk has been marked for use by Oracle ASMFD

# asmcmd afd_lslbl / dev/disk1a

View a disk

[rootd@cs1]. / asmcmd afd_lslbl / dev/asmdisk01----Label Duplicate Path====CRS2 / dev/asmdisk01

List all disks that have been marked for use by Oracle ASMFD

[grid@jytest1] $asmcmd afd_lslbl-Label Duplicate Path====CRS1 / dev/asmdisk02CRS2 / dev/asmdisk01DATA1 / dev/asmdisk03DATA2 / dev/asmdisk04FRA1 / dev/asmdisk07TEST1 / dev/asmdisk05TEST2 / dev/asmdisk06

4. Clear the variable ORACLE_BASE when the disk is ready for Oracle ASMFD

# unset ORACLE_BASE

5. Run the installation script (gridSetup.sh) to install Oracle Grid Infrastructure and enable Oracle ASM Filter Driver configuration.

Configure Oracle ASM Filter Driver after installing Oracle Grid Infrastructure

If the configuration Oracle ASMFD is not enabled when you install Grid Infrastructure, you can use Oracle ASMFD to manually configure the Oracle ASM device.

Configure Oracle ASM for the Oracle Grid Infrastructure Clusterware environment as follows:

1. Update the Oracle ASM disk discovery path with the Oracle Grid Infrastructure user to enable Oracle ASMFD to discover the disk.

First check the current Oracle ASM disk discovery path and update

[grid@cs1 ~] $asmcmd dsgetparameter:/dev/sd*, / dev/asm* profile:/dev/sd*,/dev/asm*

Add 'AFD:*' to the Discovery disk path

[grid@cs1 ~] $asmcmd dsset 'dev/sd*','/dev/asm*','AFD:*' [grid@cs1 ~] $asmcmd dsgetparameter:dev/sd*, / dev/asm*,AFD:* profile:dev/sd*,/dev/asm*,AFD:*

two。 Use Oracle Grid Infrastructure users to get the node list and roles in cluster

[grid@cs1 ~] $olsnodes-acs1 Hubcs2 Hub

3. On each Hub and Leaf node, you can do the following in rollback or non-rollback mode

3.1 stop Oracle Grid Infrastructure as root user

# $ORACLE_HOME/bin/crsctl stop crs

If the command returns an error, execute the following command to force Oracle Grid Infrastructure to stop

# $ORACLE_HOME/bin/crsctl stop crs-f

3.2 configure Oracle ASMFD as root users at the node level

# $ORACLE_HOME/bin/asmcmd afd_configure

3.3 verify the status of Oracle ASMFD with Oracle Grid Infrastructure users

[grid@cs2 ~] $asmcmd afd_stateASMCMD-9526: The AFD state is' LOADED' and filtering is' ENABLED' on host 'cs2.jy.net'

3.4 launch Oracle Clusterware stack as a root user

# $ORACLE_HOME/bin/crsctl start crs

3.5 use Oracle Grid Infrastructure users to set the Oracle ASMFD discovery disk path as the original Oracle ASM disk discovery path retrieved in step 3.1

[grid@cs1 ~] $asmcmd dsset 'dev/sd*','/dev/asm*'

Migrate disk groups that do not contain OCR or vote files to Oracle ASMFD

1. As the Oracle Grid Infrastructure user, do the following

two。 List disk groups that already exist

[grid@cs2] $asmcmd lsdgState Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files NameMOUNTED EXTERN N 512512 4096 4194304 40960 1544 0 1544 0 Y CRS/MOUNTED EXTERN N 512512 4096 4194304 40960 860 0 860 0 N DATA/MOUNTED NORMAL N 512 512 4096 4194304 40960 40704 0 20352 0 N DN/

3. List related disks

[grid@cs2 ~] $asmcmd lsdsk-G DNPath/dev/asmdisk03/dev/asmdisk05

From the query below, you can see that the label fields of / dev/asmdisk03 and / dev/asmdisk05 are empty.

SQL > select group_number,disk_number,name,label,path from v$asm_disk GROUP_NUMBER DISK_NUMBER NAME LABEL PATH -0 CRS2 / dev/asmdisk01 01 CRS1 / dev/asmdisk02 02 DATA1 / dev/asmdisk04 3 0 DN_0000 / dev/asmdisk03 3 1 DN_0001 / dev/asmdisk05 1 0 CRS1 CRS1 AFD:CRS1 2 0 DATA1 DATA1 AFD:DATA1 1 1 CRS2 CRS2 AFD:CRS2

4. Check to see if Oracle ASM is active

[grid@cs2 ~] $srvctl status asmASM is running on cs1,cs2

5. Stop database and dismount disk groups on all nodes

[grid@cs2] $srvctl stop diskgroup-diskgroup DN-f

6. Execute the following command on each Hub node to mark all existing disks in the disk group

[grid@cs2] $asmcmd afd_label DN1 / dev/asmdisk03-- migrate [grid@cs2 ~] $asmcmd afd_label DN2 / dev/asmdisk05-- migrate

7. Scan disks on all Hub nodes

[grid@cs1 ~] $asmcmd afd_ scan [grid @ cs2 ~] $asmcmd afd_scan

8. Start the database on all nodes and mount the disk group

[grid@cs2 ~] $srvctl start diskgroup-diskgroup DN

From the query below, you can see that the label fields of / dev/asmdisk03 and / dev/asmdisk05 are displayed as DN1 and DN2, respectively.

SQL > select group_number,disk_number,name,label,path from v$asm_disk GROUP_NUMBER DISK_NUMBER NAME LABEL PATH -0 CRS2 / dev/asmdisk01 01 DN2 / dev/asmdisk05 0 2 DN1 / dev/asmdisk03 03 CRS1 / dev/asmdisk02 04 DATA1 / dev/asmdisk04 1 1 CRS2 CRS2 AFD:CRS2 2 0 DATA1 DATA1 AFD:DATA1 1 0 CRS1 CRS1 AFD:CRS1 3 0 DN_0000 DN1 AFD:DN1 3 1 DN_0001 DN2 AFD:DN2

You can now remove the previous udev rules file. Of course, this should run on all nodes. In the future, if the server restarts again, AFD will take over completely.

[root@cs1 bin] # cd / etc/udev/rules.d/ [root@cs1 rules.d] # ls-lrttotal 16 Murray RW Murray. 1 root root 709 Mar 6 2015 70 Khokashi root root-1 root root 1416 Mar 9 12:23 99MYMY asmdevices.rulesRWMUFUR Quan-1 root root 224 Mar 9 15:52 53afd.rulesRWMURAFT-1 root root RWMQ R9 15:54 55-usm.rules [root@cs1 rules.d] # mv 99-my-asmdevices.rules 99-my-asmdevices.rules.bak [root@cs1 rules. D] # cat 53-afd.rules## AFD devicesKERNEL== "oracleafd/.*" OWNER= "grid", GROUP= "asmadmin", MODE= "0775" KERNEL== "oracleafd/*", OWNER= "grid", GROUP= "asmadmin", MODE= "0775" KERNEL== "oracleafd/disks/*", OWNER= "grid", GROUP= "asmadmin MODE= "0664" [root@cs1 rules.d] # ls-l / dev/oracleafd/diskstotal 20 grid oinstall 15 Aug 30 14:30 CRS1-rwxrwx--- 1 grid oinstall 15 Aug 30 14:30 CRS2-rwxrwx--- 1 grid oinstall 15 Aug 30 14:30 DATA1-rwxrwx--- 1 grid oinstall 15 Aug 30 17:42 DN1-rwxrwx--- 1 grid oinstall 15 Aug 30 17:42 DN2 [root@cs2 bin] # cd / etc/udev/rules.d/ [root@cs2 rules .d] # ls-lrttotal 16 RW Murray. 1 root root 709 Mar 6 2015 70 Khokashi root root-1 root root 1416 Mar 9 12:23 99MYMY asmdevices.rulesRWMUFUR Quan-1 root root 224 Mar 9 15:52 53afd.rulesRWMURAFT-1 root root RWMQ R9 15:54 55-usm.rules [root@cs2 rules.d] # mv 99-my-asmdevices.rules 99-my-asmdevices.rules.bak [root@cs2 rules. D] # cat 53-afd.rules## AFD devicesKERNEL== "oracleafd/.*" OWNER= "grid", GROUP= "asmadmin", MODE= "0775" KERNEL== "oracleafd/*", OWNER= "grid", GROUP= "asmadmin", MODE= "0775" KERNEL== "oracleafd/disks/*", OWNER= "grid", GROUP= "asmadmin MODE= "0664" [root@cs2 rules.d] # ls-l / dev/oracleafd/diskstotal 20 grid oinstall 15 Aug 30 14:30 CRS1-rwxrwx--- 1 grid oinstall 15 Aug 30 14:30 CRS2-rwxrwx--- 1 grid oinstall 15 Aug 30 14:30 DATA1-rwxrwx--- 1 grid oinstall 15 Aug 30 17:42 DN1-rwxrwx--- 1 grid oinstall 15 Aug 30 17:42 DN2

In fact, AFD is also using udev

Migrate disk groups containing OCR or vote files to Oracle ASMFD

1. List disk groups containing OCR and vote files as root users

[root@cs1 ~] # cd / u01/app/product/12.2.0/crs/bin [root@cs1 bin] # sh ocrcheck-configOracle Cluster Registry configuration is: Device/File Name: + CRS Device/File Name: + DATA [root@cs1 bin] # sh crsctl query css votedisk## STATE File Universal Id File Name Disk group 1. ONLINE 750a78e1ae984fcdbfb4dbf44d337a77 (/ dev/asmdisk02) [CRS] Located 1 voting disk (s).

two。 Lists disks associated with disk groups as Oracle Grid Infrastructure users

[grid@cs2 ~] $asmcmd lsdsk-G CRSPath/dev/asmdisk01/dev/asmdisk02

3. Stop the database and Oracle Clusterware on all nodes as the root user

[root@cs1 bin] #. / crsctl stop cluster-allCRS-2673: Attempting to stop 'ora.crsd' on' cs2'CRS-2673: Attempting to stop 'ora.crsd' on' cs1'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server' cs2'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server' cs1'CRS-2673: Attempting to stop 'ora.cs.db' on' cs1'CRS-2673: Attempting to stop 'ora.qosmserver' on' cs2'CRS-2673: Attempting to stop 'ora.cs.db' on' cs2'CRS-2673: Attempting to stop 'ora.chad' on' cs2'CRS-2673: Attempting to stop 'ora.gns' on' cs2'CRS-2677: Stop of 'ora.gns' on' cs2' succeededCRS-2677: Stop of 'ora.cs.db' on' cs2' succeededCRS-2673: Attempting to stop 'ora.CRS.dg' on' cs2'CRS-2673: Attempting to stop 'ora.DATA.dg' on' cs2'CRS-2673: Attempting to Stop 'ora.LISTENER.lsnr' on' cs2'CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on' cs2'CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on' cs2'CRS-2673: Attempting to stop 'ora.cvu' on' cs2'CRS-2673: Attempting to stop 'ora.gns.vip' on' cs2'CRS-2677: Stop of 'ora.cs.db' on' cs1' succeededCRS-2677: Stop of 'ora.CRS.dg' on' cs2' SucceededCRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on' cs1'CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on' cs1'CRS-2677: Stop of 'ora.DATA.dg' on' cs2' succeededCRS-2673: Attempting to stop 'ora.asm' on' cs2'CRS-2677: Stop of 'ora.asm' on' cs2' succeededCRS-2677: Stop of 'ora.LISTENER.lsnr' on' cs1' succeededCRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'cs2'CRS-2677: Stop of' ora.LISTENER_SCAN1.lsnr' on 'cs1' succeededCRS-2673: Attempting to stop' ora.scan1.vip' on 'cs1'CRS-2677: Stop of' ora.LISTENER.lsnr' on 'cs2' succeededCRS-2677: Stop of' ora.LISTENER_SCAN3.lsnr' on 'cs2' succeededCRS-2677: Stop of' ora.LISTENER_SCAN2.lsnr' on 'cs2' succeededCRS-2677: Stop of' ora.scan1.vip' on 'cs1' succeededCRS-2673: Attempting to stop' Ora.cs2.vip' on 'cs2'CRS-2673: Attempting to stop' ora.scan2.vip' on 'cs2'CRS-2673: Attempting to stop' ora.scan3.vip' on 'cs2'CRS-2677: Stop of' ora.gns.vip' on 'cs2' succeededCRS-2677: Stop of' ora.scan3.vip' on 'cs2' succeededCRS-2677: Stop of' ora.cs2.vip' on 'cs2' succeededCRS-2677: Stop of' ora.qosmserver' on 'cs2' succeededCRS-2677: Stop of' ora .scan2.vip'on 'cs2' succeededCRS-2677: Stop of' ora.ASMNET1LSNR_ASM.lsnr' on 'cs2' succeededCRS-2673: Attempting to stop' ora.chad' on 'cs1'CRS-2677: Stop of' ora.cvu' on 'cs2' succeededCRS-2677: Stop of' ora.chad' on 'cs2' succeededCRS-2673: Attempting to stop' ora.ons' on 'cs2'CRS-2677: Stop of' ora.ons' on 'cs2' succeededCRS-2673: Attempting to stop' ora.net1.network' on 'cs2'CRS-2677: Stop of' ora.net1.network' on 'cs2' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on' cs2' has completedCRS-2677: Stop of 'ora.crsd' on' cs2' succeededCRS-2673: Attempting to stop 'ora.ctssd' on' cs2'CRS-2673: Attempting to stop 'ora.evmd' on' cs2'CRS-2673: Attempting to stop 'ora.storage' on' cs2'CRS-2677: Stop of 'ora.storage' on' cs2' succeededCRS-2673: Attempting To stop 'ora.asm' on' cs2'CRS-2677: Stop of 'ora.ctssd' on' cs2' succeededCRS-2677: Stop of 'ora.evmd' on' cs2' succeededCRS-2677: Stop of 'ora.chad' on' cs1' succeededCRS-2673: Attempting to stop 'ora.mgmtdb' on' cs1'CRS-2677: Stop of 'ora.mgmtdb' on' cs1' succeededCRS-2673: Attempting to stop 'ora.MGMTLSNR' on' cs1'CRS-2673: Attempting to stop 'ora.CRS.dg' on' cs1 'CRS-2673: Attempting to stop' ora.DATA.dg' on 'cs1'CRS-2677: Stop of' ora.CRS.dg' on 'cs1' succeededCRS-2677: Stop of' ora.DATA.dg' on 'cs1' succeededCRS-2673: Attempting to stop' ora.asm' on 'cs1'CRS-2677: Stop of' ora.MGMTLSNR' on 'cs1' succeededCRS-2673: Attempting to stop' ora.cs1.vip' on 'cs1'CRS-2677: Stop of' ora.cs1.vip' on 'cs1' succeededCRS -2677: Stop of 'ora.asm' on' cs2' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on' cs2'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on' cs2' succeededCRS-2673: Attempting to stop 'ora.cssd' on' cs2'CRS-2677: Stop of 'ora.cssd' on' cs2' succeededCRS-2677: Stop of 'ora.asm' on' cs1' succeededCRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on' cs1'CRS -2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on' cs1' succeededCRS-2673: Attempting to stop 'ora.ons' on' cs1'CRS-2677: Stop of 'ora.ons' on' cs1' succeededCRS-2673: Attempting to stop 'ora.net1.network' on' cs1'CRS-2677: Stop of 'ora.net1.network' on' cs1' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'cs1' has completedCRS-2677: Stop of' ora.crsd' on 'cs1' succeededCRS-2673: Attempting to stop 'ora.ctssd' on' cs1'CRS-2673: Attempting to stop 'ora.evmd' on' cs1'CRS-2673: Attempting to stop 'ora.storage' on' cs1'CRS-2677: Stop of 'ora.storage' on' cs1' succeededCRS-2673: Attempting to stop 'ora.asm' on' cs1'CRS-2677: Stop of 'ora.ctssd' on' cs1' succeededCRS-2677: Stop of 'ora.evmd' on' cs1' succeededCRS-2677: Stop of 'ora.asm' on' cs1' SucceededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on' cs1'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on' cs1' succeededCRS-2673: Attempting to stop 'ora.cssd' on' cs1'CRS-2677: Stop of 'ora.cssd' on' cs1' succeeded

4. Execute the following command as the Oracle Grid Infrastructure user to mark the disks in the disk group on each Hub node

[grid@cs2 ~] $asmcmd afd_label DN1 / dev/asmdisk03 [grid@cs2 ~] $asmcmd afd_label DN2 / dev/asmdisk05

5. Execute the following command as the Oracle Grid Infrastructure user to rescan each Hub node

[grid@cs1 ~] $asmcmd afd_ scan [grid @ cs2 ~] $asmcmd afd_scan

6. Enable Oracle Clusterware stack and mount OCR and vote file disks and databases on all nodes as root user

[root@cs1 bin] # / crsctl start cluster-allCRS-2672: Attempting to start 'ora.cssdmonitor' on' cs1'CRS-2672: Attempting to start 'ora.evmd' on' cs1'CRS-2672: Attempting to start 'ora.cssdmonitor' on' cs2'CRS-2672: Attempting to start 'ora.evmd' on' cs2'CRS-2676: Start of 'ora.cssdmonitor' on' cs1' succeededCRS-2672: Attempting to start 'ora.cssd' on' cs1'CRS-2672: Attempting to start 'ora.diskmon 'on' cs1'CRS-2676: Start of' ora.diskmon' on' cs1' succeededCRS-2676: Start of 'ora.evmd' on' cs1' succeededCRS-2676: Start of' ora.cssdmonitor' on' cs2' succeededCRS-2672: Attempting to start 'ora.cssd' on' cs2'CRS-2672: Attempting to start' ora.diskmon' on' cs2'CRS-2676: Start of 'ora.diskmon' on' cs2' succeededCRS-2676: Start of' ora.evmd' on' cs2' succeededCRS-2676: Start of 'ora .cssd'on 'cs1' succeededCRS-2672: Attempting to start' ora.ctssd' on 'cs1'CRS-2672: Attempting to start' ora.cluster_interconnect.haip' on 'cs1'CRS-2676: Start of' ora.cssd' on 'cs2' succeededCRS-2672: Attempting to start' ora.ctssd' on 'cs2'CRS-2672: Attempting to start' ora.cluster_interconnect.haip' on 'cs2'CRS-2676: Start of' ora.ctssd' on 'cs1' succeededCRS-2676: Start of' ora.ctssd' On 'cs2' succeededCRS-2676: Start of' ora.cluster_interconnect.haip' on 'cs1' succeededCRS-2672: Attempting to start' ora.asm' on 'cs1'CRS-2676: Start of' ora.cluster_interconnect.haip' on 'cs2' succeededCRS-2672: Attempting to start' ora.asm' on 'cs2'CRS-2676: Start of' ora.asm' on 'cs2' succeededCRS-2672: Attempting to start' ora.storage' on 'cs2'CRS-2676: Start of' ora.asm' on 'cs1' SucceededCRS-2672: Attempting to start 'ora.storage' on' cs1'CRS-2676: Start of 'ora.storage' on' cs1' succeededCRS-2672: Attempting to start 'ora.crsd' on' cs1'CRS-2676: Start of 'ora.crsd' on' cs1' succeededCRS-2676: Start of 'ora.storage' on' cs2' succeededCRS-2672: Attempting to start 'ora.crsd' on' cs2'CRS-2676: Start of 'ora.crsd' on' cs2' succeeded

Determine whether Oracle ASM Filter Driver has been configured

You can determine whether the SYS_ASMFD_PROPERTIES is configured by judging the AFD_STATE parameter value of the SYS_ASMFD_PROPERTIES of the Oracle ASMFD instance. You can also use the ASMCMD afd_state command to check the status of Oracle ASMFD

[grid@cs1 ~] $asmcmd afd_stateASMCMD-9526: The AFD state is' LOADED' and filtering is' DISABLED' on host 'cs1.jy.net' [grid@cs2 ~] $asmcmd afd_stateASMCMD-9526: The AFD state is' LOADED' and filtering is' ENABLED' on host 'cs2.jy.net'

The following query indicates that Oracle ASMFD is not configured if the AFD_STATE parameter value is equal to NOT AVAILABLE

SQL > select sys_context ('SYS_ASMFD_PROPERTIES','AFD_STATE') from dual;SYS_CONTEXT (' SYS_ASMFD_PROPERTIES','AFD_STATE')-CONFIGURED

Set the AFD_DISKSTRING parameter of Oracle ASM Filter Driver

The AFD_DISKSTRING parameter specifies the Oracle ASMFD disk discovery path to identify the disks managed by Oracle ASMFD. You can also use the ASMCMD afd_dsset and afd_dsget commands to set and display AFD_DISKSTRING parameters:

[grid@cs1 ~] $asmcmd afd_dsset'/ dev/sd*','/dev/asm*','AFD:*' [grid@cs2 ~] $asmcmd afd_dsset'/ dev/sd*','/dev/asm*','AFD:*' [grid@cs1 ~] $asmcmd dsgetparameter:dev/sd*, / dev/asm*,AFD:* profile:dev/sd*,/dev/asm*,AFD:* [grid@cs2 ~] $asmcmd dsgetparameter:dev/sd*, / dev/asm* AFD:*profile:dev/sd*,/dev/asm*,AFD:*

You can use the alter system statement to set the AFD_DISKSTRING. The identity has been created in the disk header to identify the disk by Oracle ASMFD disk discovery path

SQL > ALTER SYSTEM AFD_DISKSTRING SET 'dev/sd*','/dev/asm*','AFD:*';System altered.SQL > SELECT SYS_CONTEXT (' SYS_ASMFD_PROPERTIES', 'AFD_DISKSTRING') FROM DUAL SYS_CONTEXT ('SYS_ASMFD_PROPERTIES','AFD_DISKSTRING')-dev/sd*,/dev/asm*,AFD:*

Set Oracle ASM ASM_DISKSTRING parameters for Oracle ASM Filter Driver disks

You can update the Oracle ASM disk discovery path to add or remove the Oracle ASMFD disk identification name to the ASM_DISKSTRING parameter, using the alter system statement or the asmcmd dsset command

SQL > show parameter asm_diskstringNAME TYPE VALUE -asm_diskstring string dev/sd* / dev/asm*, AFD:* [grid@cs1 ~] $asmcmd dsset 'dev/sd*','/dev/asm*','AFD:*' [grid@cs2 ~] $asmcmd dsset' dev/sd*','/dev/asm*','AFD:*'

Test Filter function

First check whether the filter function is enabled.

[grid@cs1 ~] $asmcmd afd_stateASMCMD-9526: The AFD state is' LOADED' and filtering is' ENABLED' on host 'cs1.jy.net' [grid@jytest1 ~] $asmcmd afd_lsdsk -Label Filtering Path====CRS1 ENABLED / dev/asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk03DATA2 ENABLED / dev/asmdisk04FRA1 ENABLED / dev/asmdisk07TEST1 ENABLED / Dev/asmdisk05TEST2 ENABLED / dev/asmdisk06

The above results show that the filter function has been enabled. If you want to disable the filter function, execute asmcmd afd_filter-d

[grid@cs1] $asmcmd afd_filter-d [grid@cs1 ~] $asmcmd afd_stateASMCMD-9526: The AFD state is' LOADED' and filtering is' ENABLED' on host 'jytest1.jydba.net' [grid@cs1 ~] $asmcmd afd_lsdskThere are no labelled devices.

If you want to enable the filter function to execute asmcmd afd_filter-e

[grid@jytest1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / dev / asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk03DATA2 ENABLED / dev/asmdisk04FRA1 ENABLED / dev/asmdisk07TEST1 ENABLED / dev/asmdisk05TEST2 ENABLED / dev/asmdisk06

First read the disk head of the AFD:TEST1 of the TEST disk group with KFED to verify that it is correct.

[grid@jytest1] $kfed read AFD:TEST1kfbh.endian: 1; 0x000: 0x01kfbh.hard: 130; 0x001: 0x82kfbh.type: 1; 0x002: KFBTYP_DISKHEADkfbh.datfmt: 1; 0x003: 0x01kfbh.block.blk: 0 0x004: blk=0kfbh.block.obj: 2147483648; 0x008: disk=0kfbh.check: 3275580027; 0x00c: 0xc33d627bkfbh.fcn.base: 0; 0x010: 0x00000000kfbh.fcn.wrap: 0; 0x014: 0x00000000kfbh.spare1: 0; 0x018: 0x00000000kfbh.spare2: 0; 0x01c: 0x00000000kfdhdb.driver.provstr: ORCLDISKTEST1 0x000: length=13kfdhdb.driver.reserved [0]: 1414743380; 0x008: 0x54534554kfdhdb.driver.reserved [1]: 49; 0x00c: 0x00000031kfdhdb.driver.reserved [2]: 0; 0x010: 0x00000000kfdhdb.driver.reserved [3]: 0; 0x014: 0x00000000kfdhdb.driver.reserved [4]: 0; 0x018: 0x00000000kfdhdb.driver.reserved [5]: 0; 0x01c: 0x00000000kfdhdb.compat: 203424000 0x020: 0x0c200100kfdhdb.dsknum: 0; 0x024: 0x0000kfdhdb.grptyp: 2; 0x026: KFDGTP_NORMALkfdhdb.hdrsts: 3; 0x027: KFDHDR_MEMBERkfdhdb.dskname: TEST1; 0x028: length=5kfdhdb.grpname: TEST; 0x048: length=4kfdhdb.fgname: TEST1 0x068: length=5kfdhdb.fgname: DN1; 0x068: length=3

Let's try to zero the disk head directly with dd. The dd command itself does not return any errors.

[root@cs1 ~] # dd if=/dev/zero of=/dev/asmdisk03 bs=1024 count=1000010000+0 records in10000+0 records out10240000 bytes (10 MB) copied, 1.24936 s, 8.2 MB/s

Back up the first 1024 bytes of the disk and clear it. Ordinary users do not have the right to read.

[root@jytest1 ~] # dd if=/dev/asmdisk05 of=asmdisk05_header bs=1024 count=11+0 records in1+0 records out1024 bytes (kB) copied, 0.000282638 s, 3.6MB/s [root@jytest1 ~] # ls-lrt-rw-r--r-- 1 root root 1024 Aug 31 01:22 asmdisk05_ head [root @ jytest1 ~] # dd if=/dev/zero of=/dev/asmdisk05 bs=1024 count=11+0 records in1+0 records out1024 bytes (1.0 kB) copied, 0.000318516 s 3.2 MB/s then use KFED to read the disk head of the AFD:TEST1 of the TEST disk group Verify that it is correct [grid@jytest1 ~] $kfed read AFD:TEST1kfbh.endian: 1 0x000: 0x01kfbh.hard: 130,130; 0x001: 0x82kfbh.type: 1; 0x002: KFBTYP_DISKHEADkfbh.datfmt: 1; 0x003: 0x01kfbh.block.blk: 0; 0x004: blk=0kfbh.block.obj: 2147483648; 0x008: disk=0kfbh.check: 3275580027 0x00c: 0xc33d627bkfbh.fcn.base: 0; 0x010: 0x00000000kfbh.fcn.wrap: 0; 0x014: 0x00000000kfbh.spare1: 0; 0x018: 0x00000000kfbh.spare2: 0; 0x01c: 0x00000000kfdhdb.driver.provstr: ORCLDISKTEST1; 0x000: length=13kfdhdb.driver.reserved [0]: 1414743380; 0x008: 0x54534554kfdhdb.driver.reserved [1]: 49 0x00c: 0x00000031kfdhdb.driver.reserved [2]: 0; 0x010: 0x00000000kfdhdb.driver.reserved [3]: 0; 0x014: 0x00000000kfdhdb.driver.reserved [4]: 0; 0x018: 0x00000000kfdhdb.driver.reserved [5]: 0; 0x01c: 0x00000000kfdhdb.compat: 203424000; 0x020: 0x0c200100kfdhdb.dsknum: 0; 0x024: 0x0000kfdhdb.grptyp: 2 0x026: KFDGTP_NORMALkfdhdb.hdrsts: 3; 0x027: KFDHDR_MEMBERkfdhdb.dskname: TEST1; 0x028: length=5kfdhdb.grpname: TEST; 0x048: length=4kfdhdb.fgname: TEST1; 0x068: length=5

Test dismount disk group TEST, and then mount disk group TEST can be successful.

[grid@jytest1] $asmcmd umount TEST [grid@jytest1 ~] $asmcmd lsdgState Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files NameMOUNTED EXTERN N 512512 4096 4194304 40960 264 0 264 0 Y CRS/MOUNTED EXTERN N 512 512 4096 4194304 40960 24732 0 24732 0 N DATA/MOUNTED EXTERN N 512512 4096 4194304 40960 18452 0 18452 0 N FRA/ [grid@jytest1] $asmcmd mount TEST [grid@jytest1] $asmcmd lsdgState Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files NameMOUNTED EXTERN N 512 512 4096 4194304 40960 264 0 264 0 Y CRS/MOUNTED EXTERN N 512 512 4096 4194304 40960 24732 0 24732 0 N DATA/MOUNTED EXTERN N 512 512 4096 4194304 40960 18452 0 18452 0 N FRA/MOUNTED NORMAL N 512 512 4096 4194304 40960 11128 0 5564 0 N TEST/

Now disable the filter feature for disk / dev/asmdisk05

[grid@jytest1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / dev / asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk03DATA2 ENABLED / dev/asmdisk04FRA1 ENABLED / dev/asmdisk07TEST1 ENABLED / dev/asmdisk05TEST2 ENABLED / dev/asmdisk06 [grid@jytest1 ~] $asmcmd afd_filter-d / dev/ Asmdisk05 [grid@jytest1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / Dev/asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk03DATA2 ENABLED / dev/asmdisk04FRA1 ENABLED / dev/asmdisk07TEST1 DISABLED / dev/asmdisk05TEST2 ENABLED / dev/asmdisk06

Clear the first 1024 bytes of the disk

[root@jytest1 ~] # dd if=/dev/zero of=/dev/asmdisk05 bs=1024 count=11+0 records in1+0 records out1024 bytes (1.0kB) copied, 0.000318516 s, 3.2MB/s [grid@jytest1 ~] $asmcmd umount TEST [grid@jytest1 ~] $asmcmd mount TESTORA-15032: not all alterations performedORA-15017: diskgroup "TEST" cannot be mountedORA-15040: diskgroup is incomplete (DBD ERROR: OCIStmtExecute) [grid@jytest1 ~] $kfed read AFD:TEST1kfbh.endian: 0 0x000: 0x00kfbh.hard: 0; 0x001: 0x00kfbh.type: 0; 0x002: KFBTYP_INVALIDkfbh.datfmt: 0; 0x003: 0x00kfbh.block.blk: 0; 0x004: blk=0kfbh.block.obj: 0; 0x008: file=0kfbh.check: 0 0x00c: 0x00000000kfbh.fcn.base: 0; 0x010: 0x00000000kfbh.fcn.wrap: 0; 0x014: 0x00000000kfbh.spare1: 0; 0x018: 0x00000000kfbh.spare2: 0; 0x01c: 0x00000000000000000 0000000000000000000000000 [.] Repeat 255 timesKFED-00322: invalid content encountered during block traversal: [kfbtTraverseBlock] [Invalid OSM block type] [] [0]

You can see that the protection function is lost when the filter function is disabled

Use the first 1024 bytes of information from the previously backed up disk to recover the disk head

[root@jytest1 ~] # dd if=asmdisk05_header of=/dev/asmdisk05 bs=1024 count=11+0 records in1+0 records out1024 bytes (1.0kB) copied, 0.000274822 s, 3.7MB/s [grid@jytest1 ~] $kfed read / dev/asmdisk05kfbh.endian: 1; 0x000: 0x01kfbh.hard: 130; 0x001: 0x82kfbh.type: 1 0x002: KFBTYP_DISKHEADkfbh.datfmt: 1; 0x003: 0x01kfbh.block.blk: 0; 0x004: blk=0kfbh.block.obj: 2147483648; 0x008: disk=0kfbh.check: 1645917758; 0x00c: 0x621ab63ekfbh.fcn.base: 0; 0x010: 0x00000000kfbh.fcn.wrap: 0 0x014: 0x00000000kfbh.spare1: 0; 0x018: 0x00000000kfbh.spare2: 0; 0x01c: 0x00000000kfdhdb.driver.provstr: ORCLDISKTEST1; 0x000: length=13kfdhdb.driver.reserved [0]: 1414743380; 0x008: 0x54534554kfdhdb.driver.reserved [1]: 49; 0x00c: 0x00000031kfdhdb.driver.reserved [2]: 0; 0x010: 0x00000000kfdhdb.driver.reserved [3]: 0 0x014: 0x00000000kfdhdb.driver.reserved [4]: 0; 0x018: 0x00000000kfdhdb.driver.reserved [5]: 0; 0x01c: 0x00000000kfdhdb.compat: 203424000; 0x020: 0x0c200100kfdhdb.dsknum: 0; 0x024: 0x0000kfdhdb.grptyp: 2; 0x026: KFDGTP_NORMALkfdhdb.hdrsts: 3 0x027: KFDHDR_MEMBERkfdhdb.dskname: TEST1; 0x028: length=5kfdhdb.grpname: TEST; 0x048: length=4kfdhdb.fgname: TEST1; 0x068: length=5

Mount disk group TEST again

[grid@jytest1] $asmcmd lsdgState Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files NameMOUNTED EXTERN N 512512 4096 4194304 40960 26440 Y CRS/MOUNTED EXTERN N 512512 4096 4194304 40960 24732 0 24732 0 N DATA/MOUNTED EXTERN N 512 512 4096 4194304 40960 18452 0 18452 0 N FRA/ [grid@jytest1 ~] $asmcmd mount TEST [grid@jytest1 ~] $asmcmd lsdgState Type Rebal Sector Logical_Sector Block AU Total _ MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files NameMOUNTED EXTERN N 512 512 4096 4194304 40960 264 0 264 0 Y CRS/MOUNTED EXTERN N 512 512 4096 4194304 40960 24732 0 24732 0 N DATA/MOUNTED EXTERN N 512 512 4096 4194304 40960 18452 0 18452 0 N FRA/MOUNTED NORMAL N 512 512 4096 4194304 40960 11120 0 5560 0 N TEST/

Set up, clear and scan Oracle ASM Filter Driver Labels

Set an identity to the disk managed by Oracle ASMFD, and after the identity setting, the specified disk will be managed by Oracle ASMFD. You can use ASMCMD afd_label,afd_unlabel and afd_scan to add, delete and scan identities to see that disks that have been identified show that disks / dev/asmdisk03 and / dev/asmdisk05 are not identified.

[grid@cs1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / dev / asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk04SQL > select group_number Disk_number,name,label,path from v$asm_disk GROUP_NUMBER DISK_NUMBER NAME LABEL PATH -0 CRS1 AFD:CRS1 0 1 / dev/asmdisk05 0 2 DATA1 AFD:DATA1 03 / dev/asmdisk03 0 4 CRS2 AFD:CRS2 1 0 CRS1 CRS1 / dev/asmdisk02 1 1 CRS2 CRS2 / dev/asmdisk01 2 0 DATA1 DATA1 / dev/asmdisk04

Set identity

[grid@cs2 ~] $asmcmd afd_label DN1 / dev/asmdisk03 [grid@cs2 ~] $asmcmd afd_label DN2 / dev/asmdisk05

Looking at the disks that have been identified, you can see that disks / dev/asmdisk03 and / dev/asmdisk05 have been identified.

[grid@cs1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / dev / asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk04DN1 ENABLED / dev/asmdisk03DN2 ENABLED / dev/asmdisk05SQL > select group_number Disk_number,name,label,path from v$asm_disk GROUP_NUMBER DISK_NUMBER NAME LABEL PATH -0 0 CRS1 AFD:CRS1 0 1 DN2 / dev/asmdisk05 0 2 DN1 AFD:DN1 0 3 DATA1 AFD:DATA1 0 4 DN1 / dev/asmdisk03 0 6 CRS2 AFD:CRS2 0 5 DN2 AFD:DN2 1 1 CRS2 CRS2 / dev/asmdisk01 1 0 CRS1 CRS1 / dev/asmdisk02 2 0 DATA1 DATA1 / dev/asmdisk04

Clear identity

[grid@cs1 ~] $asmcmd afd_unlabel 'DN1' [grid@cs1 ~] $asmcmd afd_unlabel' DN2'

Note that when clearing the identity, it cannot be cleared if the marked disk has been used to create a disk group, for example

[grid@cs1] $asmcmd afd_unlabel 'TEST1'disk AFD:TEST1 is already provisioned for ASMNo devices to be unlabeled.ASMCMD-9514: ASM disk label clear operation failed.

Scan identification

[grid@cs1 ~] $asmcmd afd_scan

If you look at the identified disks, you can see that the identities of / dev/asmdisk03 and / dev/asmdisk05 have been cleared.

[grid@cs1 ~] $asmcmd afd_lsdsk----Label Filtering Path====CRS1 ENABLED / dev / asmdisk02CRS2 ENABLED / dev/asmdisk01DATA1 ENABLED / dev/asmdisk04SQL > select group_number Disk_number,name,label,path from v$asm_disk GROUP_NUMBER DISK_NUMBER NAME LABEL PATH -0 0 CRS1 AFD:CRS1 0 1 / dev/asmdisk05 0 2 DATA1 AFD:DATA1 03 / dev/asmdisk03 0 4 CRS2 AFD:CRS2 1 1 CRS2 CRS2 / dev/asmdisk01 1 0 CRS1 CRS1 / dev/asmdisk02 20 DATA1 DATA1 / dev/asmdisk04 so far I believe that you have a deeper understanding of "what are the relevant knowledge points of Oracle ASM Filter Driver?" you might as well come to the actual operation. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report