Tuesday, 17 December 2019

Rename Existing Diskgroup and create new disk group in Oracle ASM


Rename Existing Diskgroup and create new disk group in Oracle ASM

RMAN> alter database open resetlogs;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 12/18/2019 10:25:39
ORA-00349: failure obtaining block size for '+LOG1/bacdb/redo01a.rdo'
ORA-15001: diskgroup "LOG1" does not exist or is not mounted
ORA-15001: diskgroup "LOG1" does not exist or is not mounted
ORA-15001: diskgroup "LOG1" does not exist or is not mounted

RMAN>


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  NORMAL  N         512   4096  1048576   6752416   447285           306928           70178              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576   1227964  1216729                0         1216729              0             N  UFRA/
MOUNTED  EXTERN  N         512   4096  1048576     20267     8929                0            8929              0             N  ULOG1/
MOUNTED  EXTERN  N         512   4096  1048576     20267     8929                0            8929              0             N  ULOG2/
MOUNTED  EXTERN  N         512   4096  1048576     20267     8929                0            8929              0             N  ULOG3/
ASMCMD>

-bash-4.1$ sqlplus

SQL*Plus: Release 12.1.0.2.0 Production on Wed Dec 18 10:32:17 2019

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter user-name: /as sysasm

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> alter diskgroup ulog1 dismount;

Diskgroup altered.

SQL> alter diskgroup ulog2 dismount;

Diskgroup altered.

SQL> alter diskgroup ulog3 dismount;

Diskgroup altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option
-bash-4.1$ asmcmd
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  NORMAL  N         512   4096  1048576   6752416   447285           306928           70178              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576   1227964  1216729                0         1216729              0             N  UFRA/
ASMCMD>


renamedg dgname=ulog1 newdgname=log1 verbose=true check=true

-bash-4.1$ renamedg dgname=ulog1 newdgname=log1 verbose=true check=true

Parsing parameters..

Parameters in effect:

         Old DG name       : ULOG1
         New DG name          : LOG1
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Check              : TRUE
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=ulog1 newdgname=log1 verbose=true check=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5D1E6BE161d0s0 with disk number:0 and timestamp (33091441 -1849335808)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5D1E6BE161d0s0 with disk number:0 and timestamp (33091441 -1849335808)
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/c0t600601607E734D001E78DB5D1E6BE161d0s0
Leaving the header unchanged
Completed phase 2
Terminating kgfd context 1001bdc90
-bash-4.1$



-bash-4.1$ renamedg dgname=ulog2 newdgname=log2 verbose=true check=true

Parsing parameters..

Parameters in effect:

         Old DG name       : ULOG2
         New DG name          : LOG2
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Check              : TRUE
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=ulog2 newdgname=log2 verbose=true check=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5D99FC3B3Cd0s0 with disk number:0 and timestamp (33091441 -1832428544)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5D99FC3B3Cd0s0 with disk number:0 and timestamp (33091441 -1832428544)
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/c0t600601607E734D001E78DB5D99FC3B3Cd0s0
Leaving the header unchanged
Completed phase 2
Terminating kgfd context 1001bdc90
-bash-4.1$

-bash-4.1$ renamedg dgname=ulog3 newdgname=log3 verbose=true check=true

Parsing parameters..

Parameters in effect:

         Old DG name       : ULOG3
         New DG name          : LOG3
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Check              : TRUE
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=ulog3 newdgname=log3 verbose=true check=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0 with disk number:0 and timestamp (33091441 -1809569792)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rdsk/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0 with disk number:0 and timestamp (33091441 -1809569792)
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/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0
Leaving the header unchanged
Completed phase 2
Terminating kgfd context 1001bdc90
-bash-4.1$

-bash-4.1$ asmcmd lsdg -g ulog1
ASMCMD-8001: diskgroup 'ulog1' does not exist or is not mounted
-bash-4.1$ asmcmd lsdg -g log1
ASMCMD-8001: diskgroup 'log1' does not exist or is not mounted
-bash-4.1$

-bash-4.1$ asmcmd lsdg --discovery
State       Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED     NORMAL  N         512   4096  1048576   6752416   447285           306928           70178              0             N  DATA/
MOUNTED     EXTERN  N         512   4096  1048576   1227964  1216729                0         1216729              0             N  UFRA/
DISMOUNTED          N           0      0        0         0        0                0               0              0             N  ULOG1/
DISMOUNTED          N           0      0        0         0        0                0               0              0             N  ULOG2/
DISMOUNTED          N           0      0        0         0        0                0               0              0             N  ULOG3/
-bash-4.1$

SQL> select name ,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
ULOG2                          DISMOUNTED
ULOG3                          DISMOUNTED
DATA                           MOUNTED
ULOG1                          DISMOUNTED
UFRA                           MOUNTED

SQL>

 clean up the asm disk header of all the disks in the diskgroup

dd if=/dev/zero of=/dev/oracle/dg/c11t7d0 bs=8192 count=100

dd if=/dev/zero of=/dev/rdsk/c0t600601607E734D001E78DB5D1E6BE161d0s0 bs=8192 count=100

SQL> select name ,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
ULOG2                          DISMOUNTED
ULOG3                          DISMOUNTED
DATA                           MOUNTED
UFRA                           MOUNTED

SQL>

 clean up the asm disk header of all the disks in the diskgroup

dd if=/dev/zero of=/dev/rdsk/c0t600601607E734D001E78DB5D99FC3B3Cd0s0 bs=8192 count=100
dd if=/dev/zero of=/dev/rdsk/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0 bs=8192 count=100

root@badb1-t7-2:~# dd if=/dev/zero of=/dev/rdsk/c0t600601607E734D001E78DB5D99FC3B3Cd0s0 bs=8192 count=100
100+0 records in
100+0 records out
root@badb1-t7-2:~# dd if=/dev/zero of=/dev/rdsk/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0 bs=8192 count=100
100+0 records in
100+0 records out
root@badb1-t7-2:~#

SQL> select name ,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
DATA                           MOUNTED
UFRA                           MOUNTED

SQL>

CREATE DISKGROUP LOG1
EXTERNAL REDUNDANCY
  DISK '/dev/rdsk/c0t600601607E734D001E78DB5D1E6BE161d0s0' SIZE 20267M NOFORCE
ATTRIBUTE
  'AU_SIZE'='1048576',
  'COMPATIBLE.RDBMS'='11.1.0.0.0',
  'COMPATIBLE.ASM'='11.1.0.0.0';
ALTER DISKGROUP LOG1
  SET ATTRIBUTE 'DISK_REPAIR_TIME' = '3.6 H';
 
 
CREATE DISKGROUP LOG2
EXTERNAL REDUNDANCY
  DISK '/dev/rdsk/c0t600601607E734D001E78DB5D99FC3B3Cd0s0' SIZE 20267M NOFORCE
ATTRIBUTE
  'AU_SIZE'='1048576',
  'COMPATIBLE.RDBMS'='11.1.0.0.0',
  'COMPATIBLE.ASM'='11.1.0.0.0';
ALTER DISKGROUP LOG2
  SET ATTRIBUTE 'DISK_REPAIR_TIME' = '3.6 H'; 


CREATE DISKGROUP LOG3
EXTERNAL REDUNDANCY
  DISK '/dev/rdsk/c0t600601607E734D001E78DB5DFF0A0E8Ed0s0' SIZE 20267M NOFORCE
ATTRIBUTE
  'AU_SIZE'='1048576',
  'COMPATIBLE.RDBMS'='11.1.0.0.0',
  'COMPATIBLE.ASM'='11.1.0.0.0';
ALTER DISKGROUP LOG3
  SET ATTRIBUTE 'DISK_REPAIR_TIME' = '3.6 H'; 

  SQL> select name ,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
LOG2                           MOUNTED
LOG1                           MOUNTED
LOG3                           MOUNTED
DATA                           MOUNTED
UFRA                           MOUNTED

SQL>

No comments:

Post a Comment