Welcome 微信登录

首页 / 数据库 / MySQL / Oracle 11g将数据库移动到不同的ASM磁盘组/修改ASM磁盘组的冗余属性

Oracle使用ASM存储,建库时磁盘组的冗余属性使用了EXTERN,现在想将磁盘组改为NORMAL,以下是具体步骤:1. 新建一个期望属性的新磁盘组[root@Oracle-LAB~]# su - grid[grid@Oracle-LAB ~]$ asmca或者用命令:[grid@Oracle-LAB~]$ sqlplus / as sysasmSQL > CREATE DISKGROUP DATA NORMAL REDUNDANCY DISK "/dev/raw/raw1"SIZE 5120 M DISK "/dev/raw/raw2"SIZE 5120 M DISK "/dev/raw/raw3" SIZE 5120 M;2. 检查磁盘组[grid@Oracle-LAB~]$ sqlplus / as sysasmSQL> select state,name,type from v$asm_diskgroup;STATE NAME TYPE----------- ------------------------------ ------MOUNTED DATA EXTERNMOUNTED FRA EXTERNMOUNTED DATA01 NORMAL3. 备份现有的数据库[oracle@Oracle-LAB ~]$ sqlplus /nologSQL> conn /as sysdbaSQL> show parameter db_nameNAME TYPE VALUE--------------------------- ---------------db_name string ORCL查看当前控制文件的Value:SQL> show parameter controlNAME TYPE VALUE----------------------------------------------- ------------------------------control_file_record_keep_time integer 7control_files string +DATA/orcl/controlfile/current.260.833734379control_management_pack_access string DIAGNOSTIC+TUNING在新磁盘组生成新控制文件有两种方法(推荐方法二):方法一:通过备份现有控制文件来生成:备份控制文件到新磁盘组SQL> alter database backup controlfile to "+DATA01"; Database altered.查看备份后的控制文件:[root@Oracle-LABsoftware]# su - grid[grid@Oracle-LAB ~]$ asmcmdASMCMD> ls +DATA01/ORCL/CONTROLFILE/Backup.256.833381229设定初始化参数:SQL> alter system setcontrol_files="+DATA01/ORCL/CONTROLFILE/Backup.256.833381229" scope=spfile;System altered.关闭数据库并启动至nomount状态(用SQL或RAMAN)[oracle@Oracle-LAB ~]$ rman target /RMAN> shutdown immediate #如果是RAC,需要到另外的节点执行SHUTDOWN命令using targetdatabase control file instead of recovery catalogdatabase closeddatabasedismountedOracle instance shut downRMAN> startup nomountconnected totarget database (not started)Oracle instancestartedTotal SystemGlobal Area 1653518336 bytesFixed Size 2228904 bytesVariableSize 973081944 bytesDatabaseBuffers 671088640 bytesRedo Buffers 7118848 bytes从原控制文件生成现有控制文件:RMAN> restore controlfile from"+DATA/orcl/controlfile/current.259.833372337";Starting restoreat 05-DEC-13allocatedchannel: ORA_DISK_1channelORA_DISK_1: SID=13 device type=DISKchannelORA_DISK_1: copied control file copyoutput file name=+DATA01/orcl/controlfile/backup.256.833381229Finished restore at 05-DEC-13方法二:使用添加控制文件的方法:SQL> alter system set control_files="+DATA/orcl/controlfile/current.260.833734379","+DATA01"scope=spfile;System altered.SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instanceshut down.SQL> startup nomountORACLE instance started.Total System Global Area 1653518336 bytesFixed Size 2228904 bytesVariable Size 973081944 bytesDatabase Buffers 671088640 bytesRedo Buffers 7118848 bytesSQL> quit[oracle@Oracle-LAB~]$ rman target/RMAN> restore controlfile from "+DATA/orcl/controlfile/current.260.833734379";Starting restore at 09-DEC-13using target database control file instead of recoverycatalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=135 device type=DISKchannel ORA_DISK_1: copied control file copyoutput file name=+DATA/orcl/controlfile/current.260.833734379output filename=+DATA01/orcl/controlfile/current.256.833744103Finished restore at 09-DEC-13RMAN> quit Recovery Manager complete.[oracle@Oracle-LAB~]$ sqlplus /nologSQL> conn /as sysdbaConnected.SQL> alter database mount;Database altered.SQL> alter database open;Database altered.SQL> show parameter control;NAME TYPE VALUE------------------------------------ -----------------------------------------control_file_record_keep_time integer 7control_files string +DATA/orcl/controlfile/current.260.833734379,+DATA01/orcl/controlfile/current.256.833744103control_management_pack_access string DIAGNOSTIC+TUNINGSQL> alter system setcontrol_files="+DATA01/orcl/controlfile/current.256.833744103" scope=spfile;System altered.SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1653518336 bytesFixed Size 2228904 bytesVariable Size 973081944 bytesDatabase Buffers 671088640 bytesRedo Buffers 7118848 bytesDatabase mounted.Database opened.SQL> show parameter control;NAME TYPE VALUE------------------------------------ -----------------------------------------control_file_record_keep_time integer 7control_files string +DATA01/orcl/controlfile/current.256.833744103control_management_pack_access string DIAGNOSTIC+TUNING 将数据库启动到mount状态:RMAN> shutdown immediate RMAN> startup nomountRMAN> alter database mount ;database mountedreleased channel: ORA_DISK_1启用RAMN工具,将数据库镜像备份到新磁盘组:RMAN>backup as copy database format "+DATA01";Starting backupat 05-DEC-13allocatedchannel: ORA_DISK_1channelORA_DISK_1: SID=13 device type=DISKchannelORA_DISK_1: starting datafile copyinput datafilefile number=00001 name=+DATA/orcl/datafile/system.264.833372265output filename=+DATA01/orcl/datafile/system.257.833384045 tag=TAG20131205T153405 RECID=3STAMP=833384056channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15channelORA_DISK_1: starting datafile copyinput datafilefile number=00002 name=+DATA/orcl/datafile/sysaux.263.833372265output filename=+DATA01/orcl/datafile/sysaux.258.833384061 tag=TAG20131205T153405 RECID=4STAMP=833384069channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15channelORA_DISK_1: starting datafile copyinput datafilefile number=00005 name=+DATA/orcl/datafile/example.268.833372347output filename=+DATA01/orcl/datafile/example.259.833384075 tag=TAG20131205T153405 RECID=5STAMP=833384080channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:08channelORA_DISK_1: starting datafile copyinput datafilefile number=00003 name=+DATA/orcl/datafile/undotbs1.267.833372265output filename=+DATA01/orcl/datafile/undotbs1.260.833384083 tag=TAG20131205T153405RECID=6 STAMP=833384084channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:03channelORA_DISK_1: starting datafile copycopying currentcontrol fileoutput filename=+DATA01/orcl/controlfile/backup.261.833384087 tag=TAG20131205T153405RECID=7 STAMP=833384086channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:01channelORA_DISK_1: starting datafile copyinput datafilefile number=00004 name=+DATA/orcl/datafile/users.269.833372265output filename=+DATA01/orcl/datafile/users.262.833384087 tag=TAG20131205T153405 RECID=8STAMP=833384087channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:01channelORA_DISK_1: starting full datafile backup setchannelORA_DISK_1: specifying datafile(s) in backup setincluding currentSPFILE in backup setchannel ORA_DISK_1:starting piece 1 at 05-DEC-13channelORA_DISK_1: finished piece 1 at 05-DEC-13piecehandle=+DATA01/orcl/backupset/2013_12_05/nnsnf0_tag20131205t153405_0.263.833384089tag=TAG20131205T153405 comment=NONEchannelORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 05-DEC-13检查备份的数据库镜像RMAN> list copy of database;
  • 1
  • 2
  • 下一页
Oracle 11.2.0.3.0 RAC GI_DB升级到11.2.0.4.0Oracle 11g在ASM磁盘组上添加控制文件相关资讯      ASM  Oracle 11g ASM 
  • Oracle 11g RAC 启动时无法识别ASM  (今 15:36)
  • 监控ASM磁盘组IO吞吐量  (04月10日)
  • ASM学习之概述  (01月12日)
  • Oracle Linux6.7下使用udev做ASM  (07月04日)
  • Oracle 11g ASM新引入的特性  (04月10日)
  • Win远程Linux下的ASM实例  (01月12日)
本文评论 查看全部评论 (0)
表情: 姓名: 字数