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

Oracle Study-- ASM File system ACFS Management

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle Study-- ASM File system ACFS Management

System environment:

Operating system: RedHat EL5.5

Cluster: Oracle Grid 11.2.0.1.0

Oracle: Oracle 11g 11.2.0.1.0

In Oracle Database 11gR2, based on ASM technology, Oracle launched a strong ACFS file system, which further promoted the automatic storage management technology.

In Oracle 11gR2, ASM technology still focuses on core files that support database operation and backup, including data files, control files, archive logs, spfile, RMAN backup files, Change Tracking files, data pump Dump files and OCR files. ACFS and Oracle ADVM (ASM Dynamic Volume Manager) further extend the scope of ASM support to store Oracle software, alarm logs, tracking files, BFILEs large objects, as well as images, pictures and other common files for applications.

In ASMCA, you can view ACFS-related settings through the ASM Cluster File system (ASM Cluster File Systems) option page, "ASM Cluster File system (ACFS) can be used to store files, such as executable files, Oracle diagnostic files, application configuration files, and so on. To use ACFS, you must first create ASM volumes."

There are two ways to create ASM volumes, one is the ASMCA tool, and the other is through the command line

1. ASMCA creates acfs

1. First create asm diskgroup (if asm diskgroup is created using asmca, the default compatible is "11.2". If you use the sqlplus command, the default compatible is "11.1", which is to be updated to "11.2").

SQL > create diskgroup dg2

2 external redundancy

3 disk 'ORCL:ASM_EXT1' attribute' compatible.asm'='11.2'

Diskgroup created.

SQL > create diskgroup dg3

2 external redundancy

3 disk 'ORCL:ASM_EXT2'

Diskgroup created.

SQL > alter diskgroup dg3 set attribute 'compatible.asm'='11.2'; / / Update compatible to "11.2"

Diskgroup altered.

View disk group information:

SQL > select name,state,COMPATIBILITY from v$asm_diskgroup

NAME STATE COMPATIBILITY

-

DG1 MOUNTED 11.2.0.0.0

OCR_VOTE MOUNTED 11.2.0.0.0

RCY1 MOUNTED 11.2.0.0.0

DG2 MOUNTED 11.2.0.0.0

DG3 MOUNTED 11.2.0.0.0

2. Create acfs through asmca

1. View asm istance status

2. Check the asm diskgroup status under asm

3. Select the available asm diskgroup to establish asm volume

4. View the asm volume to be established

2. Establish the acfs file system and select the default mount point

After the ACFS has been created, view it under the system:

Because the ACFS file system is shared, all are automatically mount on all RAC node.

Test for storing files under the file system:

[grid@zcx2 ~] $echo "hello,world" > / u01/app/oracle/acfsmounts/dg2_asm_vol1/1.txt

[grid@zcx2 ~] $ls-l / u01/app/oracle/acfsmounts/dg2_asm_vol1

Total 68

-rw-r--r-- 1 grid oinstall 12 Sep 30 15:07 1.txt

Drwx- 2 root root 65536 Sep 30 15:04 lost+found

Second, create acfs through the acfsutil command

1. Create a mount point

[root@zcx2 ~] # mkdir / U02

[root@zcx2 ~] # su-grid

2. Create asm volume through asmca

[grid@zcx2 ~] $asmcmd

ASMCMD > volcreate-G dg3-s 1g asm_vol2

ASMCMD > volinfo-G dg3 asm_vol2

Diskgroup Name: DG3

Volume Name: ASM_VOL2

Volume Device: / dev/asm/asm_vol2-129

State: ENABLED

Size (MB): 1024

Resize Unit (MB): 256

Redundancy: UNPROT

Stripe Columns: 4

Stripe Width (K): 128

Usage:

Mountpath:

3. View asm volume attributes

[root@node3] # ls-l / dev/asm/asm_vol2-129

Brwxrwx--- 1 root asmadmin 252, 66049 Sep 30 15:10 / dev/asm/asm_vol2-129

SQL > select GROUP_NUMBER, VOLUME_NAME, state from v$asm_volume

GROUP_NUMBER VOLUME_NAME STATE

4 ASM_VOL1 ENABLED

5 ASM_VOL2 ENABLED

4. Format asm volume to establish acfs

[root@zcx2] # mkfs.acfs / dev/asm/asm_vol2-129

Mkfs.acfs: version = 11.2.0.1.0.0

Mkfs.acfs: on-disk version = 39.0

Mkfs.acfs: volume = / dev/asm/asm_vol2-129

Mkfs.acfs: volume size = 1073741824

Mkfs.acfs: Format complete.

5. Register for acfs

[root@zcx2] # acfsutil registry-a / dev/asm/asm_vol2-129

6. Establish the mount of acfs

[root@zcx2] # mount-t acfs / dev/asm/asm_vol2-129 / U02

7. View mount information

[root@zcx2] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/asm/asm_vol1-211

2.0G 173m 1.9G 9% / u01/app/oracle/acfsmounts/dg2_asm_vol1

/ dev/asm/asm_vol2-129

1.0G 39m 986M 4% / u02

View acfs through asmca:

8. Test the acfs application

[root@node3 ~] # su-grid

[grid@node3 ~] $cd / U02

[grid@node3 U02] $touch g.txt

Touch: cannot touch `g.txtreply: Permission denied

[grid@node3 U02] $su-

Password:

Su: incorrect password

[grid@node3 U02] $su-

Password:

[root@node3 ~] # ls-ld / U02

Drwxr-xr-x 4 root root 4096 Sep 30 15:20 / u02

[root@node3 ~] # chown oracle:oinstall / U02

[root@node3 ~] # ls-ld / U02

Drwxr-xr-x 4 oracle oinstall 4096 Sep 30 15:20 / u02

[root@node3 ~] # chmod 775 / U02

[root@node3 ~] # su-grid

[grid@node3 ~] $cd / U02

[grid@node3 U02] $touch g.txt

[grid@node3 U02] $su-oracle

Password:

[oracle@node3 ~] $touch / u02/o.txt

[oracle@node3 ~] $ls-l / U02

Total 64

-rw-r--r-- 1 grid oinstall 0 Sep 30 15:21 g.txt

Drwx- 2 root root 65536 Sep 30 15:20 lost+found

-rw-r--r-- 1 oracle oinstall 0 Sep 30 15:21 o.txt

Delete the ACFS system

You can use the acfsutil tool to delete the acfs:

[root@zcx2 ~] # acfsutil

Usage: acfsutil [- h] command... # (Version 11.2.0.1.0.0)

-h-help

Command Subcmd Arguments

-

Help-display this message

Version-display ACFS version information

Info fs-Display all ACFS file systems

Info fs [...]-Display specific ACFS file sys

Info fs-o-Display specific file sys item:

Info fs-o freespace, totalspace

Info fs-o mountpoints, volumes

Info fs-o available, ismountpoint

Info fs-o isavailable, iscorrupt

Info fs-o isadvm, diskgroup

Info fs-o redundancy, resizeincrement

Info fs-o stripewidth, stripecolumns

Info fs-o primaryvolume

Info file [...]-Display specific file info

Info id-

Info id Display the pathname associated with the given

Info id ACFS file identifier and mountpoint.

Rmfs-Remove unmounted ACFS file sys

Size [- | +] nnn [K | M | G | T | P] [- d]-Resize file system

Registry [- l]-Display registry contents

Registry-l-Display a specific mount point

Registry-l-Display a specific device

Registry-m-Display a specific mount point associated with a device

Registry-a [- f] [- o] [- n]-Add a mount point

Registry-d [|]-Delete a mount point or a device

Tune AcfsMaxOpenFiles-Maximum number of open files

Tune (Windows only)

Snap create-create a file system snapshot

Snap delete-delete a file system snapshot

1. Unmount the file system

[root@node3 ~] # umount / U02

[root@node3] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/asm/asm_vol1-211

2.0G 173m 1.9G 9% / u01/app/oracle/acfsmounts/dg2_asm_vol1

2. Cancel the registration of the acfs system

[root@node3] # acfsutil registry-d / U02

3. Delete the acfs system

[root@node3] # acfsutil rmfs / dev/asm/asm_vol2-129

4. View asm volume information

ASMCMD > volinfo-G dg3 asm_vol2

Diskgroup Name: DG3

Volume Name: ASM_VOL2

Volume Device: / dev/asm/asm_vol2-129

State: ENABLED

Size (MB): 1024

Resize Unit (MB): 256

Redundancy: UNPROT

Stripe Columns: 4

Stripe Width (K): 128

Usage:

Mountpath:

5. Disable asm volume

ASMCMD > voldisable-G dg3 asm_vol2

ASMCMD > volinfo-G dg3 asm_vol2

Diskgroup Name: DG3

Volume Name: ASM_VOL2

Volume Device: / dev/asm/asm_vol2-129

State: DISABLED

Size (MB): 1024

Resize Unit (MB): 256

Redundancy: UNPROT

Stripe Columns: 4

Stripe Width (K): 128

Usage:

Mountpath:

6. Delete asm volume

ASMCMD > voldelete-G dg3 asm_vol2

ASMCMD > volinfo-G dg3 asm_vol2

Volume asm_vol2 not found in diskgroup dg3

Use ASCMCA to view:

-at this point, the ACFS system has been completely deleted

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