Oracle 11g ASM: how to create an oracle ACFs File System in asmcmd command line tool

Source: Internet
Author: User
Lab environment: Oracle 11g R2 RAC (11.2.0.3.5) Oracle Enterprise Linux 5.6x86
1. Create an ASM disk group and mount the disk on two nodes. Then, partition the disk on the first node. [root @ Rac1 ~] # Fdisk-ldisk/dev/SDE: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersunits = cylinders of 16065*512 = 8225280 bytes
Device boot start end blocks ID system/dev/sde1 1 261 2096451 83 Linux
Create an ASM disk on node 1st [root @ Rac1 ~] # Oracleasm createdisk goldengate/dev/sde1 [root @ Rac1 ~] # Oracleasm scandisks

[Root @ Rac1 ~] # Oracleasm listdisksdatafragoldengateocr_vote scan the ASM disk on node 2nd [root @ rac2 ~] # Oracleasm listdisksdatafragoldengateocr_vote
Switch to the grid user on the first node and execute asmca to create the ASM disk group. Create the Oracle advm volume and diskgroup on the ASM diskgroup. COMPATIBLE.ASMAnd COMPATIBLE.ADVMThe compatibility must be set to 11.2.0.2. You can select "advanced options" when creating a disk group to set this attribute for diskgroup. You can also use SQL commands to create or modify this attribute for a disk group. The method is as follows:
ALTER DISKGROUP goldengate SET ATTRIBUTE 'compatible.asm' = '11.2.0.2';
ALTER DISKGROUP goldengate SET ATTRIBUTE 'compatible.rdbms' = '11.2.0.2';
ALTER DISKGROUP goldengate SET ATTRIBUTE 'compatible.advm' = '11.2.0.2';

2. Create an oracle advm volume
Switch to the grid user and enter the asmcmd command line interface Su-grid
[grid@rac1 ~]$ export ORACLE_SID=+ASM1[grid@rac1 ~]$ asmcmd
Verify the actual size of the created ASM disk.
ASMCMD> lsdgState    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  NameMOUNTED  EXTERN  N         512   4096  1048576      5114     3027                0            3027              0             N  DATA/MOUNTED  EXTERN  N         512   4096  1048576      5114     4613                0            4613              0             N  FRA/MOUNTED  EXTERN  N         512   4096  1048576      2047       29                0              29              0             N  GOLDENGATE/MOUNTED  EXTERN  N         512   4096  1048576      2047     1651                0            1651              0             Y  OCR_VOTE/
Create an oracle advm volume
ASMCMD> volcreate -G GOLDENGATE -s 1900m GOLDENGATE
Note that the value specified by the-s option must not exceed the actual size value displayed by the lsdg. Otherwise, the following error is reported:
ASMCMD> volcreate -G GOLDENGATE -s 1950m GOLDENGATEORA-15032: not all alterations performedORA-15041: diskgroup "GOLDENGATE" space exhausted (DBD ERROR: OCIStmtExecute)
Determine whether the Oracle advm volume is created
ASMCMD> volinfo -G GOLDENGATE GOLDENGATEDiskgroup Name: GOLDENGATE         Volume Name: GOLDENGATE         Volume Device: /dev/asm/goldengate-257         State: ENABLED         Size (MB): 1920         Resize Unit (MB): 32         Redundancy: UNPROT         Stripe Columns: 4         Stripe Width (K): 128         Usage:          Mountpath: 
SQL> col volume_device for a30SQL> col volume_name for a30SQL> SELECT volume_name, volume_device FROM V$ASM_VOLUME   2       WHERE volume_name ='GOLDENGATE';VOLUME_NAME                    VOLUME_DEVICE------------------------------ ------------------------------GOLDENGATE                     /dev/asm/goldengate-257
3. Create an oracle ACFs File System
[root@rac1 ~]# /sbin/mkfs -t acfs /dev/asm/goldengate-257mkfs.acfs: version                   = 11.2.0.3.0mkfs.acfs: on-disk version           = 39.0mkfs.acfs: volume                    = /dev/asm/goldengate-257mkfs.acfs: volume size               = 2013265920mkfs.acfs: Format complete.
Create an ACFs file system mount point on node 1 and node 2.
[root@rac1 ~]# su - oracle[oracle@rac1 ~]$ mkdir -p /home/oracle/ggs
[root@rac2 ~]# su - oracle[oracle@rac2 ~]$ mkdir -p /home/oracle/ggs
Register the just-created ACFs File System in the cluster Mount registery or manually mount it without registration.
The advantage of registering an ACFs file system is that when the cluster checks Mount registery every 30 seconds, the file system is automatically mounted on each node, when the cluster software or system is restarted, the file system is automatically mounted.
[root@rac1 ~]# /sbin/acfsutil registry -a /dev/asm/goldengate-257 /home/oracle/ggsacfsutil registry: mount point /home/oracle/ggs successfully added to Oracle Registry
The command for manual mounting is as follows:
[root@rac1 ~]# /bin/mount -t acfs /dev/asm/goldengate-257 /home/oracle/ggs
Wait 30 seconds after running the registration command, and then check whether the ACFs file system is mounted on each node.
[root@rac1 ~]# df -hFilesystem            Size  Used Avail Use% Mounted on/dev/sda1              30G   20G  7.7G  73% //dev/sda3            1003M   39M  914M   5% /tmptmpfs                 1.3G  454M  814M  36% /dev/shm/dev/asm/goldengate-257                      1.9G   73M  1.9G   4% /home/oracle/ggs
[oracle@rac2 ~]$ df -hFilesystem            Size  Used Avail Use% Mounted on/dev/sda1              30G   21G  7.3G  74% //dev/sda3            1003M   39M  914M   5% /tmptmpfs                 1.3G  450M  818M  36% /dev/shm/dev/asm/goldengate-257                      1.9G  137M  1.8G   8% /home/oracle/ggs
4. Test the File System
[root@rac1 ~]# chown -R oracle:oinstall /home/oracle/ggs
First Node
[oracle@rac1 ~]$ echo "Oracle ACFS File System" > /home/oracle/ggs/acfs.log
[oracle@rac1 ggs]$ more /home/oracle/ggs/acfs.logOracle ACFS File System
Section 2
[oracle@rac2 ~]$ more /home/oracle/ggs/acfs.logOracle ACFS File System

For reprinting, please indicate the author's source and original article links; otherwise, you will be held legally responsible:

Author: xiangsir

Link: http://blog.csdn.net/xiangsir/article/details/10007779

QQ: 444367417

MSN: xiangsir@hotmail.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.