ASM中怎么重命名kgroup


本篇文章给大家分享的是有关ASM中怎么重命名kgroup,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。ASM 11.2.0.1 版本开始增加了diskgroup重命名的新功能,通过renamedg命令重命名已经创建的diskgroup,重命名前需要先dismount diskgroup。如果重命名的diskgroup已经用于存储数据库的数据文件,那么需要手动同步数据文件的位置。–检查ASM diskgroup当前名字为DGASMDB$ su – grid$ sqlplus / as sysasmSQL> select GROUP_NUMBER,name,state,type, offline_disks, ALLOCATION_UNIT_SIZE,BLOCK_SIZE,TOTAL_MB,FREE_MB from v$asm_diskgroup;GROUP_NUMBER NAME STATE TYPE OFFLINE_DISKS ALLOCATION_UNIT_SIZE BLOCK_SIZE TOTAL_MB FREE_MB———— ———- ——– —— ————- ——————– ———- ———- ———- 1DGASMDB MOUNTED EXTERN 0 1048576 4096 3992 1879–检查数据库当前信息(spfile/controlfile/datafile/redo)su – oracle$ sqlplus / as sysdbaSQL> show parameter spfile;NAME TYPE VALUE———————————— ———– ——————————spfile string +DGASMDB/asmdb/spfileasmdb.oraSQL> show parameter control NAME TYPE VALUE———————————— ———– ——————————control_files string +DGASMDB/asmdb/controlfile/current.256.856653049SQL> select name from v$datafile;NAME————————-免费云主机域名——————————————————-+DGASMDB/asmdb/datafile/system.260.856653053+DGASMDB/asmdb/datafile/sysaux.261.856653059+DGASMDB/asmdb/datafile/undotbs1.262.856653061+DGASMDB/asmdb/datafile/users.264.856653075+DGASMDB/asmdb/datafile/asm_test.dbfSQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.–dismount diskgroup dgasmdb$ su – grid$ asmcmd umount dgasmdb–重命令diskgroup,新的diskgroup名为dgasmdb_new$ renamedg phase=both dgname=dgasmdb newdgname=dgasmdb_new verbose=true Parsing parameters..Parameters in effect: Old DG name : DGASMDB New DG name : DGASMDB_NEW Phases : Phase 1 Phase 2 Discovery str : (null) Clean : TRUE Raw only : TRUErenamedg operation: phase=both dgname=dgasmdb newdgname=dgasmdb_new verbose=trueExecuting phase 1Discovering the groupPerforming discovery with string:Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:ASMDISK4G1 with disk number:0 and timestamp (33006423 142494720)Checking for hearbeat…Re-discovering the groupPerforming discovery with string:Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:ASMDISK4G1 with disk number:0 and timestamp (33006423 142494720)Checking if the diskgroup is mounted or used by CSSChecking disk number:0Generating configuration file..Completed phase 1Executing phase 2Looking for ORCL:ASMDISK4G1Modifying the headerCompleted phase 2Terminating kgfd context 0x7fa6c2bee0a0–mount新的diksgroup dgasmdb_new$ asmcmd mount dgasmdb_new–查看新的diskgroup信息SQL> select GROUP_NUMBER,name,state,type, offline_disks, ALLOCATION_UNIT_SIZE,BLOCK_SIZE,TOTAL_MB,FREE_MB from v$asm_diskgroup;GROUP_NUMBER NAME STATE TYPE OFFLINE_DISKS ALLOCATION_UNIT_SIZE BLOCK_SIZE TOTAL_MB FREE_MB———— ———– ——– —— ————- ——————– ———- ———- ———- 1DGASMDB_NEWMOUNTED EXTERN 0 1048576 4096 3992 1879–修改DB 初始化参数(/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initasmdb.ora)配置信息原来:SPFILE=’+DGASMDB/asmdb/spfileasmdb.ora’修改后:SPFILE=’+DGASMDB_NEW/asmdb/spfileasmdb.ora’–启动数据库nomountsu – oraclesqlplus / as sysdbastartup nomount;–修改control_files参数:SQL> alter system set control_files=’+DGASMDB_NEW/asmdb/controlfile/current.256.856653049′ scope=spfile;SQL> shutdown immediate;SQL> startup mount;SQL> show parameter control_filesNAME TYPE VALUE———————————— ———– ——————————control_files string +DGASMDB_NEW/asmdb/controlfile /current.256.856653049–确认当前记录的datafile还是位于原来diskgroup DGASMDBSQL> select FILE#,name from v$datafile; FILE# NAME———- —————————————————————————————————- 1 +DGASMDB/asmdb/datafile/system.260.856653053 2 +DGASMDB/asmdb/datafile/sysaux.261.856653059 3 +DGASMDB/asmdb/datafile/undotbs1.262.856653061 4 +DGASMDB/asmdb/datafile/users.264.856653075 5 +DGASMDB/asmdb/datafile/asm_test.dbfSQL> select file#, name from v$tempfile; FILE# NAME———- ——————————————————————————– 1 +DGASMDB/asmdb/tempfile/temp.263.856653061–修改datafile/tempfile位置:SQL> conn / as sysdbaSQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/datafile/system.260.856653053’ TO ‘+DGASMDB_NEW/asmdb/datafile/system.260.856653053’;SQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/datafile/sysaux.261.856653059’ TO ‘+DGASMDB_NEW/asmdb/datafile/sysaux.261.856653059’;SQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/datafile/undotbs1.262.856653061’ TO ‘+DGASMDB_NEW/asmdb/datafile/undotbs1.262.856653061’;SQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/datafile/users.264.856653075’ TO ‘+DGASMDB_NEW/asmdb/datafile/users.264.856653075’;SQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/datafile/asm_test.dbf’ TO ‘+DGASMDB_NEW/asmdb/datafile/asm_test.dbf’;SQL> ALTER DATABASE RENAME FILE ‘+DGASMDB/asmdb/tempfile/temp.263.856653061’ TO ‘+DGASMDB_NEW/asmdb/tempfile/temp.263.856653061’;–修改后确认:SQL> select FILE#,name from v$datafile; FILE# NAME———- —————————————————————————————————- 1 +DGASMDB_NEW/asmdb/datafile/system.260.856653053 2 +DGASMDB_NEW/asmdb/datafile/sysaux.261.856653059 3 +DGASMDB_NEW/asmdb/datafile/undotbs1.262.856653061 4 +DGASMDB_NEW/asmdb/datafile/users.264.856653075 5 +DGASMDB_NEW/asmdb/datafile/asm_test.dbf–修改redo log位置alter database rename file ‘+DGASMDB/asmdb/onlinelog/group_1.257.856653049’ to ‘+DGASMDB_NEW/asmdb/onlinelog/group_1.257.856653049’;alter database rename file ‘+DGASMDB/asmdb/onlinelog/group_2.258.856653051’ to ‘+DGASMDB_NEW/asmdb/onlinelog/group_2.258.856653051’;alter database rename file ‘+DGASMDB/asmdb/onlinelog/group_3.259.856653051’ to ‘+DGASMDB_NEW/asmdb/onlinelog/group_3.259.856653051’;select * from v$logfile;–启动数据库SQL> alter database open; 以上就是ASM中怎么重命名kgroup,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注百云行业资讯频道。

相关推荐: MongoDB中怎么使用唯一索引

这篇文章将为大家详细讲解有关MongoDB中怎么使用唯一索引,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。 唯一索引的主要目的是用在某一个字段上,使该字段的内容不重复。范例:创建一个唯一索引> db.em…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 01/04 16:35
下一篇 01/04 16:35