ASM管理 - 如何重新命名diskgroup
ASM管理 - 如何重新命名diskgroup
如果重新命名的diskgroup已經用於儲存資料庫的資料檔案,那麼需要手動同步資料檔案的位置。
--檢查ASM diskgroup當前名字為DGASMDB
$ su - grid
$ sqlplus / as sysasm
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
------------ ---------- -------- ------ ------------- -------------------- ---------- ---------- ----------
1 DGASMDB MOUNTED EXTERN 0 1048576 4096 3992 1879
--檢查資料庫當前資訊(spfile/controlfile/datafile/redo)
su - oracle
$ sqlplus / as sysdba
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DGASMDB/asmdb/spfileasmdb.ora
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DGASMDB/asmdb/controlfile/current.256.856653049
SQL> 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.dbf
SQL> 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 : TRUE
renamedg operation: phase=both dgname=dgasmdb newdgname=dgasmdb_new verbose=true
Executing phase 1
Discovering the group
Performing 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 group
Performing 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 CSS
Checking disk number:0
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:ASMDISK4G1
Modifying the header
Completed phase 2
Terminating 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
------------ ----------- -------- ------ ------------- -------------------- ---------- ---------- ----------
1 DGASMDB_NEW MOUNTED 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'
--啟動資料庫nomount
su - oracle
sqlplus / as sysdba
startup 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_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DGASMDB_NEW/asmdb/controlfile
/current.256.856653049
--確認當前記錄的datafile還是位於原來diskgroup DGASMDB
SQL> 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.dbf
SQL> select file#, name from v$tempfile;
FILE# NAME
---------- --------------------------------------------------------------------------------
1 +DGASMDB/asmdb/tempfile/temp.263.856653061
--修改datafile/tempfile位置:
SQL> conn / as sysdba
SQL> 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;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2141856/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 學習ASM技術(三)--diskgroup管理ASM
- 學習ASM技術(二)--diskgroup管理ASM
- Asm diskgroup 的修復ASM
- script of check repair ASM DISKGROUPAIASM
- 給ASM例項增加diskgroupASM
- Using FTP Transferring Non-ASM Datafiles to ASM diskgroupFTPASM
- oracle 11gR2 新特性 diskgroup 重新命名Oracle
- oracle asm diskgroup add datafile error problemOracleASMError
- 新建或修改ASM diskgroup 的問題ASM
- How to move ASM database files from one diskgroup to anotherASMDatabase
- votedisk在ASM diskgroup上的存放規律ASM
- 檢查asm磁碟組狀態的檢視v$asm_diskgroupASM
- Linux 磁碟對應 ASM diskgroup 中的磁碟LinuxASM
- 在ASM Diskgroup間移動資料檔案ASM
- 向ASM diskgroup中新增磁碟的例行檢查ASM
- ASM Diskgroup Can Not Be Shown When Creating Database With DBCAASMDatabase
- solaris 10_oracle asm_diskgroup_failgroup_相關OracleASMAI
- ASM diskgroup dismount with "Waited 15 secs for write IO to PST"ASMAI
- How to free space from an ASM diskgroup? (Doc ID 1553744.1)ASM
- How to restore ASM based OCR after complete loss of the CRS diskgroupRESTASM
- 使用CREATE DISKGROUP語句建立ASM磁碟組,提示找不到相應的ASM磁碟ASM
- 最近的一次ASM diskgroup線上遷移記錄ASM
- 【oracle 12c asm專題】flex diskgroup相關概念OracleASMFlex
- 當asm file的REDUNDANCY值高於diskgroup的REDUNDANCY時ASM
- 【RAC】Diskgroup shows offline after restart even it is mounted in ASM instanceRESTASM
- ASM重新命名包含OCR/vote file的磁碟組ASM
- 【ASM學習】ASM 管理ASM
- ASM管理ASM
- 將asm上datafile移動到其他的diskgroup或者普通filesystem上ASM
- ORA-15055 ASM Diskgroup Status Showing Dismounted From RDBMS InstanceASM
- solaris 10_oracle10g asm_create_alter_diskgroup相關命令OracleASM
- ASM磁碟空間假裝耗盡,ORA-15041: diskgroup space exhaustedASM
- Oracle 11g RAC 建立例項DBCA無法發現ASM DiskgroupOracleASM
- oracle 10g asm_第二回_diskgroup_strings_Oracle 10gASM
- Oracle ASM 管理OracleASM
- ASM 管理篇ASM
- asm 的管理ASM
- 如何給asm管理的db映象controlfileASM