Tuesday, 17 December 2019

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



-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>


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>

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

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>

Friday, 29 November 2019

ORA-00600: internal error code, arguments: [4194], [59], [58], [], [], [], [], [], [], [], [], []

Error:

Block recovery completed at rba 431394.4853.16, scn 3257.2985719940
Errors in file /d01/app/oracle/diag/rdbms/bacdbpr/bacdb/trace/bacdb_m000_3280.trc  (incident=1907003) (PDBNAME=CDB$ROOT):
ORA-00600: internal error code, arguments: [4194], [59], [58], [], [], [], [], [], [], [], [], []
Incident details in: /d01/app/oracle/diag/rdbms/bacdbpr/bacdb/incident/incdir_1907003/bacdb_m000_3280_i1907003.trc
Thu Nov 28 13:01:39 2019
Dumping diagnostic data in directory=[cdmp_20191128130139], requested by (instance=1, osid=4294970576 (M000)), summary=[incident=1907003].
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Thu Nov 28 13:01:40 2019
Errors in file /d01/app/oracle/diag/rdbms/bacdbpr/bacdb/trace/bacdb_m000_3280.trc:
ORA-00600: internal error code, arguments: [4194], [59], [58], [], [], [], [], [], [], [], [], []
Thu Nov 28 13:02:34 2019
Sweep [inc][1907003]: completed
Sweep [inc2][1907003]: completed

Reason:

This also can be cause by the following defect

Bug 8240762 Abstract: Undo corruptions with ORA-600 [4193]/ORA-600 [4194] or ORA-600 [4137] after SHRINK

Details:
Undo corruption may be caused after a shrink and the same undo block may be used
for two different transactions causing several internal errors like:
ORA-600 [4193] / ORA-600 [4194] for new transactions
ORA-600 [4137] for a transaction rollback

Solution:

1. Create pfile from spfile to edit
2. Shutdown the instance and change the undo_management parameter to MANUAL

idle@SYS> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
temp_undo_enabled                    boolean     FALSE
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
idle@SYS>

alter system set undo_management='MANUAL' scope=spfile;

3. Check the segments

idle@SYS> select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE';

TABLESPACE_NAME                STATUS           SEGMENT_NAME
------------------------------ ---------------- ------------------------------
SYSTEM                         ONLINE           SYSTEM

idle@SYS>


4. Create new undo tablespace - example
SQL>create undo tablespace datafile size 2000M;


CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE
  '+DATA/bacdb/undotbs03.dbf' SIZE 29696M AUTOEXTEND ON NEXT 10M MAXSIZE 29696M,
  '+DATA/bacdb/undotbs04.dbf' SIZE 16316M AUTOEXTEND ON NEXT 10M MAXSIZE 29696M
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;

5. Drop old undo tablespace
SQL>drop tablespace including contents and datafiles;

DROP TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES;

6. SQL>shutdown immediate;

7. SQL>startup nomount;  --> Using your Original spfile

8. Modify the spfile with the new undo tablespace name

SQL> Alter system set undo_tablespace = '' scope=spfile;

Alter system set undo_tablespace = 'UNDOTBS2' scope=spfile;
alter system set undo_management='AUTO' scope=spfile;

9. SQL>shutdown immediate;

10. SQL>startup;  --> Using spfile

BACDB@CDB$ROOT@SYS> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
temp_undo_enabled                    boolean     FALSE
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2
BACDB@CDB$ROOT@SYS>