本篇内容主要讲解“oracle怎么移动OCR , Vote File , ASM SPILE到新的磁盘组”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“oracle怎么移动OCR , Vote File , ASM SPILE到新的磁盘组”吧!在11GR2的环境下,将rac的OCR , Vote File , ASM SPILE迁移到到新的磁盘组。现在的磁盘状态:[root@rac1 ~]# crsctl query css votedisk## STATE File Universal Id File Name Disk group– —– —————– ——— ———1. ONLINE 0c9ec99614ed4fe4bfdba4cb520dd00e (/dev/raw/raw1) [OCRVOTING]Located 1 voting
disk(s).[root@rac1 ~]#
ocrcheckStatus of Oracle
Cluster Registry is as follows :Version : 3Total space (kbytes) : 262120Used space (kbytes) : 2544Available space (kbytes) : 259576ID : 827782161Device/File Name : +OCRVOTING Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File
not configured Cluster registry integrity check succeeded Logical corruption check succeeded
SQL> set line 300SQL> col
failgroup for a40SQL> col name
for a30SQL> select
DISK_NUMBER,REDUNDANCY,name,FAILGROUP,VOTING_FILE from v$asm_disk;DISK_NUMBER REDUNDANCY NAME FAILGROUP VOT———–
———- ————— —————- — 1 UNKNOWN OCRVOTING_0001 OCRVOTING_0001 N 0 UNKNOWN RAC_DATA_0000 RAC_DATA_0000 N 0 UNKNOWN OCRVOTING_0000 OCRVOTING_0000 Y 2 UNKNOWN OCRVOTING_0002 OCRVOTING_0002 NSQL> select
name,total_mb,free_mb,usable_file_mb from v$asm_diskgroup;NAME TOTAL_MB FREE_MB USABLE_FILE_MB————-
———- ———- ————–OCRVOTING 2997 2597 2597RAC_DATA 9993 8077 8077可以看到,ocr磁盘组冗余度为external,而且是使用的裸设备,下面将ocr磁盘组移动到冗余度为normal类型的磁盘组里。首先分配三块盘,因为是自己的测试环境,不需要太大,每块盘1G就可以。创建共享磁盘Cmd命令:vmware-vdiskmanager.exe
-c -s 1000Mb -a lsilogic -t 2 F:RACsharediskocrdisk01.vmdkvmware-vdiskmanager.exe
-c -s 1000Mb -a lsilogic -t 2 F:RACsharediskocrdisk02.vmdkvmware-vdiskmanager.exe
-c -s 1000Mb -a lsilogic -t 2 F:RACsharediskocrdisk03.vmdk两个虚拟机配置文件追加如下内容scsi1:5.present
= “TRUE”scsi1:5.mode =
“independent-persistent”scsi1:5.filename
= “F:RACsharediskocrdisk01.vmdk”scsi1:5.deviceType
= “plainDisk”scsi1:6.present
= “TRUE”scsi1:6.mode =
“independent-persistent”scsi1:6.filename
= “F:RACsharediskocrdisk02.vmdk”scsi1:6.deviceType
= “plainDisk”scsi1:8.present
= “TRUE”scsi1:8.mode =
“independent-persistent”scsi1:8.filename
= “F:RACsharediskocrdisk03.vmdk”scsi1:8.deviceType
= “plainDisk”注意这里不能用7,7是系统保留的,不可用。查看新增盘:[root@rac1 ~]#
fdisk -l|grep sdDisk /dev/sda:
19.3 GB, 19327352832 bytes/dev/sda1 * 1 64 512000 83 Linux/dev/sda2 64 1306 9972736 8e Linux LVM/dev/sda3 1306 1566 2093135 8e Linux LVM/dev/sda4 1567 2349 6289447+ 8e Linux LVMDisk /dev/sdb:
1048 MB, 1048576000 bytes/dev/sdb1 1 1000 1023984 83 LinuxDisk /dev/sdc:
1048 MB, 1048576000 bytes/dev/sdc1 1 1000 1023984 83 LinuxDisk /dev/sdd:
10.5 GB, 10485760000 bytes/dev/sdd1 1 1274 10233373+ 83 LinuxDisk /dev/sde:
1048 MB, 1048576000 bytes/dev/sde1 1 1000 1023984 83 LinuxDisk /dev/sdf:
1048 MB, 1048576000 bytesDisk /dev/sdg:
1048 MB, 1048576000 bytesDisk /dev/sdh:
1048 MB, 1048576000 bytessdf,sdg,sdh是我们新分配的三块盘。编辑60-raw.rules文件:[root@rac1
rules.d]# more 60-raw.rules# Enter raw
device bindings here.## An example
would be:# ACTION==”add”, KERNEL==”sda”, RUN+=”/bin/raw
/dev/raw/raw1 %N”# to bind
/dev/raw/raw1 to /dev/sda, or# ACTION==”add”,
ENV{MAJOR}==”8″, ENV{MINOR}==”1″, RUN+=”/bin/raw
/dev/raw/raw2 %M %m”# to bind
/dev/raw/raw2 to the device with major 8, minor 1.ACTION==”add”,
KERNEL==”sdb1″,RUN+=”/bin/raw /dev/raw/raw1 %N”ACTION==”add”,
KERNEL==”sdc1″,RUN+=”/bin/raw /dev/raw/raw2 %N”ACTION==”add”,
KERNEL==”sdd1″,RUN+=”/bin/raw /dev/raw/raw3 %N”ACTION==”add”,
KERNEL==”sde1″,RUN+=”/bin/raw /dev/raw/raw4 %N”ACTION==”add”,
KERNEL==”sdf”,RUN+=”/bin/raw /dev/raw/raw5 %N”ACTION==”add”,
KERNEL==”sdg”,RUN+=”/bin/raw /dev/raw/raw6 %N”ACTION==”add”,
KERNEL=免费主机域名=”sdh”,RUN+=”/bin/raw /dev/raw/raw7 %N”ACTION==”add”,KERNEL==”raw[1-7]”,
OWNER=”grid”, GROUP=”oinstall”, MODE=”660″重启udev并检查[root@rac1 ~]#
start_udevStarting udev:
[ OK ][grid@rac1 ~]$
cd /dev/raw[grid@rac1 raw]$
lltotal 0crw-rw—- 1
grid oinstall 162, 1 Jun 10 23:44 raw1crw-rw—- 1
grid oinstall 162, 2 Jun 10 23:43 raw2crw-rw—- 1
grid oinstall 162, 3 Jun 10 23:43 raw3crw-rw—- 1
grid oinstall 162, 4 Jun 10 23:43 raw4crw-rw—- 1
grid oinstall 162, 5 Jun 10 23:43 raw5crw-rw—- 1
grid oinstall 162, 6 Jun 10 23:43 raw6crw-rw—- 1
grid oinstall 162, 7 Jun 10 23:43 raw7crw-rw—- 1
root disk 162, 0 Jun 10 23:43
rawctl图形界面创建OCRDG,这部分比较简单省略:[grid@rac1 raw]$
asmca图形界面创建成功之后,点击了mount all,下面验证一下新创建的磁盘组是否已经mount:[grid@rac1 raw]$
sqlplus / as sysasmSQL> col name
for a20SQL> select
NAME,GROUP_NUMBER,STATE,type,TOTAL_MB,FREE_MB,usable_file_mb,VOTING_FILES
from v$asm_diskgroup;NAME GROUP_NUMBER STATE TYPE TOTAL_MB FREE_MB
USABLE_FILE_MB VOT———–
———— ——– ——- ———- ———- ————– —OCRVOTING 1 MOUNTED EXTERN 2997 2597 2597 NRAC_DATA 2 MOUNTED EXTERN 9993 8077 8077 NOCRDG 3 MOUNTED NORMAL 3000 2715 1310 N可以看到新创建的ocrdg磁盘组的状态已经mount,类型是normal。磁盘状态:SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,NAME,VOTING_FILE
from v$asm_disk;GROUP_NUMBER
DISK_NUMBER MOUNT_STATUS NAME VOT————
———– ——————— ——————– — 1 2 CACHED OCRVOTING_0002 N 1 1 CACHED OCRVOTING_0001 N 1 0 CACHED OCRVOTING_0000 Y 2 0 CACHED RAC_DATA_0000 N 3 2 CACHED OCRDG_0002 N 3 1 CACHED OCRDG_0001 N 3 0 CACHED OCRDG_0000 N7 rows selected.也可以用下面命令验证:[grid@rac1 raw]$
asmcmd lsdgasm pfile文件位置:[grid@rac1 ~]$ asmcmd spget+OCRVOTING/rac-cluster/asmparameterfile/registry.253.952478315备份之前的OCR,OLR,单节点:[root@rac1
rules.d]# ocrconfig -manualbackup[root@rac1
rules.d]# ocrconfig -local -manualbackup将新磁盘组增加到OCR,root用户:[root@rac1 rules.d]#
/tpsys/app/11.2.0/grid/bin/ocrconfig -add +OCRDG检查crs日志,命令行确认:此时的crs日志:2018-06-12
06:19:30.517: [ OCRRAW][2996766464]propriowv_bootbuf: Vote information on disk 1
[+OCRDG] is adjusted from [0/0] to [1/2]2018-06-12
06:19:30.546: [ OCRRAW][2996766464]propriowv_bootbuf:
Vote information on disk 0 [+OCRVOTING] is adjusted from [2/2] to [1/2][root@rac1
rules.d]# ocrcheckStatus of Oracle
Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2596 Available space (kbytes) : 259524 ID : 827782161 Device/File Name : +OCRVOTING Device/File
integrity check succeeded Device/File Name : +OCRDG Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check succeeded将旧的磁盘组踢出:[root@rac1
rules.d]# /tpsys/app/11.2.0/grid/bin/ocrconfig -delete +OCRVOTING检查crs日志,命令行确认:此时的crs日志:2018-06-12
06:28:07.526: [ OCRRAW][2986276608]propriowv_bootbuf: Vote information on disk 1 [] is
adjusted from [1/2] to [2/2]2018-06-12
06:28:07.647: [ OCRASM][2986276608]proprasmo: ASM cache size is [5MB]2018-06-12
06:28:07.647: [ OCRASM][2986276608]proprasmo: ASM cache [5MB] enabled for disk group
[OCRDG].2018-06-12
06:28:07.693: [ OCRRAW][2986276608]proprioo: for disk 0 (+OCRDG), id match (1), total
id sets, (2) need recover (0), my votes (2), total votes (2), commit_lsn (68),
lsn (68)[root@rac1 rules.d]# ocrcheckStatus of Oracle
Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2596 Available space (kbytes) : 259524 ID : 827782161 Device/File Name : +OCRDG Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical
corruption check succeeded替换vote disk:[root@rac1 rules.d]# crsctl query css votedisk## STATE File Universal Id File Name Disk group– —– —————– ——— ———1. ONLINE 0c9ec99614ed4fe4bfdba4cb520dd00e (/dev/raw/raw1) [OCRVOTING]Located 1 voting
disk(s).[root@rac1 rules.d]#
/tpsys/app/11.2.0/grid/bin/crsctl replace votedisk +OCRDGSuccessful
addition of voting disk 0a80756b9eb44f9abfae577e0e8ed2dd.Successful
addition of voting disk 000808a364544f11bf48969149e2bf2a.Successful
addition of voting disk 8714d5dd04634f70bf3bbd8ae1a467ac.Successful
deletion of voting disk 0c9ec99614ed4fe4bfdba4cb520dd00e.Successfully
replaced voting disk group with +OCRDG.CRS-4266: Voting
file(s) successfully replaced验证,root用户:[root@rac1 rules.d]# crsctl query css votedisk## STATE File Universal Id File Name Disk group– —– —————– ——— ———1. ONLINE 0a80756b9eb44f9abfae577e0e8ed2dd (/dev/raw/raw5) [OCRDG]2. ONLINE 000808a364544f11bf48969149e2bf2a (/dev/raw/raw6) [OCRDG]3. ONLINE 8714d5dd04634f70bf3bbd8ae1a467ac (/dev/raw/raw7) [OCRDG]Located 3 voting
disk(s).创建asm pfile到新的磁盘组:[grid@rac1 ~]$
sqlplus / as sysasmSQL> create pfile=’/tmp/asmpfile.ora’
from spfile;File created.SQL> create spfile=’+OCRDG’ from
pfile=’/tmp/asmpfile.ora’;File created.[grid@rac1 ~]$
asmcmd spget+OCRDG/rac-cluster/asmparameterfile/registry.253.978589927使用新的pfile文件重启集群:crsctl stop crscrsctl start crs[grid@rac2 ~]$
crsctl stat res -t——————————————————————————–NAME TARGET STATE SERVER STATE_DETAILS——————————————————————————–Local Resources——————————————————————————–ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.OCRDG.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.OCRVOTING.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.RAC_DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.eons ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 ——————————————————————————–Cluster Resources——————————————————————————–ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.oc4j 1 OFFLINE OFFLINEora.rac1.vip 1 ONLINE ONLINE rac1ora.rac2.vip 1 ONLINE ONLINE rac2ora.ractest.db 1 ONLINE ONLINE免费主机域名 rac1 Open 2 ONLINE ONLINE rac2 Openora.scan1.vip 1 ONLINE ONLINE rac1成功完成!到此,相信大家对“oracle怎么移动OCR , Vote File , ASM SPILE到新的磁盘组”有了更深的了解,不妨来实际操作一番吧!这里是云技术网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
这篇文章主要介绍redhat7 Oracle 12C如何安装,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!redhat7 Oracle 12C 安装系统安装系统语言选择英文,中文系统安装oracle会乱码。我选择手动分区,交换分区给20…