1、查看当前ASM磁盘信息登录到ASM实例,查看当前磁盘组的信息:gridrac1 $ sqlplus / as sysasmSQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 22 09:08:26 2016Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Real Application Clu
2、sters and Automatic Storage Management optionsSQL select instance_name from v$instance;INSTANCE_NAME-+ASM1 col name for a10 set linesize 150 select NAME, ALLOCATION_UNIT_SIZE, STATE, TOTAL_MB, FREE_MB USABLE_FILE_MB from gv$asm_diskgroup;NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB USABLE_FILE_MB- - - -
3、 -DATA 1048576 MOUNTED 10240 6721FRA 1048576 MOUNTED 13312 11081SYSTEMDG 1048576 MOUNTED 25600 243446 rows selected. select failgroup, name from v$asm_disk where group_number=(select group_number from v$asm_diskgroup where name = DATA);FAILGROUP NAME- -DATA_0001 DATA_0001DATA_0000 DATA_0000利用asmca命令
4、创建DISKGROUP相关的sql语句 CREATE DISKGROUP DATA2 EXTERNAL REDUNDANCY DISK /dev/asm-diskk SIZE 20480M ATTRIBUTE compatible.asm=11.2.0.0.0,au_size1M /* ASMCA */ CREATE DISKGROUP FRA2 EXTERNAL REDUNDANCY DISK /dev/asm-diskl SIZE 5120M ATTRIBUTE 11.2.0.0.0磁盘组状态ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2
5、 ora.DATA2.dgora.FRA.dgora.FRA2.dgora.LISTENER.lsnr ONLINE OFFLINE rac2 ora.SYSTEMDG.dgora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started gridrac1 $ sqlplus / as sysdba Release 11.2.0.3.0 Production on Wed Jun 22 10:02:37 2016 select name,state from v$asm_diskgroup;NAME STATE- -DATA MOUNT
6、EDFRA MOUNTEDSYSTEMDG MOUNTEDDATA2 MOUNTEDFRA2 MOUNTED二、 迁移OCR和Vote Disks到新磁盘组(ASM diskgroup)查看ocr信息:gridrac1 $ ocrcheckStatus of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2916 Available space (kbytes) : 259204 ID : 997200134 Device/File
7、Name : +SYSTEMDG Device/File integrity check succeeded Device/File not configured Cluster registry integrity check succeeded Logical corruption check bypassed due to non-privileged user添加ocr磁盘组rootrac1 bin# ./ocrconfig -add +DATA2rootrac1 bin# ./ocrcheck +DATA2 Logical corruption check succeeded删除OC
8、R旧磁盘组rootrac1 bin# ./ocrconfig -delete +SYSTEMDG查看Votedisk信息,迁移至新磁盘组gridrac1 $ crsctl query css votedisk# STATE File Universal Id File Name Disk group- - - - - 1. ONLINE b0746a43f93c4ff2bf067cb97ffedf4e (/dev/asm-diskb) SYSTEMDG 2. ONLINE a54ec305b2c94febbf10c7426bad5ab8 (/dev/asm-diskc) SYSTEMDG 3.
9、 ONLINE 3b9ff9c1f7884f02bfedb22d5cdfc463 (/dev/asm-diskd) SYSTEMDG 4. ONLINE a4c764cb429e4fcdbf4ac458b9f51803 (/dev/asm-diske) SYSTEMDG 5. ONLINE 23f5f064b0734f9bbf486a9d3a6df62f (/dev/asm-diskf) SYSTEMDGLocated 5 voting disk(s).gridrac1 $ crsctl replace votedisk +DATA2Successful addition of voting
10、disk 06d88831dc8b4fa0bf0213c802aeb8d8.Successful deletion of voting disk b0746a43f93c4ff2bf067cb97ffedf4e.Successful deletion of voting disk a54ec305b2c94febbf10c7426bad5ab8.Successful deletion of voting disk 3b9ff9c1f7884f02bfedb22d5cdfc463.Successful deletion of voting disk a4c764cb429e4fcdbf4ac45
11、8b9f51803.Successful deletion of voting disk 23f5f064b0734f9bbf486a9d3a6df62f.Successfully replaced voting disk group with +DATA2.CRS-4266: Voting file(s) successfully replaced 1. ONLINE 06d88831dc8b4fa0bf0213c802aeb8d8 (/dev/asm-diskk) DATA2Located 1 voting disk(s).三、Moving server side ASM SPfile t
12、o new ASM diskgroup查看ASM SPFILE 信息,迁移到新磁盘组 gridrac1 $ sqlplus / as sysasm16:53 2016 show parameter spfileNAME TYPE VALUE- - -spfile string +SYSTEMDG/vmac-cluster/asmpara meterfile/registry.253.8654292 27验证spfile路径ASMCMD spget +SYSTEMDG/vmac-cluster/asmparameterfile/registry.253.865429227+SYSTEMDG/vm
13、ac-cluster/asmparameterfile/registry.253.865429227 spget create pfile=/tmp/asm_pfile.ora from spfile create spfile=+DATA2 from pfile=;File created.New SPfile location will be logged on the ASM alert logNOTE: updated gpnp profile ASM SPFILE to +DATA2/dbatst-scan/asmparameterfile/registry.253.82880167
14、5gridrac1 trace$ tail alert_+ASM1.logWed Jun 22 10:41:55 2016 updated gpnp profile ASM diskstring: /dev/asm* updated gpnp profile ASM SPFILE to +DATA2/vmac-cluster/asmparameterfile/registry.253.915187315gridrac1 $ asmcmd+DATA2/vmac-cluster/asmparameterfile/registry.253.915187315 spget +DATA2/vmac-cl
15、uster/asmparameterfile/registry.253.915187315四、 Moving database related files to new ASM diskgroup控制文件迁移 show parameter controlcontrol_file_record_keep_time integer 7control_files string +DATA/dcdb/controlfile/current .256.865439483, +FRA/dcdb/cont rolfile/current.256.865439483/home/oracle/pfile.ora
16、 from spfile; alter system set control_files=+FRA2 scope=spfile sid=*System altered.oraclerac1 $ srvctl stop database -d dcdb启动实例1到nomount状态oraclerac1 $ srvctl start instance -d dcdb -i dcdb1 -o nomountoraclerac1 $ srvctl status instance -d dcdb -i dcdb1Instance dcdb1 is running on node rac1oraclera
17、c1 $ rman target /Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 22 10:56:08 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.connected to target database: DCDB (not mounted)RMAN restore controlfile from +DATA/dcdb/controlfile/current.256.8654394832 ;Star
18、ting restore at 22-JUN-16using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=37 instance=dcdb1 device type=DISK copied control file copyoutput file name=+DATA2/dcdb/controlfile/current.256.915188239output file name=+FRA2/dcdb/controlfile
19、/current.256.915188241Finished restore at 22-JUN-16oraclerac1 $ sqlplus / as sysdba58:24 2016With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing options alter database mount 2 ;Database altered. alter database open ;control_files string +DATA2/dcdb/controlfile/curren t.256.915188239, +FRA2/dcdb/co ntrolfile/current.256.91518824 1五. Moving SPfile to n
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1