In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how oracle12c RAC creates ADVM and ACFS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
ACFS is a new feature of oracle database 11gR2. For more information about ACFS, please refer to the official documentation. This article is based on 12C RAC environment. I don't know if ACFS can be used in non-RAC environment. Interested friends can test it. The following is how to use asmca, command line, and sql statements to create ADVM, and then create ACFS. Several commands such as mount, umount, acfsutil, mkfs.acfs, srvctl and so on are used in the operating system. The acfsutil does not belong to any of the rpm packages and will only appear after you have installed the grid component.
1. Introduction of ADVM
The main purpose of ADVM is to make asm storage available to third-party applications other than databases, which is not limited to making asm limited to its own database domain. To use ADVM, you must first install grid. You have created the asm disk, the asm disk group. An advm volume can take up all or part of the space of a disk group, and the space of an advm volume can only come from one asm disk group, but an asm disk group can create multiple advm volumes. Each advm volume created produces a file in the / dev/asm/ directory that is used to create the file system.
Second, the method of creating ADVM
1. Use the asmca command to create graphical tools
(1) before creating an ADVM, the preferred in needs to create an ASM disk group. The figure below shows the created disk group, and the ACFS disk group is used in the following experiment.
(2) Click Volumes- > create, enter the volume name and size, and select the ASM disk group.
(3) ADVM was created successfully and found that state is not enabled.
(4) create an ACFS file system on the volume wjqvol1, select automatic mount, and enter the mount point.
(5) [negligible] Click show command to view the commands related to creating ACFS, so that you can manually create ACFS later.
(6) after clicking ok, prompt to execute the following script
(7) switch to the root user, execute the script, and then click close
(8) check that the ACFS file system is mounted successfully on both nodes of RAC.
[grid@c01n01 ~] $df-Th
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 9.7G 2.8G 6.4G 31% /
Tmpfs tmpfs 4.0G 1.3G 2.8G 31% / dev/shm
/ dev/xvda1 ext3 243M 83M 147M 37% / boot
/ dev/xvdc1 ext3 2.0G 38M 1.9G 2% / home
/ dev/xvdd1 ext3 20G 12G 7.1G 62% / U01
/ dev/asm/wjqvol1-245
Acfs 2.0G 145m 1.9G 8% / wjqacfs
[grid@c01n01 ~] $
[grid@c01n01 ~] $ssh c01n02 "df-Th"
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 9.7G 3.8G 5.5G 41% /
Tmpfs tmpfs 4.0G 1.3G 2.8G 31% / dev/shm
/ dev/xvda1 ext3 243M 83M 147M 37% / boot
/ dev/xvdc1 ext3 2.0G 37M 1.9G 2% / home
/ dev/xvdd1 ext3 20G 12G 7.2G 61% / U01
/ dev/asm/wjqvol1-245
Acfs 2.0G 145m 1.9G 8% / wjqacfs
(9) View the information related to ACFS
(10) looking at the crs resources, you can find the ADVM and ACFS you just created.
(11) enter the mount point for read and write test
2. Use the command to create an ADVM
(1) execute asmcmd command under grid user to create ADVM
[grid@c01n01] $asmcmd-p
ASMCMD [+] > volinfo-G acfs wjqvol1 # this command views the information of existing volumes
Diskgroup Name: ACFS
Volume Name: WJQVOL1
Volume Device: / dev/asm/wjqvol1-245
State: ENABLED
Size (MB): 2048
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: / wjqacfs
(2) create an ADVM through the volcreate command, and view the volume information through volinfo
[grid@c01n01] $asmcmd-p
ASMCMD [+] > volcreate-G acfs-s 1G wjqvol2
ASMCMD [+] > volinfo-G acfs wjqvol2
Diskgroup Name: ACFS
Volume Name: WJQVOL2
Volume Device: / dev/asm/wjqvol2-245
State: ENABLED
Size (MB): 1024
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
(3) you can resize the ADVM volume through volresize
ASMCMD [+] > volresize-G acfs-s 1.5G wjqvol2
ASMCMD [+] > volinfo-G acfs wjqvol2
Diskgroup Name: ACFS
Volume Name: WJQVOL2
Volume Device: / dev/asm/wjqvol2-245
State: ENABLED
Size (MB): 1536
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
Note: the following prompt appears when you turn it down
ASMCMD [+] > volresize-G acfs-s 1G wjqvol2
The requested size is smaller than the current size.
Data corruption may occur.
Are you sure? [y/n]: y
ASMCMD [+] >
ASMCMD [+] > volinfo-G acfs wjqvol2
Diskgroup Name: ACFS
Volume Name: WJQVOL2
Volume Device: / dev/asm/wjqvol2-245
State: ENABLED
Size (MB): 1024
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
(4) View the usage information of the volume through volstat
ASMCMD [+ acfs] > volstat
DISKGROUP NUMBER / NAME: 3 / ACFS
-
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
WJQVOL1
2685 1510912 47.366 0
1407 5386240 43.44 0
WJQVOL2
0 0 0
0 0 0
WJQVOL3
0 0 0
0 0 0
3. Create ADVM through the SQL command
(1) enter through SQLplus and execute the SQL statement
[grid@c01n01 ~] $sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Fri May 4 11:46:52 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0-64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL > alter diskgroup acfs add volume wjqvol3 size 1G
Alter diskgroup acfs add volume wjqvol3 size 1G
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group
Note: when creating advm under sqlplus, you cannot log in with sysdba permission, otherwise insufficient permission will be reported and sysasm permission is required.
SQL > alter diskgroup acfs add volume wjqvol3 size 1G
Diskgroup altered.
(2) Log in with sysasm permission to create
[grid@c01n01 ~] $sqlplus / as sysasm
SQL*Plus: Release 12.1.0.1.0 Production on Fri May 4 11:53:08 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0-64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL > alter diskgroup acfs resize volume wjqvol3 size 1.1g
Alter diskgroup acfs resize volume wjqvol3 size 1.1G
*
ERROR at line 1:
ORA-02017: integer value required
Note: when ADVM is resized by SQL statement, it can only be adjusted by an integer multiple.
SQL > alter diskgroup acfs resize volume wjqvol3 size 2G
Alter diskgroup acfs resize volume wjqvol3 size 2G
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15041: diskgroup "ACFS" space exhausted
Note: the resized ADVM operates the size of the ASM disk group with the error message as above
SQL > alter diskgroup acfs resize volume wjqvol3 size 2G
Diskgroup altered.
(4) View the relevant information of the asm file
SQL > select group_number,bytes,type from v$asm_file
GROUP_NUMBER BYTES TYPE
1 1536 ASMPARAMETERFILE
1 165974016 OCRFILE
1 7680 PASSWORD
1 62922752 DATAFILE
1 419438592 DATAFILE
1 629153792 DATAFILE
1 2147491840 DATAFILE
1 104865792 DATAFILE
1 9945088 CONTROLFILE
1 52429312 ONLINELOG
1 52429312 ONLINELOG
1 52429312 ONLINELOG
1 20979712 TEMPFILE
1 3584 PARAMETERFILE
1 7680 PASSWORD
1 954212352 DATAFILE
1 838868992 DATAFILE
1 5251072 DATAFILE
1 183508992 DATAFILE
1 18956288 CONTROLFILE
1 52429312 ONLINELOG
1 52429312 ONLINELOG
1 109060096 TEMPFILE
1 376840192 DATAFILE
1 78651392 DATAFILE
1 52429312 ONLINELOG
1 52429312 ONLINELOG
1 3584 PARAMETERFILE
2 18956288 CONTROLFILE
2 52429312 ONLINELOG
2 52429312 ONLINELOG
2 52429312 ONLINELOG
2 52429312 ONLINELOG
3 2147483648 ASMVOL
3 1073741824 ASMVOL
3 2147483648 ASMVOL
36 rows selected.
(4) View the relevant information of ADVM volumes
SQL > select volume_name,size_mb,state,volume_device,mountpath from v$asm_volume
VOLUME_NAME SIZE_MB STATE VOLUME_DEVICE MOUNTPATH
WJQVOL1 2048 REMOTE / dev/asm/wjqvol1-245 / wjqacfs
WJQVOL2 1024 REMOTE / dev/asm/wjqvol2-245
WJQVOL3 2048 REMOTE / dev/asm/wjqvol3-245
(5) View information related to the use of ADVM volumes
SQL > select volume_name,reads,writes,read_errs,bytes_read,bytes_written from v$asm_volume_stat
VOLUME_NAME READS WRITES READ_ERRS BYTES_READ BYTES_WRITTEN
--
WJQVOL1 0 0 0
WJQVOL2 0 0 0
WJQVOL3 0 0 0
(6) View the ADVM volume file created above under the / dev/asm path
[root@c01n01 ~] # ll / dev/asm/
Total 0
Brwxrwx--- 1 root asmadmin 252, 125441 May 3 16:01 wjqvol1-245
Brwxrwx--- 1 root asmadmin 252, 125442 May 4 11:45 wjqvol2-245
Brwxrwx--- 1 root asmadmin 252, 125443 May 4 11:53 wjqvol3-245
Third, create ACFS1, create through asmca
The above has been tested.
2. Create a standard file system on ADVM
(1) formatted into ext4 file system
[root@c01n01] # mkfs.ext4 / dev/asm/wjqvol2-245
Mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs-c or-i to override.
(2) Mount
[root@c01n01 ~] # mkdir / wjqext4
[root@c01n01] # mount / dev/asm/wjqvol2-245 / wjqext4
[root@c01n01 ~] # df-TH
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 11G 3.0G 6.9G 31% /
Tmpfs tmpfs 4.3G 1.3G 3.0G 31% / dev/shm
/ dev/xvda1 ext3 254m 87m 154m 37% / boot
/ dev/xvdc1 ext3 2.2G 39M 2.0G 2% / home
/ dev/xvdd1 ext3 21G 12G 7.7G 62% / U01
192.0.2.1:/stage
Nfs 11G 11G 0100% / stage
/ dev/asm/wjqvol1-245
Acfs 2.2G 152m 2.0G 8% / wjqacfs
/ dev/asm/wjqvol2-245
Ext4 1.1G 35m 969m 4% / wjqext4
3. Create an ACFS file system on ADVM
Note: ACFS cannot be used in the linux root partition, cannot be used in the installation directory of grid, database files (that is, files stored in asm) are not supported, and the use of acfs depends on advm volumes
(1) formatted into acfs file system
[root@c01n01] # mkfs.acfs / dev/asm/wjqvol3-245
Mkfs.acfs: version = 12.1.0.1.0
Mkfs.acfs: on-disk version = 39.0
Mkfs.acfs: volume = / dev/asm/wjqvol3-245
Mkfs.acfs: volume size = 2147483648
Mkfs.acfs: Format complete.
(2) Mount. Note: this is only a temporary mount, which can only be seen on the current node of RAC, but not on other nodes.
[root@c01n01 ~] # mkdir / wjqacfs.man
[root@c01n01] # mount / dev/asm/wjqvol3-245 / wjqacfs.man
Mount: you must specify the filesystem type
[root@c01n01] # mount-t acfs / dev/asm/wjqvol3-245 / wjqacfs.man
[root@c01n01 ~] # df-Th
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 9.7G 2.8G 6.4G 31% /
Tmpfs tmpfs 4.0G 1.3G 2.8G 31% / dev/shm
/ dev/xvda1 ext3 243M 83M 147M 37% / boot
/ dev/xvdc1 ext3 2.0G 38M 1.9G 2% / home
/ dev/xvdd1 ext3 20G 12G 7.1G 62% / U01
/ dev/asm/wjqvol1-245
Acfs 2.0G 145m 1.9G 8% / wjqacfs
/ dev/asm/wjqvol2-245
Ext4 1008M 34M 924M 4% / wjqext4
/ dev/asm/wjqvol3-245
Acfs 2.0G 43M 2.0G 3% / wjqacfs.man
(3) check the mount situation through SQL
SQL > select volume_name,size_mb,state,volume_device,mountpath from v$asm_volume
VOLUME_NAME SIZE_MB STATE VOLUME_DEVICE MOUNTPATH
--
WJQVOL1 2048 REMOTE / dev/asm/wjqvol1-245 / wjqacfs
WJQVOL2 1024 REMOTE / dev/asm/wjqvol2-245
WJQVOL3 2048 REMOTE / dev/asm/wjqvol3-245 / wjqacfs.man
(4) looking at the crs resources, you can see that the ADVM volume is created, but the ACFS file system created on the wjqvol3 volume cannot be seen.
(5) through asmca, you can find that the state of ACFS created on wjqvol3 is in UNKNOWN [unmounted state]
(6) the following is permanently mounted by command
Permanent mount:
[grid@c01n01] $srvctl add filesystem-d / dev/asm/wjqvol3-245m / wjqacfs.man-u grid-fstype ACFS-autostart ALWAYS
PRCN-2018: Current user grid is not a privileged user
Note: there is no permission to execute the above command prompt under grid, so it can only be executed under root user.
[root@c01n01] # / u01/app/12.1.0/grid/bin/srvctl add filesystem-d / dev/asm/wjqvol3-245m / wjqacfs.man-u grid-fstype ACFS-autostart ALWAYS
Start the file system and see if it is mounted automatically
[root@c01n01] # / u01/app/12.1.0/grid/bin/srvctl start filesystem-d / dev/asm/wjqvol3-245
[root@c01n01 ~] # df-Th
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 9.7G 2.8G 6.4G 31% /
Tmpfs tmpfs 4.0G 1.3G 2.8G 31% / dev/shm
/ dev/xvda1 ext3 243M 83M 147M 37% / boot
/ dev/xvdc1 ext3 2.0G 38M 1.9G 2% / home
/ dev/xvdd1 ext3 20G 12G 7.1G 62% / U01
192.0.2.1:/stage
Nfs 9.9G 9.7g 0100% / stage
/ dev/asm/wjqvol1-245
Acfs 2.0G 145m 1.9G 8% / wjqacfs
/ dev/asm/wjqvol2-245
Ext4 1008M 34M 924M 4% / wjqext4
/ dev/asm/wjqvol3-245
Acfs 2.0G 43M 2.0G 3% / wjqacfs.man
Look at the crs resource and find that the file system exists and you can see the mounted path
Looking through asmca again, it is found that the state of the ACFS created on wjqvol3 is mount state.
Use acfsutil1, the management tool of ACFS, to view the version information of acfsutil
[grid@c01n01 ~] $acfsutil version
Acfsutil version: 12.1.0.1.0
2. View information about the ACFS file system
[grid@c01n01 ~] $acfsutil info fs
/ wjqacfs
ACFS Version: 12.1.0.1.0
Flags: MountPoint,Available
Mount time: Thu May 3 16:01:14 2018
Volumes: 1
Total size: 2147483648
Total free: 1996140544
Primary volume: / dev/asm/wjqvol1-245
Label:
Flags: Primary,Available,ADVM
On-disk version: 39.0
Allocation unit: 4096
Major, minor: 252, 125441
Size: 2147483648
Free: 1996140544
ADVM diskgroup ACFS
ADVM resize increment: 33554432
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
Number of snapshots: 0
Snapshot space usage: 0
Replication status: DISABLED
/ wjqacfs.man
ACFS Version: 12.1.0.1.0
Flags: MountPoint,Available
Mount time: Fri May 4 12:19:50 2018
Volumes: 1
Total size: 2147483648
Total free: 2103123968
Primary volume: / dev/asm/wjqvol3-245
Label:
Flags: Primary,Available,ADVM
On-disk version: 39.0
Allocation unit: 4096
Major, minor: 252, 125443
Size: 2147483648
Free: 2103123968
ADVM diskgroup ACFS
ADVM resize increment: 33554432
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
Number of snapshots: 0
Snapshot space usage: 0
Replication status: DISABLED
3. Manage ACFS snapshots
(1) create a snapshot of ACFS
[grid@c01n01 ~] $acfsutil snap create wjqvol1 / wjqacfs
Acfsutil snap create: Snapshot operation is complete.
(2) after the snapshot is created successfully, an .ACFS directory is automatically generated under the mount path of ACFS. The snaps in this directory can view the snapshot.
[grid@c01n01 wjqvol1] $pwd
/ wjqacfs/.ACFS/snaps/wjqvol1
[grid@c01n01 wjqvol1] $ll
Total 4
D?? Lost+found
-rw-r--r-- 1 grid oinstall 18 May 3 16:11 test.txt
(3) update the file test.txt before the snapshot is created
[root@c01n01 wjqacfs] # echo "This is snapshot" > > test.txt
[root@c01n01 wjqacfs] # cat test.txt
This is acfs test
This is snapshot
(4) View the differences between snapshot files and current files
[root@c01n01 wjqacfs] # cat .ACFS / snaps/wjqvol1/test.txt
This is acfs test
(5) Delete a snapshot
[root@c01n01 ~] # acfsutil snap delete wjqvol1 / wjqacfs
Acfsutil snap delete: Snapshot operation is complete.
Delete ACFS and ADVM1, and use acfsutil to unregister the acfs file system
[root@c01n01] # acfsutil registry-d / wjqacfs.man
Acfsutil registry: ACFS-03135: unable to locate mount point / wjqacfs.man in Oracle Registry
Acfsutil registry: ACFS-03112: unable to remove mount point / wjqacfs.man from Oracle Registry
Note: if the above error occurs, it means that there are no resources for the ACFS in crs and are not registered in crs. You need to register as permanent mount and then proceed.
2. Execute the above deregistration information again
[root@c01n01] # acfsutil registry-d / wjqacfs.man
Acfsutil registry: successfully removed ACFS mount point / wjqacfs.man from Oracle Registry
3. Check the mount condition and whether the ACFS information exists in the crs resource.
[root@c01n01 ~] # df-Th
Filesystem Type Size Used Avail Use% Mounted on
/ dev/xvda2 ext3 9.7G 2.8G 6.4G 31% /
Tmpfs tmpfs 4.0G 1.3G 2.8G 31% / dev/shm
/ dev/xvda1 ext3 243M 83M 147M 37% / boot
/ dev/xvdc1 ext3 2.0G 38M 1.9G 2% / home
/ dev/xvdd1 ext3 20G 12G 7.1G 62% / U01
192.0.2.1:/stage
Nfs 9.9G 9.7g 0100% / stage
/ dev/asm/wjqvol1-245
Acfs 2.0G 145m 1.9G 8% / wjqacfs
/ dev/asm/wjqvol2-245
Ext4 1008M 34M 924M 4% / wjqext4
4. Check the volume file of OS / dev/asm that still exists
[root@c01n01 ~] # ll / dev/asm/
Total 0
Brwxrwx--- 1 root asmadmin 252, 125441 May 3 16:01 wjqvol1-245
Brwxrwx--- 1 root asmadmin 252, 125442 May 4 12:15 wjqvol2-245
Brwxrwx--- 1 root asmadmin 252, 125443 May 4 13:41 wjqvol3-245
5. Delete the ADVM volume by asmcmd command
[grid@c01n01] $asmcmd-p
ASMCMD [+] > voldisable-G acfs wjqvol3# first disbaleADVM the volume, then delete it
ASMCMD [+] > volinfo-G acfs wjqvol3
Diskgroup Name: ACFS
Volume Name: WJQVOL3
Volume Device: / dev/asm/wjqvol3-245
State: DISABLED
Size (MB): 2048
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
ASMCMD [+] > voldelete-G acfs wjqvol3 # Delete ADVM Volume
Confirm that the volume has been completely deleted
ASMCMD [+] > volstat
DISKGROUP NUMBER / NAME: 3 / ACFS
-
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
WJQVOL1
3049 5919744 53.171 0
1551 5567488 46.828 0
WJQVOL2
93 377856. 254 0
12397 50778112 4330.134 0
[root@c01n01 ~] # ll / dev/asm/
Total 0
Brwxrwx--- 1 root asmadmin 252, 125441 May 3 16:01 wjqvol1-245
Brwxrwx--- 1 root asmadmin 252, 125442 May 4 12:15 wjqvol2-245
Thank you for reading! This is the end of the article on "how oracle12c RAC creates ADVM and ACFS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.