<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Troubleshooting on Café Com Cloud</title><link>https://blog.cafecomcloud.com.br/categories/troubleshooting/</link><description>Recent content in Troubleshooting on Café Com Cloud</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 16 Aug 2018 16:54:11 -0300</lastBuildDate><atom:link href="https://blog.cafecomcloud.com.br/categories/troubleshooting/index.xml" rel="self" type="application/rss+xml"/><item><title>Patching an Engineered System</title><link>https://blog.cafecomcloud.com.br/2018/08/16/patching-an-engineered-system/</link><pubDate>Thu, 16 Aug 2018 16:54:11 -0300</pubDate><guid>https://blog.cafecomcloud.com.br/2018/08/16/patching-an-engineered-system/</guid><description>&lt;p&gt;Everyone in Oracle DBA world knows the key value of use an Engineered System, such as Exadata or Supercluster.&lt;/p&gt;
&lt;p&gt;In a mission critical on premises database, as a DBA we need to consolidate many databases, plataform in different versions into an Engeneed system.&lt;/p&gt;
&lt;p&gt;In a Engeneered System world we have different types of patch deployment that consists in a group of many other patches for differents versions of databases / applications / system /services. They are called Oracle Engineered Systems Quarterly Patch Deployment (QPD).&lt;/p&gt;
&lt;p&gt;The key advantage of using QPD is stay with best practices patches that was recommeded by Oracle. The QDP are available for download every 4 months and if you have a contract, you can let Oracle apply for you via ACS / platinum contract. More information, you can see in &lt;a class="link" href="https://www.oracle.com/assets/as-quarterly-patch-deployment-3042102.pdf" target="_blank" rel="noopener"
 &gt;https://www.oracle.com/assets/as-quarterly-patch-deployment-3042102.pdf&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Personal experiences on Engineered Systems(Exadata, Supercluster) patch apply&lt;/strong&gt; I have some few experiences on patch apply in many enviroments even Exadata or Supercluster systems.&lt;/p&gt;
&lt;p&gt;First, I always take an exachk. It&amp;rsquo;s extremely important to compare how health your environment are before apply. Always download the last available on MOS &amp;ldquo;Oracle Exadata Database Machine exachk or HealthCheck (Doc ID 1070954.1)&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Second, I recommend this note lecture:&lt;/p&gt;
&lt;p&gt;Exadata Database Machine and Exadata Storage Server Supported Versions (Doc ID 888828.1)&lt;/p&gt;
&lt;p&gt;Oracle SuperCluster Supported Software Versions - All Hardware Types (Doc ID 1567979.1)&lt;/p&gt;
&lt;p&gt;PS. in this notes there are some references to others Engeneered Systems. If you have on your enviroment, please take a look on MOS.&lt;/p&gt;
&lt;p&gt;So before download, as every patch I extremaly recomments read the README of each patch before start (it seems obvious, but I knew many DBAs that don&amp;rsquo;t follow this secret rule) and follow the prechecks as Oracle recommendations such as space, check if there are any conflict with another patch, etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some tips based on my personal experience&lt;/strong&gt; - In most of cases, during patching some errors related by datapatch (on Database apply) occurs. Don&amp;rsquo;t be affraid and take a look at:&lt;/p&gt;
&lt;p&gt;Queryable Patch Inventory - Issues/Solutions for ORA-20001: Latest xml inventory is not loaded into table (Doc ID 1602089.1)&lt;/p&gt;
&lt;p&gt;12.1 : Datapatch Fails with ERROR &amp;ldquo;KUP-04004,KUP-04017,KUP-04118,KUP-04095,ORA-29913&amp;rdquo;,&amp;quot; fatal: libjli.so or libpicl.so.1: open failed&amp;quot; (Doc ID 2085653.1)&lt;/p&gt;
&lt;p&gt;- If you have a segregated environment, always apply patches on DEV or UAT environment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Examples of database patch apply&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;=====&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t be affraid if you get an error. It&amp;rsquo;s happen with everyone:&lt;/p&gt;
&lt;p&gt;./datapatch -verbose SQL Patching tool version 12.1.0.2.0 Production on Thu Aug 16 14:39:41 2018 Copyright (c) 2012, 2017, Oracle. All rights reserved.&lt;/p&gt;
&lt;p&gt;Log file for this invocation: /u01/app/grid/cfgtoollogs/sqlpatch/sqlpatch_2278_2018_08_16_14_39_41/sqlpatch_invocation.log&lt;/p&gt;
&lt;p&gt;Connecting to database&amp;hellip;OK Note: Datapatch will only apply or rollback SQL fixes for PDBs that are in an open state, no patches will be applied to closed PDBs. Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1) Bootstrapping registry and package to current versions&amp;hellip;done&lt;/p&gt;
&lt;p&gt;Queryable inventory could not determine the current opatch status. Execute &amp;lsquo;select dbms_sqlpatch.verify_queryable_inventory from dual&amp;rsquo; and/or check the invocation log /u01/app/grid/cfgtoollogs/sqlpatch/sqlpatch_2278_2018_08_16_14_39_41/sqlpatch_invocation.log for the complete error. Prereq check failed, exiting without installing any patches.&lt;/p&gt;
&lt;p&gt;Please refer to MOS Note 1609718.1 and/or the invocation log /u01/app/grid/cfgtoollogs/sqlpatch/sqlpatch_2278_2018_08_16_14_39_41/sqlpatch_invocation.log for information on how to resolve the above errors.&lt;/p&gt;
&lt;p&gt;SQL Patching tool complete on Thu Aug 16 14:39:59 2018&lt;/p&gt;
&lt;p&gt;=====&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s so good when everything was work as design:&lt;/p&gt;
&lt;p&gt;./datapatch -verbose SQL Patching tool version 12.1.0.2.0 Production on Thu Aug 16 14:47:57 2018 Copyright (c) 2012, 2017, Oracle. All rights reserved.&lt;/p&gt;
&lt;p&gt;Log file for this invocation: /u01/app/grid/cfgtoollogs/sqlpatch/sqlpatch_23787_2018_08_16_14_47_57/sqlpatch_invocation.log&lt;/p&gt;
&lt;p&gt;Connecting to database&amp;hellip;OK Note: Datapatch will only apply or rollback SQL fixes for PDBs that are in an open state, no patches will be applied to closed PDBs. Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1) Bootstrapping registry and package to current versions&amp;hellip;done Determining current state&amp;hellip;done&lt;/p&gt;
&lt;p&gt;Current state of SQL patches: Bundle series DBBP: ID 180717 in the binary registry and not installed in any PDB&lt;/p&gt;
&lt;p&gt;Adding patches to installation queue and performing prereq checks&amp;hellip; Installation queue: For the following PDBs: CDB$ROOT PDB$SEED Nothing to roll back The following patches will be applied: 27547374 (DATABASE BUNDLE PATCH 12.1.0.2.180717)&lt;/p&gt;
&lt;p&gt;Installing patches&amp;hellip; Patch installation complete. Total patches installed: 2&lt;/p&gt;
&lt;p&gt;Validating logfiles&amp;hellip; Patch 27547374 apply (pdb CDB$ROOT): SUCCESS logfile: /u01/app/grid/cfgtoollogs/sqlpatch/27547374/22329708/27547374_apply__MGMTDB_CDBROOT_2018Aug16_14_48_44.log (no errors) Patch 27547374 apply (pdb PDB$SEED): SUCCESS logfile: /u01/app/grid/cfgtoollogs/sqlpatch/27547374/22329708/27547374_apply__MGMTDB_PDBSEED_2018Aug16_14_52_35.log (no errors) SQL Patching tool complete on Thu Aug 16 14:55:29 2018&lt;/p&gt;
&lt;p&gt;=====&lt;/p&gt;
&lt;p&gt;See you soon! :-)&lt;/p&gt;</description></item><item><title>The infamous jdbc closed connection</title><link>https://blog.cafecomcloud.com.br/2017/09/11/the-infamous-jdbc-closed-connection/</link><pubDate>Mon, 11 Sep 2017 12:19:34 -0300</pubDate><guid>https://blog.cafecomcloud.com.br/2017/09/11/the-infamous-jdbc-closed-connection/</guid><description>&lt;p&gt;Sometimes you, as an DBA, is blamed for everything. The database is slow, unavailable, unpatched, and the list goes on and on.&lt;/p&gt;
&lt;p&gt;Sometimes, in rare situations, you can prove then wrong :D&lt;/p&gt;
&lt;p&gt;Last week we have been called to analyze a intermitent application issue. The app team blame the database, showing the &amp;ldquo;java.sql.SQLException: Closed Connection&amp;rdquo; error on app logs. Everything at database level was checked out, and rechecked again, until they call us. Long debugging hours and still no results, we tried a different approach. What about sniffing the eth card at app server..checking the communication flow between APP and Database.&lt;/p&gt;
&lt;p&gt;And so we did it:&lt;/p&gt;
&lt;p&gt;tcpdump -i eth0 tcp port 1521 -A -s1500 | awk &amp;lsquo;$1 ~ &amp;ldquo;ORA-&amp;rdquo; {i=1;split($1,t,&amp;ldquo;ORA-&amp;rdquo;);while (i &amp;lt;= NF) {if (i == 1) {printf(&amp;quot;%s&amp;quot;,&amp;ldquo;ORA-&amp;ldquo;t[2])}else {printf(&amp;quot;%s &amp;ldquo;,$i)};i++}printf(&amp;rdquo;\n&amp;rdquo;)}&amp;rsquo;&lt;/p&gt;
&lt;p&gt;This give us the nice output:&lt;/p&gt;
&lt;p&gt;bla@app_blaserver:~ # tcpdump -i eth0 tcp port 1521 -A -s1500 | awk &amp;lsquo;$1 ~ &amp;ldquo;ORA-&amp;rdquo; {i=1;split($1,t,&amp;ldquo;ORA-&amp;rdquo;);while (i &amp;lt;= NF) {if (i == 1) {printf(&amp;quot;%s&amp;rdquo;,&amp;ldquo;ORA-&amp;ldquo;t[2])}else {printf(&amp;quot;%s &amp;ldquo;,$i)};i++}printf(&amp;rdquo;\n&amp;rdquo;)}&amp;rsquo; tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 1500 bytes ORA-01403:no data found ORA-00913:too many values ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01403:no data found ORA-01438:value larger than specified precision allowed for this column ORA-06512:at line 2 ORA-00937:not a single-group group function ORA-01403:no data found ORA-01403:no data found ORA-00937:not a single-group group function ORA-01403:no data found ORA-00937:not a single-group group function ORA-01403:no data found ORA-00937:not a single-group group function ORA-01403:no data found&lt;/p&gt;
&lt;p&gt;The ORA-01403 is expected after the fetch of each cursor being processed - no bad news here.&lt;/p&gt;
&lt;p&gt;Hummmm&amp;hellip;and when the ORA-01438/ORA-06512/ORA-00937 are raised what happens to the connection? You got it right?&lt;/p&gt;
&lt;p&gt;After checking what was causing the errors, the intermittent issue stops, everyone was happy - incluing the DBA team :D&lt;/p&gt;
&lt;p&gt;(You need to adapt the script to fit the listener port and eth card in your box, okay?)&lt;/p&gt;
&lt;p&gt;As always feedbacks are very welcome.&lt;/p&gt;
&lt;p&gt;See you around,&lt;/p&gt;
&lt;p&gt;Hang.&lt;/p&gt;</description></item><item><title>db_multiblock_read_count - to be or not to be?</title><link>https://blog.cafecomcloud.com.br/2017/05/25/db_multiblock_read_count-to-be-or-not-to-be/</link><pubDate>Thu, 25 May 2017 18:37:21 -0300</pubDate><guid>https://blog.cafecomcloud.com.br/2017/05/25/db_multiblock_read_count-to-be-or-not-to-be/</guid><description>&lt;p&gt;Sometimes you wanna to use things with default options&amp;hellip;and sometimes the default is not good enough.&lt;/p&gt;
&lt;p&gt;We all know that db_file_multiblock_read_count is bumped by default on startup, usually you get 128 blocks per read. Why?&lt;/p&gt;
&lt;p&gt;From Oracle documentation, this value is high, but CBO will not favor full tables scans.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Even though the default value may be a large value, the optimizer will not favor large plans if you do not set this parameter. It would do so only if you explicitly set this parameter to a large value.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Okay. But Why? From a 10053 trace within a session, you can see that the CBO will compute db_file_multiblock_read_count always as &amp;ldquo;8&amp;rdquo;&amp;hellip;even if you see 128 in spfile.&lt;/p&gt;
&lt;p&gt;CBO you always use 8, if you dont set db_file_multiblock_read_count explicitly. How to know if you set db_file_multiblock_read_count as 128? Use this:&lt;/p&gt;
&lt;h5 id="select-nvlvaluenull-as-value-from-vspparameter-where-name--db_file_multiblock_read_count"&gt;SELECT nvl(value,&amp;rsquo;*NULL*&amp;rsquo;) AS value FROM v$spparameter WHERE name = &amp;lsquo;db_file_multiblock_read_count&amp;rsquo;;
&lt;/h5&gt;&lt;p&gt;If this return *NULL*, you have not set db_file_multiblock_read_count, Oracle is showing you 128, but CBO uses 8. Sad no?&lt;/p&gt;
&lt;p&gt;You all read the documentation and know the effects of bumping db_file_multiblock_read_count high. Full table scans will happen more often and as a result, in a OLTP system, usually you will get a call from your boss (hehe)&lt;/p&gt;
&lt;p&gt;But there is a way to set correctly the db_file_multiblock_read_count&amp;hellip;by testing&amp;hellip;for example, take a look on the block below. Its silly, I know, but it can give you a magic value for this parameter.&lt;/p&gt;
&lt;h5 id="set-serveroutput-on-declare-l_count-pls_integer-l_time-pls_integer-l_starting_time-pls_integer-l_ending_time-pls_integer-begin-dbms_outputput_linedbfmbrc-seconds-for-l_dbfmbrc-in-164-loop-execute-immediate-alter-session-set-db_file_multiblock_read_countl_dbfmbrc-execute-immediate-alter-system-flush-buffer_cache-execute-immediate-alter-session-disable-parallel-dml-l_starting_time--dbms_utilityget_time-select--fullt--count-into-l_count-from-big_table-t-l_ending_time--dbms_utilityget_time-l_time--roundl_ending_time-l_starting_time100-dbms_outputput_linel_dbfmbrc-l_time-end-loop-end-"&gt;set serveroutput on DECLARE l_count PLS_INTEGER; l_time PLS_INTEGER; l_starting_time PLS_INTEGER; l_ending_time PLS_INTEGER; BEGIN dbms_output.put_line(&amp;lsquo;dbfmbrc seconds&amp;rsquo;); FOR l_dbfmbrc IN 1..64 LOOP EXECUTE IMMEDIATE &amp;lsquo;ALTER SESSION SET db_file_multiblock_read_count=&amp;rsquo;||l_dbfmbrc; EXECUTE IMMEDIATE &amp;lsquo;ALTER system flush buffer_cache&amp;rsquo;; EXECUTE IMMEDIATE &amp;lsquo;ALTER session disable parallel dml&amp;rsquo;; l_starting_time := dbms_utility.get_time(); SELECT /*+ full(t) */ count(*) INTO l_count FROM big_table t; l_ending_time := dbms_utility.get_time(); l_time := round((l_ending_time-l_starting_time)/100); dbms_output.put_line(l_dbfmbrc||&amp;rsquo; &amp;lsquo;||l_time); END LOOP; END; /
&lt;/h5&gt;&lt;p&gt;(Thanks to Chris Antognini, you&amp;rsquo;re great)&lt;/p&gt;
&lt;p&gt;With this block (be carefull, it will take 60-90 minutes depending of the big table&amp;rsquo;s size, as a advice, use a 5GB table), you will have values, plot a graph and see the behavior. Dont choose a high value for OLTP.&lt;/p&gt;
&lt;p&gt;See you around!&lt;/p&gt;</description></item><item><title>Using oradebug - 10053 and 10046 events</title><link>https://blog.cafecomcloud.com.br/2017/02/27/using-oradebug-10053-and-10046-events/</link><pubDate>Mon, 27 Feb 2017 12:00:06 -0300</pubDate><guid>https://blog.cafecomcloud.com.br/2017/02/27/using-oradebug-10053-and-10046-events/</guid><description>&lt;p&gt;Hello There! Hope this article finds you well. Today we will talk about oradebug, this little wonder in oracle, and how to set the 10046 and 10053 events to troubleshoot performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First of all, what is oradebug?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Oradebug is a sqlplus tool, intended to oracle support personel only - however, it can be very handy in a bunch of situations. You can use it to set specific troubleshooting events, use to diagnose on which interface your RAC is using for the interconnect messages, use to execute a hanganalyze ( the command, not me, okay? =] ), system state dumps, errorstack dumps and the list goes on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do I use it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First of all, you need to attach oradebug to a specific session/process.&lt;/p&gt;
&lt;p&gt;Using the ospid:&lt;/p&gt;
&lt;p&gt;Get the os pid for the process, usually with and ps command, or getting the thread in windows environment. With the ospid (in this example 1177)&lt;/p&gt;
&lt;p&gt;oradebug setospid 1177;&lt;/p&gt;
&lt;p&gt;If you try to attach oradebug to an inactive process, you will receive:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setospid 13050; ORA-00072: process &amp;ldquo;13050&amp;rdquo; is not active&lt;/p&gt;
&lt;p&gt;If everything went smoothly, you will receive:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setospid 16792; Oracle pid: 150, Unix process pid: 16792, image: oracle@BLASERVER12&lt;/p&gt;
&lt;p&gt;Using the SID to attach oradebug:&lt;/p&gt;
&lt;p&gt;First of all you need to find out the orapid for the session, running the sql below:&lt;/p&gt;
&lt;p&gt;select p.pid orapid from v$process p, v$session s where s.sid = &amp;amp;SID and p.addr = s.paddr /&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; select p.pid orapid from v$process p, v$session s where s.sid = &amp;amp;SID and p.addr = s.paddr / 2 3 4 5 6 Enter value for sid: 651 old 4: where s.sid = &amp;amp;SID new 4: where s.sid = 651&lt;/p&gt;
&lt;p&gt;ORAPID &amp;mdash;&amp;mdash;&amp;mdash;- 152&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setorapid 152; Oracle pid: 152, Unix process pid: 5392, image: oracle@BLASERVER12 (TNS V1-V3)&lt;/p&gt;
&lt;p&gt;You are ready to go!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting the 10046 event&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;oradebug event 10046 trace name context forever, level 12;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting the 10053 event&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;oradebug event 10053 trace name context forever, level 1;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why this is important?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can use the 10046 to get sql specific informations, such as object, parsing, elapsed time, wait events, bind variables. It is an alternativa for dbms_monitor and dbms_system, another way to generate a sessions trace, and it could be &amp;ldquo;tkprofed&amp;rdquo; as well.&lt;/p&gt;
&lt;p&gt;If you wanna to understand the optimizer&amp;rsquo;s decicions, there is no better way that using a 10053 trace. You will understand the cost estimates, access paths, query block names, peeked binds, optimizer parameters used during the parse.&lt;/p&gt;
&lt;p&gt;In another post I&amp;rsquo;ll give detail about the levels, and why we type &amp;ldquo;name context forever&amp;rdquo;. This is a how to post only =]&lt;/p&gt;
&lt;p&gt;See you around!&lt;/p&gt;</description></item></channel></rss>