ITPub博客

首页 > 数据库 > Oracle > Oracle 12c Clusterware让ACFS 文件系统在主机重启后自动Mount的两种方法

Oracle 12c Clusterware让ACFS 文件系统在主机重启后自动Mount的两种方法

原创 Oracle 作者:oliseh 时间:2014-09-24 23:38:37 0 删除 编辑

方法一:acfsutil registry

用于general purpose ACFS filesystems,与其他Resource没有关联关系,使用此方法注册后在registry 里有一份该FS的信息,同时在clustware资源组里也能看到该FS的信息

 

方法二:srvctl add filesystem

用于在11g里被称为CRS-Managed ACFS filesystemsACFS文件系统,和其它资源存在依赖关系,比如基于ACFSDatabase Home,使用此方法注册后仅在clustware资源组里能看到该FS的信息,acfsutil registry输出是空的,若此时再想通过acfsutil registry -a来注册这个FS的信息,会得到ACFS-03131: volume /dev/asm/acfsvol11-418 already exists in the Oracle Registry as。。。错误,可见acfsutil registryclustware里的ACFS信息是共享的,互相间不能重复的。

 

环境准备:

create diskgroup acfsdg1 external redundancy disk '/dev/raw/raw1' size 1024m attribute 'compatible.rdbms'='12.1.0.0.0','compatible.asm'='12.1.0.0.0','compatible.advm'='12.1.0.0.0';

 

alter diskgroup acfsdg1 add volume acfsvol11 size 400m;

 

mkfs -t acfs -v /dev/asm/acfsvol11-418 400M;    --gridroot执行

 

 

?  Acfsutil registry的使用:

--准备工作中建好ADVM后可以看到clusterware Resource中已经有了Advm

root@ora12c1:/>crsctl status res -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details      

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ACFSDG1.ACFSVOL11.advm

               ONLINE  ONLINE       ora12c1                  Volume device /dev/a

                                                             sm/acfsvol11-418 is

                                                             online,STABLE

               ONLINE  ONLINE       ora12c2                  Volume device /dev/a

                                                             sm/acfsvol11-418 is

                                                             online,STABLE

 

--root[C1] 用户执行acfsutil registry注册ACFSOCR,看到/acfs1已经在两个节点自动mount

root@ora12c1:/>acfsutil registry -a /dev/asm/acfsvol11-418 /acfs1      –Root用户执行

acfsutil registry: mount point /acfs1 successfully added to Oracle Registry

 

root@ora12c1:/>df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda2             7.9G  5.5G  2.1G  73% /

tmpfs                 1.9G  1.3G  671M  66% /dev/shm

/dev/sda1             248M   50M  186M  21% /boot

/dev/sda5             504M   23M  456M   5% /tmp

/dev/mapper/homevg-home_lv

                      2.7G   36M  2.6G   2% /home

/dev/mapper/oraclevg-oracle_lv

                       32G   28G  2.6G  92% /oracle12c

ORA12c                585G  325G  261G  56% /media/sf_ORA12c

/dev/asm/acfsvol11-418

                      416M   78M  339M  19% /acfs1[C2] 

 

root@ora12c2:/>df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda2             7.9G  5.5G  2.1G  73% /

tmpfs                 1.9G  1.3G  673M  65% /dev/shm

/dev/sda1             248M   50M  186M  21% /boot

/dev/sda5             504M   23M  456M   5% /tmp

/dev/mapper/homevg-home_lv

                      2.7G  744M  1.9G  29% /home

/dev/mapper/oraclevg-oracle_lv

                       32G   12G   18G  40% /oracle12c

ORA12c                585G  325G  261G  56% /media/sf_ORA12c

/dev/asm/acfsvol11-418

                      416M   78M  339M  19% /acfs1

 

--clusterware resource里也加入了/acfs1

root@ora12c2:/>crsctl status res -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details      

--------------------------------------------------------------------------------

Local Resources

ora.acfsdg1.acfsvol11.acfs

               ONLINE  ONLINE       ora12c1                  mounted on /acfs1,ST

                                                             ABLE

               ONLINE  ONLINE       ora12c2                  mounted on /acfs1,ST

                                                             ABLE

 

--查看资源的AUTO_START属性为Always

root@ora12c1:/oracle12c>crsctl status res ora.acfsdg1.acfsvol11.acfs -f | grep AUTO_START

AUTO_START=always

 

--acfsutil registry里有了注册的信息

root@ora12c2:/>acfsutil registry

Mount Object:

  Device: /dev/asm/acfsvol11-418

  Mount Point: /acfs1

  Disk Group: ACFSDG1

  Volume: ACFSVOL11

  Options: none

  Nodes: all

 

--这两个视图应该是包含mounted acfs volumes的,但不知为何没有记录?

select * from v$asm_filesystem

select * from v$asm_acfsvolumes

 

--使用srvctl add filesystems尝试将/acfs1加入clusterware资源,显示资源已经加入

grid@ora12c1:/home/grid>srvctl add filesystem -device /dev/asm/acfsvol11-418 -path /acfs1

PRCA-1022 : ACFS file system resource already exists for disk group acfsdg1 and volume acfsvol11

 

--Umount /acfs1,同时删除/acfs1注册信息[C3] 

acfsutil registry -d /acfs1  --root执行

 

--注册信息已无法查询到,两节点上/acfs1也已被Umount

root@ora12c1:/>acfsutil registry

 

结果为空

 

root@ora12c1:/>df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2              8256952   5686276   2151248  73% /

tmpfs                  1962100   1275388    686712  66% /dev/shm

/dev/sda1               253871     50455    190309  21% /boot

/dev/sda5               516040     23328    466500   5% /tmp

/dev/mapper/homevg-home_lv

                       2830288     36712   2650040   2% /home

/dev/mapper/oraclevg-oracle_lv

                      33011568  28720344   2614324  92% /oracle12c

ORA12c               613414908 340800332 272614576  56% /media/sf_ORA12c

 

root@ora12c2:/>df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2              8256952   5686468   2151056  73% /

tmpfs                  1962100   1273868    688232  65% /dev/shm

/dev/sda1               253871     50456    190308  21% /boot

/dev/sda5               516040     23300    466528   5% /tmp

/dev/mapper/homevg-home_lv

                       2830288    761588   1925164  29% /home

/dev/mapper/oraclevg-oracle_lv

                      33011568  12515524  18819144  40% /oracle12c

ORA12c               613414908 340800332 272614576  56% /media/sf_ORA12c

 

--clustware中也已经没有了ora.acfsdg1.acfsvol11.acfs资源信息

root@ora12c2:/>crsctl status res –t

?  Srvctl add filesystem的使用:

--加入/acfs3资源到clustware resource

root@ora12c2:/>srvctl add[C4]  filesystem -device /dev/asm/acfsvol11-418 -path /acfs3[C5] 

--查看ora.acfsdg1.acfsvol11.acfs资源已经创建但状态为Offline

root@ora12c2:/>crsctl status res –t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details      

--------------------------------------------------------------------------------

Local Resources

ora.acfsdg1.acfsvol11.acfs

               OFFLINE OFFLINE      ora12c1                  STABLE

               OFFLINE OFFLINE      ora12c2                  STABLE

 

--启动资源

srvctl start filesystem -device /dev/asm/acfsvol11-418

 

--查看ora.acfsdg1.acfsvol11.acfs资源已经Mount,检查/acfs3已经在两节点Mount

root@ora12c2:/>crsctl status res –t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details      

--------------------------------------------------------------------------------

Local Resources

ora.acfsdg1.acfsvol11.acfs

               ONLINE  ONLINE       ora12c1                  mounted on /acfs3,ST

                                                             ABLE

               ONLINE  ONLINE       ora12c2                  mounted on /acfs3,ST

                                                             ABLE

 

root@ora12c2:/>df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2              8256952   5686504   2151020  73% /

tmpfs                  1962100   1273924    688176  65% /dev/shm

/dev/sda1               253871     50456    190308  21% /boot

/dev/sda5               516040     23304    466524   5% /tmp

/dev/mapper/homevg-home_lv

                       2830288    761588   1925164  29% /home

/dev/mapper/oraclevg-oracle_lv

                      33011568  12516692  18817976  40% /oracle12c

ORA12c               613414908 340815776 272599132  56% /media/sf_ORA12c

/dev/asm/acfsvol11-418

                        425984     79136    346848  19% /acfs3

 

root@ora12c1:/>df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2              8256952   5686296   2151228  73% /

tmpfs                  1962100   1274368    687732  65% /dev/shm

/dev/sda1               253871     50455    190309  21% /boot

/dev/sda5               516040     23328    466500   5% /tmp

/dev/mapper/homevg-home_lv

                       2830288     36712   2650040   2% /home

/dev/mapper/oraclevg-oracle_lv

                      33011568  28736400   2598268  92% /oracle12c

ORA12c               613414908 340815840 272599068  56% /media/sf_ORA12c

/dev/asm/acfsvol11-418

                        425984     79136    346848  19% /acfs3

 

--查看资源的AUTO_START属性为restore[C6] 

root@ora12c1:/oracle12c>crsctl status res ora.acfsdg1.acfsvol11.acfs -f | grep AUTO_START

AUTO_START=restore

 

--查看registry内容为空[C7] 

root@ora12c1:/>acfsutil registry

结果为空

 


 [C1]此处若加-u USER代表名为USER的用户可以使用srvctl start/stop filesystemmount/umount这个FS;若使用acfsutil registry –d命令也可以起到将FS umount的效果但是会受到如下报错:CRS-0245:  User doesn't have enough privilege to perform the operation

acfsutil registry: ACFS-03145: unable to remove ACFS volume /dev/asm/acfsvol11-418 from Oracle Registry;和srvctl不同的是使用acfsutil registry –a是不能够将FS mount的,因为acfstuil registry –a需要先注册,再Mount,注册的动作只有root能做

 [C2]/acfs1目录不必预先用mkdir创建,注册完后会自动建

 [C3]也可以使用12两条命令代替,效果一样:

1、  srvctl stop filesystem -device /dev/asm/acfsvol11-418

2、  srvctl remove filesystem -device /dev/asm/acfsvol11-418

 [C4]此处若加-u USER的起到的作用同 Acfsutil registry章节

 

 [C5]/acfs3目录会自动创建

 [C6]注意若用acfstutil registry -a注册后,此处属性值是Always

 [C7]为空的原因是使用srvctl add fileystem/acfs3成为了crs-managed acfs filesystem,所以其启动和停止要视资源之间的依赖关系而定。加到registry里意味着每次机器启动后都要启动。所以registry是空的

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/53956/viewspace-1280004/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
不仅仅专注Oracle database技术, member of SHOUG

注册时间:2014-04-06

  • 博文量
    128
  • 访问量
    1641713