Sunday, September 1, 2019

ORA-00368: checksum error in redo log bloc

Issue: The Archive Logs on the Physical Standby are corrupted while shipping,

Error Details found in the Alert Log:
Completed: alter database recover managed standby database using current logfile disconnect from session
Mon Aug 05 14:04:57 2019
Media Recovery Log +RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867
Incomplete read from log member '+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'. Trying next member.
Incomplete read from log member '+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'. Trying next member.
Errors in file /u01/app/oracle/product/diag/rdbms/trace/XXXXX_pr00_29975.trc  (incident=16775):
ORA-00353: log corruption near block 513423 change 437172397 time 07/28/2019 18:00:15
ORA-00334: archived log: '+RECO/XXXXXDR/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'
Incident details in: /u01/app/oracle/product/diag/rdbms/incident/incdir_16775/XXXXX_pr00_29975_i16775.trc
Errors with log +RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867
MRP0: Background Media Recovery terminated with error 368
Mon Aug 05 14:04:59 2019
Errors in file /u01/app/oracle/product/diag/rdbms/trace/XXXXX_pr00_29975.trc:
ORA-00368: checksum error in redo log block
ORA-00353: log corruption near block 513423 change 437172397 time 07/28/2019 18:00:15
ORA-00334: archived log:
'+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'
Mon Aug 05 14:04:59 2019
Errors in file /u01/app/oracle/product/diag/rdbms/trace/XXXXX_m001_136.trc:
ORA-48132: requested file lock is busy, [stg2_16775_inc.swp] [/u01/app/oracle/product/diag/rdbms/lck/SW_16775_1.lck]
ORA-48170: unable to lock file - already in use
SVR4 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 134
Mon Aug 05 14:04:59 2019
Sweep [inc][16775]: completed
Sweep [inc2][16775]: completed
Mon Aug 05 14:04:59 2019
MRP0: Background Media Recovery process shutdown ()
Mon Aug 05 14:05:00 2019
Dumping diagnostic data in directory=[cdmp_20190805140500], requested by (instance=1, osid=4294997271 (PR00)), summary=[incident=16775].
Mon Aug 05 14:05:01 2019
Incomplete read from log member '+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'. Trying next member.
Incomplete read from log member '+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'. Trying next member.
Errors in file /u01/app/oracle/product/diag/rdbms/trace/XXXXX_m000_134.trc  (incident=17347):
ORA-00353: log corruption near block 513423 change 436876222 time 07/28/2019 18:00:15
ORA-00334: archived log: '+RECO/ARCHIVELOG/2019_08_05/thread_1_seq_447.741.1015502867'
Incident details in: /u01/app/oracle/product/diag/rdbms/incident/incdir_17347/XXXXX_m000_134_i17347.trc
Mon Aug 05 14:05:03 2019
Dumping diagnostic data in directory=[cdmp_20190805140503], requested by (instance=1, osid=4294967430 (M000)), summary=[incident=17347].
Mon Aug 05 14:05:43 2019
DMON: NSV0 network call timeout. Killing it now.
Starting background process NSV0
Mon Aug 05 14:05:44 2019
NSV0 started with pid=47, OS id=143
Mon Aug 05 14:06:02 2019
Sweep [inc][17347]: completed
Sweep [inc2][17347]: completed

Troubleshooting:

Troubleshooting:

1. Based on the Logs collected, to ensure the datafiles and archivelogs are not corrupted, we verified the integrity using below methods.
a. Verified the Database and Datafile Status using the RMAN utility
RMAN>backup validate database;

b. Verified the Archive Logs status using the "Validate
RMAN>backup validate archivelog all;

c. Verified using query.
SQL> select * from v$database_block_corruptions.

2. Since there are no corruptions in the Primary archive logs we decided to copy the archivelogs from the primary site to the physical standby using a secured protocol where no firewall is in place, and registered the archivelog and started the MRP then the registered archivelog applied successfully but the consecutive archives failed to apply on the Physical Standby Database.

SQL> select * from v$archive_gap

Or you can use the v$managed_standby view to find where the log apply stuck.

SQL> select sequence#,process,status from v$managed_standby;

Copy the logs to the standby site from the primary site

Using the below command

$ scp log_file_name_n.arc oracle@standby:/log/file/location/log_file_name_n.arc

At standby site, Do the log file registration at the standby site until all the missing log files are registered, Use this below command.

SQL> alter database register logfile '/log/file/location/log_file_name_n.arc';

Cause: The Network Packets are getting corrupted during the log shipping due to the Network Firewall Rules,

Firewall caused partial archive log transferred.

The contents of the mrp trace file show:
The other common error is ORA-3135 and recommend you to check this cause and solution.

ORA-03135: connection lost contact when shipping redo log to standby database
ORA-03135: connection lost contact
ARC2: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (3135)

Solution:

Disable any features like below which are enabled on the firewall, or you 

- SQLNet fixup protocol 
- Deep Packet Inspection (DPI) 
- SQLNet packet inspection 
- SQL Fixup 
- SQL ALG (Juniper firewall)


Saturday, March 9, 2019

Issue: emcli login failed

[oemapp@xxxxx emcli]$ emcli login -username="sysman" -password="oracle123" 
Error: Connection to the current OMS could not be established. Check the log files for further details. 
Log file location is : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log 
[oemapp@xxxxx emcli]$ pwd 
/mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli 
[oemapp@xxxxx emcli]$ cd ../../.. 
[oemapp@xxxxx em]$ ls 
EMGC_OMS1 

Cause:
emcli.log: 
======== 

Mar 06, 2019 2:05:14 PM oracle.sysman.emCLI.omsbrowser.OMSBrowser submitRequest 
SEVERE: IOException in 5(5) try of submitRequest to /em/console/cli : 
Mar 06, 2019 2:05:14 PM oracle.sysman.emSDK.emCLI.verb.RemoteVerb execute 
SEVERE: 
oracle.sysman.emCLI.omsbrowser.HttpConnectionException: 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest2(OMSBrowser.java:1797) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest(OMSBrowser.java:1607) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitCommand(OMSBrowser.java:1507) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageInternal(OMSBrowser.java:948) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageCommon(OMSBrowser.java:854) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageSplitStream(OMSBrowser.java:828) 
at oracle.sysman.emSDK.emCLI.verb.RemoteVerb.execute(RemoteVerb.java:273) 
at oracle.sysman.install.emcli.GetPlatformClientVerb.execute(GetPlatformClientVerb.java:53) 
at oracle.sysman.emSDK.emCLI.CLIController.execute(CLIController.java:367) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at oracle.sysman.emCLI.StandAloneLaunchHandler.invoke(StandAloneLaunchHandler.java:413) 
at oracle.sysman.emCLI.StandAloneLaunchHandler.launch(StandAloneLaunchHandler.java:286) 
at oracle.sysman.emSDK.emCLI.CLIController.launch(CLIController.java:255) 
at oracle.sysman.emSDK.emCLI.CLIController.main(CLIController.java:207) 
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) 
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020) 
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127) 
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367) 
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:750) 
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) 
at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:167) 
at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3524) 
at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:3436) 
at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3187) 
at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3178) 
at HTTPClient.HttpClientConfiguration.doAction(HttpClientConfiguration.java:1083) 
at HTTPClient.HTTPConnection.doAction(HTTPConnection.java:5616) 
at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:3178) 
at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1131) 
at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1085) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest2(OMSBrowser.java:1760) 
... 16 more 

It is observed that some of the 1.8 JDK updates are not allowing the communication between EMCLI and OMS. 

Follow the solution from the below MOS note solution for this issue. 

EM13c : Emcli Fails While Login And Sync - Error: Connection to the current OMS could not be established ( Doc ID 2392010.1 ) 

Action Plan:

[root@xxxxx opt]# tar xvf /mwhome/app/patches/jdk-7u211-linux-x64.tar.gz
[root@xxxxx opt]# cd jdk1.8.0_201/
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/java java /opt/jdk1.7.0_211/bin/java 2
[root@xxxxx jdk1.8.0_201]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.201-2.6.16.1.0.1.el7_6.x86_64/jre/bin/java)
*  2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java)
 + 3           /opt/jdk1.8.0_201/bin/java

Enter to keep the current selection[+], or type selection number:
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_211/bin/jar 2
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_211/bin/javac 2
[root@xxxxx jdk1.8.0_201]# alternatives --set jar /opt/jdk1.7.0_211/bin/jar
[root@xxxxx jdk1.8.0_201]# alternatives --set javac /opt/jdk1.7.0_211/bin/javac
[root@xxxxx jdk1.8.0_201]# java -version
[root@xxxxx jdk1.8.0_201]# su - oemapp
[root@xxxxx jdk1.8.0_201]#export JAVA_HOME=/mwhome/app/oemapp/oracle_common/jdk/jre
[root@xxxxx jdk1.8.0_201]#export JRE_HOME=/mwhome/app/oemapp/oracle_common/jdk/jre
[root@xxxxx jdk1.8.0_201]#export PATH=$PATH:/mwhome/app/oemapp/oracle_common/jdk/bin:/mwhome/app/oemapp/oracle_common/jdk/jre/bin

[oemapp@xxxxx jre]$ /mwhome/app/oemapp/oracle_common/jdk/jre/bin/java -version
java version "1.7.0_111"
Java(TM) SE Runtime Environment (build 1.7.0_111-b13)

Java HotSpot(TM) 64-Bit Server VM (build 24.111-b13, mixed mode)

[oemapp@xxxxx jre]$ emcli status
Oracle Enterprise Manager 13c Release 2 EM CLI.
Copyright (c) 1996, 2016 Oracle Corporation and/or its affiliates. All rights reserved.

Instance Home          : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli
Verb Jars Home         : /mwhome/app/oemapp/bin/./bindings/13.2.0.0.0/.emcli
Status                 : Configured
EM CLI Home            : /mwhome/app/oemapp/bin
EM CLI Version         : 13.2.0.0.0
Java Home              : /mwhome/app/oemapp/oracle_common/jdk/jre
Java Version           : 1.7.0_111
Log file               : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log
Log level              : SEVERE
EM URL                 : https://xxxxx .xxxxx .net:7803/em
EM user                : sysman
Auto login             : false
Trust all certificates : true

[oemapp@xxxxx jre]$

Setup the EMCLI 
##########

[oemapp@xxxxx jre]$ emcli setup -url=https://xxxxx .xxxxx .net:7803/em -username="sysman" -password="oracle123" -trustall
Oracle Enterprise Manager 13c Release 2.
Copyright (c) 1996, 2016 Oracle Corporation and/or its affiliates. All rights reserved.

Emcli setup successful


[oemapp@xxxxx jre]$ emcli get_supported_platforms
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Linux x86-64
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Oracle Solaris on SPARC (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

[oemapp@xxxxx jre]$