How to rename ASM diskgroup DBACLASS
How to rename ASM diskgroup with RAC database. If datafiles are present inside ASM diskgroup i.e if you have a running RAC database inside the diskgroup . then.
oracle clusteringintermediate
by OracleDba
14 views
How to rename ASM diskgroup with RAC database. If datafiles are present inside ASM diskgroup i.e if you have a running RAC database inside the diskgroup . then.
1234567891011121314151617181920212223242526272829
srvctl config database -d TESTDB2
Database unique name: TESTDB2
Database name: TESTDB2
Oracle home: /oracle/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile: +DATATST/TESTDB2/PARAMETERFILE/spfile.268.934027789
Password file: +DATATST/TESTDB2/PASSWORD/pwdtestdb2.256.934026697
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATATST
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dba
Database instances: TESTDB21,TESTDB22
Configured nodes: host1,host2
Database is administrator managed
oracle@:$ srvctl config asm
ASM home:
Password file: +MGMTDB/orapwASM
ASM listener: LISTENER1234567891011121314
SQL> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATATST/TESTDB2/PARAMETERFILE
/spfile.268.934027789
SQL> create pfile='/export/home/oracle/pfiletes.ora' from spfile;
File created.
*.control_files='+NEWTST/TESTDB2/CONTROLFILE/current.257.934026715'
*.db_create_file_dest='+NEWTST'1
srvctl stop database -d TESTDB2123456
ora.DATATST.dg
ONLINE ONLINE host1 STABLE
ONLINE ONLINE host2 STABLE
./crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.12345678910111213141516171819202122232425262728293031323334
asmcmd umount DATATST
$ renamedg phase=both dgname=DATATST newdgname=NEWTST verbose=true
Parsing parameters..
Parameters in effect:
Old DG name : DATATST
New DG name : NEWTST
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: phase=both dgname=DATATST newdgname=NEWTST verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t514F0C57A4E00116d0s6 with disk number:0 and timestamp (33048299 -1573311488)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t514F0C57A4E00116d0s6 with disk number:0 and timestamp (33048299 -1573311488)
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 /dev/rdsk/c0t514F0C57A4E00116d0s6
Modifying the header
Completed phase 2
Terminating kgfd context 1001bdc90123456789101112131415161718192021
asmcmd mount NEWTST
asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 204716 111057 0 111057 0 N DATAPRE/
MOUNTED EXTERN N 512 4096 1048576 20400 15782 0 15782 0 N MGMTDB/
MOUNTED EXTERN N 512 4096 1048576 204759 202496 0 202496 0 N NEWTST/
MOUNTED NORMAL N 512 4096 1048576 20400 19812 0 9906 0 Y OCRVD/
SQL> startup nomount pfile=pfiletes.ora
ORACLE instance started.
Total System Global Area 9328132096 bytes
Fixed Size 7641912 bytes
Variable Size 6039798984 bytes
Database Buffers 3254779904 bytes
Redo Buffers 25911296 bytes
SQL> alter database mount;
Database altered.123456789101112131415161718192021222324252627282930313233343536
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATATST/TESTDB2/DATAFILE/system.260.934026715
+DATATST/TESTDB2/DATAFILE/sysaux.261.934026717
+DATATST/TESTDB2/DATAFILE/undotbs1.262.934026719
+DATATST/TESTDB2/DATAFILE/undotbs2.264.934026727
+DATATST/TESTDB2/DATAFILE/users.265.934026729
alter database rename file '+DATATST/TESTDB2/DATAFILE/system.260.934026715'
to '+NEWTST/TESTDB2/DATAFILE/system.260.934026715';
alter database rename file '+DATATST/TESTDB2/DATAFILE/sysaux.261.934026717'
to '+NEWTST/TESTDB2/DATAFILE/sysaux.261.934026717';
alter database rename file '+DATATST/TESTDB2/DATAFILE/undotbs1.262.934026719'
to '+NEWTST/TESTDB2/DATAFILE/undotbs1.262.934026719';
alter database rename file '+DATATST/TESTDB2/DATAFILE/undotbs2.264.934026727'
to '+NEWTST/TESTDB2/DATAFILE/undotbs2.264.934026727';
alter database rename file '+DATATST/TESTDB2/DATAFILE/users.265.934026729'
to '+NEWTST/TESTDB2/DATAFILE/users.265.934026729';
SQL> select member from gv$Logfile;
MEMBER
--------------------------------------------------------------------------------
+DATATST/TESTDB2/ONLINELOG/group_1.258.934026715
+DATATST/TESTDB2/ONLINELOG/group_2.259.934026715
+DATATST/TESTDB2/ONLINELOG/group_3.266.934027789
+DATATST/TESTDB2/ONLINELOG/group_4.267.934027789
alter database rename file '+DATATST/TESTDB2/ONLINELOG/group_1.258.934026715' to '+NEWTST/TESTDB2/ONLINELOG/group_1.258.934026715';
alter database rename file '+DATATST/TESTDB2/ONLINELOG/group_2.259.934026715' to '+NEWTST/TESTDB2/ONLINELOG/group_2.259.934026715';
alter database rename file '+DATATST/TESTDB2/ONLINELOG/group_3.266.934027789' to '+NEWTST/TESTDB2/ONLINELOG/group_3.266.934027789';
alter database rename file '+DATATST/TESTDB2/ONLINELOG/group_4.267.934027789' to '+NEWTST/TESTDB2/ONLINELOG/group_4.267.934027789';12345678910111213
SQL> select name from v$tempfile;
NAME
------------------------------------------------------------
+DATATST/TESTDB2/TEMPFILE/temp.263.934026719
SQL> alter database rename file '+DATATST/TESTDB2/TEMPFILE/temp.263.934026719' to '+NEWTST/TESTDB2/TEMPFILE/temp.263.934026719';
Database altered.
SQL> create spfile='+NEWTST/TESTDB2/spfiletestdb2.ora' from pfile='/export/home/oracle/pfiletes.ora';
File created.1234
shutdown immediate;
cat initTESTDB21.ora
SPFILE='+NEWTST/TESTDB2/spfileTESTDB2.ora'123
srvctl modify database -d TESTDB2 -spfile +NEWTST/TESTDB2/spfileTESTDB2.ora
srvctl modify database -d TESTDB2 -pwfile +NEWTST/TESTDB2/PASSWORD/pwdtestdb2.256.934026697123456789101112131415161718192021222324252627
srvctl modify database -d TESTDB2 -diskgroup NEWTST
srvctl config database -d TESTDB2
Database unique name: TESTDB2
Database name: TESTDB2
Oracle home: /oracle/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile: +NEWTST/TESTDB2/spfileTESTDB2.ora
Password file: +NEWTST/TESTDB2/PASSWORD/pwdtestdb2.256.934026697
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: NEWTST
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dba
Database instances: TESTDB21,TESTDB22
Configured nodes: host1,host2
Database is administrator managed12345678910
set pagesize 200
set lines 299
col disk_name for a19
col path for a78
select a.NAME DISKGROUP_NAME , b.NAME DISK_NAME , b.path PATH from v$asm_diskgroup A , v$asm_disk b
where a.group_number=b.group_number and a.name='&DISKGROUP_NAME';
DISKGROUP_NAME DISK_NAME PATH
------------------------------ ------------------- ----------------------------------------------------
NEWTST DATATST_0000 /dev/rdsk/c0t514F0C57A4E00116d0s612345678
select a.instance_name,a.db_name,a.status from v$asm_client a, v$asm_diskgroup b
where a.group_number=b.group_number and b.name='NEWTST';
no rows selected
SQL> alter diskgroup NEWTST dismount;
Diskgroup altered.12345678910111213141516171819202122
SQL> alter diskgroup NEWTST mount restricted;
Diskgroup altered.
SQL> alter diskgroup NEWTST rename disk 'DATATST_0000' to 'NEWTST_0000';
Diskgroup altered.
SQL> set pagesize 200
set lines 299
col disk_name for a19
col path for a78
select a.NAME DISKGROUP_NAME , b.NAME DISK_NAME , b.path PATH from v$asm_diskgroup A , v$asm_disk b
where a.group_number=b.group_number and a.name='&DISKGROUP_NAME';
Enter value for diskgroup_name: NEWTST
old 2: where a.group_number=b.group_number and a.name='&DISKGROUP_NAME'
new 2: where a.group_number=b.group_number and a.name='NEWTST'
DISKGROUP_NAME DISK_NAME PATH
------------------------------ ------------------- ------------------------------------------------------------------------------
NEWTST NEWTST_0000 /dev/rdsk/c0t514F0C57A4E00116d0s61234567
SQL> alter diskgroup NEWTST dismount;
Diskgroup altered.
SQL> alter diskgroup NEWTST mount;
Diskgroup altered.1
crsctl enable hasPlease to add comments
No comments yet. Be the first to comment!