<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archives des Troubleshooting - dbi Blog</title>
	<atom:link href="https://www.dbi-services.com/blog/tag/troubleshooting/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/tag/troubleshooting/</link>
	<description></description>
	<lastBuildDate>Wed, 05 Aug 2026 19:13:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2025/05/cropped-favicon_512x512px-min-32x32.png</url>
	<title>Archives des Troubleshooting - dbi Blog</title>
	<link>https://www.dbi-services.com/blog/tag/troubleshooting/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>GoldenGate Extract Abending on NFS Trail: OGG-02897 / OGG-01668 Input/Output Error</title>
		<link>https://www.dbi-services.com/blog/goldengate-extract-abending-on-nfs-trail-ogg-02897-ogg-01668-input-output-error/</link>
					<comments>https://www.dbi-services.com/blog/goldengate-extract-abending-on-nfs-trail-ogg-02897-ogg-01668-input-output-error/#respond</comments>
		
		<dc:creator><![CDATA[Julien Delattre]]></dc:creator>
		<pubDate>Mon, 10 Aug 2026 06:02:00 +0000</pubDate>
				<category><![CDATA[GoldenGate]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[19]]></category>
		<category><![CDATA[19c]]></category>
		<category><![CDATA[26]]></category>
		<category><![CDATA[26ai]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[ogg-01668]]></category>
		<category><![CDATA[ogg-02897]]></category>
		<category><![CDATA[trail]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=46068</guid>

					<description><![CDATA[<p>While working on a client’s GoldenGate 26ai environment, I ran into a NFS-related replication issue that could have been serious, had it happened in production. Here is what happened and how the issue was fixed. The client’s GoldenGate extract was running on a dedicated server, capturing changes from an Oracle 19c source database. Trail files [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/goldengate-extract-abending-on-nfs-trail-ogg-02897-ogg-01668-input-output-error/">GoldenGate Extract Abending on NFS Trail: OGG-02897 / OGG-01668 Input/Output Error</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While working on a client’s GoldenGate 26ai environment, I ran into a NFS-related replication issue that could have been serious, had it happened in production. Here is what happened and how the issue was fixed.</p>



<p class="wp-block-paragraph">The client’s GoldenGate extract was running on a dedicated server, capturing changes from an Oracle 19c source database. Trail files were written on an NFS. Depending on the configuration, this is officially supported by Oracle, and works rather well.</p>



<h2 id="h-ogg-02897-ogg-01668-input-output-error" class="wp-block-heading"><code>OGG-02897</code> / <code>OGG-01668</code> Input/Output Error</h2>



<p class="wp-block-paragraph">On a Monday morning, however, the extract was <code>ABENDED</code>. The extract had been down since Saturday night, with the following error messages:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
2026-06-07T00:19:11.404+0200  ERROR   OGG-02897  Oracle GoldenGate Capture for Oracle, EXT.prm:  Failed to synchronize trail file. Error detail: Could not sync &quot;PDB1/aa000000009&quot; (error 5, Input/output error).
2026-06-07T00:19:11.404+0200  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, EXT.prm:  PROCESS ABENDING.
</pre></div>


<p class="wp-block-paragraph">The extract was failing with an <code>OGG-02897</code> error. The OS-level error, <code>errno 5: Input/output error</code>, did not seem to indicate any good news for us. Needless to say that restarting the extract did not fix the issue.</p>



<h2 id="h-root-cause-analysis" class="wp-block-heading">Root Cause Analysis</h2>



<p class="wp-block-paragraph">A firewall upgrade had taken place that Saturday night. The firewall between the GoldenGate server and the NFS server was upgraded, and it briefly went down during the operation.</p>



<p class="wp-block-paragraph">The real problem was what happened after the firewall came back up: some extracts caught up and managed to restart properly, while other were left in this <code>ABENDED</code> state, unable to restart. For these extracts, I/O operations kept failing even though the network path was healthy again.</p>



<h2 id="h-solution-remount-the-nfs" class="wp-block-heading">Solution: Remount the NFS</h2>



<p class="wp-block-paragraph">The solution was to stop all GoldenGate processes whose trail files were generated on the NFS, including all the processes which were running fine, and then unmount and remount the NFS filesystem.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
# Unmount the NFS path
umount /path/to/nfs

# Remount all filesystems defined in /etc/fstab, including the NFS
mount -a
</pre></div>


<p class="wp-block-paragraph">Once that came back up, I restarted the extracts from the <code>adminclient</code> and they all started successfully.</p>



<p class="wp-block-paragraph">In this case, the firewall upgrade happened during the night with no GoldenGate-aware procedure in place. Next time, a scheduled GoldenGate maintenance spanning over the firewall upgrade window will probably avoid crashing multiple replications during the week-end, or worse.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/goldengate-extract-abending-on-nfs-trail-ogg-02897-ogg-01668-input-output-error/">GoldenGate Extract Abending on NFS Trail: OGG-02897 / OGG-01668 Input/Output Error</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/goldengate-extract-abending-on-nfs-trail-ogg-02897-ogg-01668-input-output-error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MongoDB Log Analysis : A Comprehensive Guide</title>
		<link>https://www.dbi-services.com/blog/mongodb-log-analysis-a-comprehensive-guide/</link>
					<comments>https://www.dbi-services.com/blog/mongodb-log-analysis-a-comprehensive-guide/#respond</comments>
		
		<dc:creator><![CDATA[Julien Delattre]]></dc:creator>
		<pubDate>Fri, 10 Oct 2025 06:00:00 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Development & Performance]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[jq]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[Mongo]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[slow queries]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=37497</guid>

					<description><![CDATA[<p>Contrary to other DBMS, MongoDB self-managed deployments generate logs in a JSON format, which can be quite intimidating at first. But instead of hoping to never have to look at the logs, you can use some tools and tips to navigate them more easily and not waste time finding the information you&#8217;re looking for. Log [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mongodb-log-analysis-a-comprehensive-guide/">MongoDB Log Analysis : A Comprehensive Guide</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Contrary to other DBMS, <strong><a href="https://www.dbi-services.com/technologies/mongodb/" target="_blank" rel="noreferrer noopener">MongoDB</a></strong> self-managed deployments generate <strong>logs in a JSON format</strong>, which can be quite intimidating at first. But instead of hoping to never have to look at the logs, you can use some <strong>tools and tips to navigate them</strong> more easily and not waste time finding the information you&#8217;re looking for.</p>



<div class="wp-block-yoast-seo-table-of-contents yoast-table-of-contents"><h2>Table of contents</h2><ul><li><a href="#log-format-overview" data-level="2">Log format overview</a></li><li><a href="#querying-logs-with-mongosh" data-level="2">Querying logs through mongosh</a></li><li><a href="#navigating-logs-with-jq" data-level="2">Navigating through the logs with jq</a></li><li><a href="#h-analyzing-slow-queries-with-jq" data-level="2">Analyzing slow queries with jq</a></li><li><a href="#h-mongodb-log-jq-query-builder" data-level="2">MongoDB log jq query builder</a></li><li><a href="#h-conclusion" data-level="2">Conclusion</a></li></ul></div>



<h2 id="log-format-overview" class="wp-block-heading">Log format overview</h2>



<p class="wp-block-paragraph">Inside <code>/var/log/mongodb/mongod.log</code> (or a custom path if you set one), a typical log entry looks like this (shortened, for readability) :</p>



<pre class="wp-block-code"><code>{"t":{"$date":"2025-03-06T14:54:28.298+01:00"},"s":"I",&nbsp; "c":"CONTROL",&nbsp; "id":8423403, "ctx":"initandlisten","msg":"mongod startup complete","attr":{"Summary of time elapsed":{"Startup from clean shutdown?":false,"Statistics":{"Set up periodic runner":"0 ms","Set up online certificate status protocol manager":"0 ms",&#091;...],"Start transport layer":"0 ms","_initAndListen total elapsed time":"626 ms"}}}}</code></pre>



<p class="wp-block-paragraph">At first glance, it&#8217;s pretty difficult to extract the essential information, but let&#8217;s see how the document looks like when it&#8217;s formatted (we&#8217;ll see how to do that later).</p>



<pre class="wp-block-code"><code>{
&nbsp; "t": {
&nbsp;&nbsp;&nbsp; "$date": "2025-03-06T14:54:28.298+01:00"
&nbsp; },
&nbsp; "s": "I",
&nbsp; "c": "CONTROL",
&nbsp; "id": 8423403,
&nbsp; "ctx": "initandlisten",
&nbsp; "msg": "mongod startup complete",
&nbsp; "attr": {
&nbsp;&nbsp;&nbsp; "Summary of time elapsed": {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Startup from clean shutdown?": false,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Statistics": {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Set up periodic runner": "0 ms",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Set up online certificate status protocol manager": "0 ms",
        &#091;...] # lines hidden
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Start transport layer": "0 ms",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "_initAndListen total elapsed time": "626 ms"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; }
&nbsp; }
}</code></pre>



<p class="wp-block-paragraph">Here is a description of the main fields of the log document :</p>



<ul class="wp-block-list">
<li><code>t</code> : Timestamp of the log entry.</li>



<li><code>s</code> : Severity code associated with the log entry (<code>E</code> for error, <code>W</code> for warning, <code>I</code> for information and <code>D1</code> to <code>D5</code> for debug).</li>



<li><code>c</code> : Category of the log entry. Most common categories are <code>CONTROL</code>, <code>COMMAND</code>, <code>ELECTION</code>, <code>REPL</code> (for replication) or <code>NETWORK</code>. An extensive list is available in the <a href="https://www.mongodb.com/docs/manual/reference/log-messages" target="_blank" rel="noreferrer noopener">official MongoDB documentation</a>.</li>



<li><code>id</code> : Unique log entry ID.</li>



<li><code>ctx</code> : Thread that generated the log.</li>



<li><code>msg</code> : Usually a short message describing the log.</li>



<li><code>attr</code> : Optional additional attributes.</li>
</ul>



<p class="wp-block-paragraph">This will help us when looking at the logs, first with <code>mongosh</code>.</p>



<h2 id="querying-logs-with-mongosh" class="wp-block-heading">Querying logs through <code>mongosh</code></h2>



<p class="wp-block-paragraph">You can query logs inside the MongoDB shell called <code>mongosh</code>. To do so, use the <code>getLog</code> admin command :</p>



<pre class="wp-block-code"><code>db.adminCommand({ getLog: "global"}); // display all log entries</code></pre>



<p class="wp-block-paragraph">Another useful option is to view startup warnings, which will only display warning logs since last startup.</p>



<pre class="wp-block-code"><code>db.adminCommand({ getLog: "startupWarnings" }) // display startup warnings
{
&nbsp; totalLinesWritten: 2,
&nbsp; log: &#091;
&nbsp;&nbsp;&nbsp; '{"t":{"$date":"2025-03-07T08:32:41.005+01:00"},"s":"W",&nbsp; "c":"NETWORK",&nbsp; "id":5123300, "ctx":"initandlisten","msg":"vm.max_map_count is too low","attr":{"currentValue":65530,"recommendedMinimum":102400,"maxConns":51200},"tags":&#091;"startupWarnings"]}\n',
&nbsp;&nbsp;&nbsp; '{"t":{"$date":"2025-03-07T08:32:41.005+01:00"},"s":"W",&nbsp; "c":"CONTROL",&nbsp; "id":8386700, "ctx":"initandlisten","msg":"We suggest setting swappiness to 0 or 1, as swapping can cause performance problems.","attr":{"sysfsFile":"/proc/sys/vm/swappiness","currentValue":60},"tags":&#091;"startupWarnings"]}\n'
&nbsp; ],
&nbsp; ok: 1
}</code></pre>



<p class="wp-block-paragraph">Even though this can sometimes be useful, it requires <strong>authenticated access</strong> to the database, and it only works when the <code>mongod</code> <strong>process is running</strong>. You won&#8217;t be able to use this method when the database crashes, for instance. Moreover, the logs are difficult to read.</p>



<p class="wp-block-paragraph">Most of the time, you will be better served by the <code>jq</code> utility.</p>



<h2 id="navigating-logs-with-jq" class="wp-block-heading">Navigating through the logs with <code>jq</code></h2>



<p class="wp-block-paragraph"><a href="https://jqlang.org/manual/" target="_blank" rel="noreferrer noopener"><code>jq</code></a> is a <strong>powerful utility</strong> that helps you navigate JSON documents, and even though it is not an official MongoDB product, you should <strong>always integrate</strong> it in your MongoDB deployments.</p>



<h4 id="h-prettify-mongodb-logs" class="wp-block-heading">Prettify MongoDB logs</h4>



<p class="wp-block-paragraph">The first benefit of the <code>jq</code> command is to display MongoDB logs in a readable format :</p>



<pre class="wp-block-code"><code>&gt; head -1 mongod.log | jq
{
&nbsp; "t": {
&nbsp;&nbsp;&nbsp; "$date": "2025-03-05T14:44:28.531+01:00"
&nbsp; },
&nbsp; "s": "I",
&nbsp; "c": "CONTROL",
&nbsp; "id": 23285,
&nbsp; "ctx": "main",
&nbsp; "msg": "Automatically disabling TLS 1.0"
}</code></pre>



<p class="wp-block-paragraph">Of course, a single line of log will now span multiple lines in the output. But thanks to the log structure explained above, we can write our first queries with <code>jq</code> to filter the results and only display what&#8217;s important.</p>



<p class="wp-block-paragraph">I would definitely recommend to <strong>build aliases</strong> with the following commands in order to quickly access the information that you find more valuable in the logs.</p>



<h4 id="h-display-error-messages" class="wp-block-heading"><strong>Display error messages</strong></h4>



<p class="wp-block-paragraph">By using the <code>s</code> field (severity), we can filter the logs to only display error messages. This is especially useful when failing to start a MongoDB instance.</p>



<pre class="wp-block-code"><code>jq 'select(.s == "E")' mongod.log</code></pre>



<p class="wp-block-paragraph">You can also include warnings by slightly modifying the command.</p>



<pre class="wp-block-code"><code>jq 'select(.s == "E" or .s == "W")' mongod.log</code></pre>



<h4 id="h-filtering-displayed-fields" class="wp-block-heading"><strong>Filtering displayed fields</strong></h4>



<p class="wp-block-paragraph">When selecting fields, you should pipe the <code>jq</code> filtering to a JSON object like this one :</p>



<pre class="wp-block-code"><code>{time: .t&#091;"$date"], message: .msg, error: .attr.error}</code></pre>



<p class="wp-block-paragraph">From now on, I will use the <code>-c</code> option to display the JSON in the compact format. Even in this format, logs can be readable when you select or exclude specific fields. Here, I want to select the <code>.t["$date"]</code>, <code>.msg</code> and <code>.attr.error</code> fields. To improve the display, I will rename them :</p>



<pre class="wp-block-code"><code>&gt; jq -c 'select(.s == "E") | {time: .t&#091;"$date"], message: .msg, error: .attr.error}' mongod.log
{"time":"2025-03-05T14:44:28.665+01:00","message":"WiredTiger error message","error":13}
{"time":"2025-03-05T14:44:28.665+01:00","message":"WiredTiger error message","error":13}
{"time":"2025-03-05T14:44:28.665+01:00","message":"WiredTiger error message","error":13}
{"time":"2025-03-06T10:17:07.383+01:00","message":"DBException in initAndListen, terminating","error":"Location28596: Unable to determine status of lock file in the data directory /var/lib/mongodb: boost::filesystem::status: Permission denied &#091;system:13]: \"/var/lib/mongodb/mongod.lock\""}</code></pre>



<p class="wp-block-paragraph">Similarly, you can exclude a field with the <code>del</code> function. For instance, this will remove the <code>message</code> sub-field located inside the <code>attr</code> field.</p>



<pre class="wp-block-code"><code>jq 'del(.attr.message)' mongod.log</code></pre>



<h4 id="h-errors-and-warnings-grouped-by-message" class="wp-block-heading"><strong>Errors and warnings grouped by message</strong></h4>



<p class="wp-block-paragraph">To check for recurrent warnings or errors, you can pipe the <code>jq</code> output to group the results by <code>msg</code> content.</p>



<pre class="wp-block-code"><code>jq 'select(.s == "E" or .s=="W") | .msg' mongod.log | sort | uniq -c | sort -nr | head</code></pre>



<h4 id="h-occurrences-of-each-log-severity" class="wp-block-heading"><strong>Occurrences of each log severity</strong></h4>



<p class="wp-block-paragraph">If you want to quickly look for the number of every severity, you can do so with the <code>s</code> field.</p>



<pre class="wp-block-code"><code>&gt; jq '.s' mongod.log | sort | uniq -c
&nbsp;&nbsp;&nbsp;&nbsp; 10 "E"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 "F"
&nbsp;&nbsp; 1727 "I"
     88 "W"</code></pre>



<h4 id="h-view-logs-for-specific-log-categories" class="wp-block-heading"><strong>View logs for specific log categories</strong></h4>



<p class="wp-block-paragraph">As mentioned before, the category of the logs might be interesting to filter (only the replication logs, for instance).</p>



<pre class="wp-block-code"><code>jq -c 'select(.c == "REPL")' mongod.log</code></pre>



<h4 id="h-filter-logs-by-date" class="wp-block-heading"><strong>Filter logs by date</strong></h4>



<p class="wp-block-paragraph">Whether you use log rotation or not, you might want to quickly access the last minutes/hours/days of logs. With the <code>date</code> utility, you can retrieve the most recent logs :</p>



<pre class="wp-block-code"><code>jq -c --arg since "$(date -d '10 minutes ago' +%Y-%m-%dT%H:%M:%S)" 'select(.t&#091;"$date"] &gt;= $since)' mongod.log</code></pre>



<p class="wp-block-paragraph">Still filtering on the <code>.t["$date"]</code> field, you can also extract a portion of the logs :</p>



<pre class="wp-block-code"><code>jq -c 'select(.t&#091;"$date"] &gt;= "2025-03-06T14:30:00" and .t&#091;"$date"] &lt;= "2025-03-06T14:40:00")' mongod.log</code></pre>



<h4 id="h-look-for-a-specific-pattern-in-the-log" class="wp-block-heading"><strong>Look for a specific pattern in the log</strong></h4>



<p class="wp-block-paragraph">Of course, you can always use <code>grep</code> followed by <code>jq</code> to find a pattern in the logs : <kbd>grep -i "pattern" mongod.log | jq</kbd></p>



<p class="wp-block-paragraph">But if you want to look for a specific pattern inside a specific field, you can do so with the <code>test</code> function :</p>



<pre class="wp-block-code"><code>&gt; jq -c 'select(.msg | test("failed to authenticate"; "i"))' mongod.log // (i option for case insensitivity)
{"t":{"$date":"2025-03-07T08:37:52.950+01:00"},"s":"I","c":"ACCESS","id":5286307,"ctx":"conn18","msg":"Failed to authenticate","attr":{"client":"xxx.xxx.xxx.xxx(ip):xxxxx(port)","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"root","db":"admin","error":"AuthenticationFailed: SCRAM authentication failed, storedKey mismatch","result":18,"metrics":{"conversation_duration":{"micros":5091,"summary":{"0":{"step":1,"step_total":2,"duration_micros":62},"1":{"step":2,"step_total":2,"duration_micros":48}}}},"extraInfo":{}}}</code></pre>



<h4 id="h-check-for-logs-regarding-connections-to-the-mongodb-database" class="wp-block-heading"><strong>Check for logs regarding connections to the MongoDB database</strong></h4>



<p class="wp-block-paragraph">For filtering connections logs, search for the <code>attr.remote</code> field :</p>



<pre class="wp-block-code"><code>jq -c 'select(.attr.remote)' mongod.log</code></pre>



<h2 id="h-analyzing-slow-queries-with-jq" class="wp-block-heading">Analyzing slow queries with <code>jq</code></h2>



<p class="wp-block-paragraph">Inside the Mongo shell, you can activate logging for slow queries with <code>db.setProfilingLevel(1, &lt;slowms&gt;)</code>, with <code>&lt;slowms&gt;</code> being the threshold (in milliseconds) to log such queries.</p>



<p class="wp-block-paragraph"><strong>Warnings</strong> related to slow queries in MongoDB :</p>



<ul class="wp-block-list">
<li>Once activated, the slow queries logging could <strong>slow down the database</strong>, so be very careful when activating it.</li>



<li>There is a <strong>security threat</strong> when combining slow query logging and <strong>queryable encryption</strong>, since queries will not be encrypted in the <code>mongod.log</code> file.</li>
</ul>



<p class="wp-block-paragraph">Slow query logs look like this :</p>



<pre class="wp-block-code"><code>{
&nbsp; "t": { "$date": "2024-03-06T12:34:56.789Z" },
&nbsp; "s": "I",
&nbsp; "c": "COMMAND",
&nbsp; "id": 123,
&nbsp; "ctx": "conn20",
&nbsp; "msg": "Slow query",
&nbsp; "attr": {
&nbsp;&nbsp;&nbsp; "ns": "mydb.coll",
&nbsp;&nbsp;&nbsp; "command": { "find": "coll", "filter": { "status": "active" } },
&nbsp;&nbsp;&nbsp; "planSummary": "COLLSCAN",
&nbsp;&nbsp;&nbsp; "keysExamined": 0,
&nbsp;&nbsp;&nbsp; "docsExamined": 5000,
&nbsp;&nbsp;&nbsp; "numYields": 0,
&nbsp;&nbsp;&nbsp; "reslen": 2000,
&nbsp;&nbsp;&nbsp; "locks": { "Global": { "acquireCount": { "r": 1 } } },
&nbsp;&nbsp;&nbsp; "durationMillis": 150
&nbsp; }
}</code></pre>



<p class="wp-block-paragraph">With this in mind, and with what we have already seen, you can filter the logs with the fields you want, like <code>attr.durationMillis</code> (duration of the query, in milliseconds), or <code>attr.ns</code>, which is the object on which the query is made.</p>



<p class="wp-block-paragraph">For instance, if you want to retrieve slow queries above a given threshold (one second, in the example below) :</p>



<pre class="wp-block-code"><code>jq 'select(.attr.durationMillis &gt;= 1000)' mongod.log</code></pre>



<p class="wp-block-paragraph">Or if you want to filter slow queries on a specific database <code>mydb</code> and collection <code>coll</code> :</p>



<pre class="wp-block-code"><code>jq 'select(.msg == "Slow query" and .attr.ns == "mydb.coll")' mongod.log</code></pre>



<p class="wp-block-paragraph">You can also select only queries that are run on a given database <code>mydb</code> :</p>



<pre class="wp-block-code"><code>jq 'select(.msg == "Slow query" and .attr.command&#091;"$db"] == "mydb")' mongod.log
</code></pre>



<h2 id="h-mongodb-log-jq-query-builder" class="wp-block-heading">MongoDB log <code>jq</code> query builder</h2>



<p class="wp-block-paragraph">On my <a href="https://juliendelattre.com/tools/mongodb-log-jq-builder/" target="_blank" rel="noreferrer noopener">personal blog</a>, I designed a tool for MongoDB log analysis with jq. Feel free to check it out !</p>



<h2 id="h-conclusion" class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">While being a bit complex at first sight, MongoDB logs are very useful if you know how to apprehend them. By leveraging the <code>jq</code> utility for advanced filtering, and combining it with monitoring tools, you can efficiently analyze logs and improve your efficiency as a DBA.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mongodb-log-analysis-a-comprehensive-guide/">MongoDB Log Analysis : A Comprehensive Guide</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/mongodb-log-analysis-a-comprehensive-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Oracle 21c: Attention Log &#8211; Useful or Superflous?</title>
		<link>https://www.dbi-services.com/blog/oracle-21c-attention-log-useful-or-superflous/</link>
					<comments>https://www.dbi-services.com/blog/oracle-21c-attention-log-useful-or-superflous/#respond</comments>
		
		<dc:creator><![CDATA[Oracle Team]]></dc:creator>
		<pubDate>Thu, 11 Jul 2024 16:00:00 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[alert.log]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Oracle 21c]]></category>
		<category><![CDATA[Oracle 21c New features]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=33951</guid>

					<description><![CDATA[<p>Attention.log is a feature, which was introduced in Oracle Database 21c, designed to capture high-level summaries of significant database events and activities. It differs from the alert.log in following points: High-Level Summaries: The attention.log focuses on summarizing critical and significant events rather than logging every minor detail, including database startups and shutdowns, major configuration changes, [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-21c-attention-log-useful-or-superflous/">Oracle 21c: Attention Log &#8211; Useful or Superflous?</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Attention.log is a feature, which was introduced in Oracle Database 21c, designed to capture high-level summaries of significant database events and activities. It differs from the alert.log in following points:</p>



<p class="wp-block-paragraph"><strong>High-Level Summaries</strong>: The attention.log focuses on summarizing critical and significant events rather than logging every minor detail, including database startups and shutdowns, major configuration changes, errors or warnings that need immediate attention.</p>



<p class="wp-block-paragraph"><strong>Consolidation of Critical Events</strong>: It provides a consolidated view of the most important events, making it easier for database administrators to quickly review and identify critical issues without rummaging through through detailed logs.</p>



<p class="wp-block-paragraph"><strong>Accessibility</strong>: Designed to be easily readable and quickly accessible for a high-level overview of the database’s health and significant activities.</p>



<p class="wp-block-paragraph"><strong>Complementary to Alert Log</strong>: While the attention.log highlights major events, it complements the alert.log rather than replacing it. Database administrators can use the attention.log for a quick overview and the alert.log for detailed diagnostics.</p>



<p class="wp-block-paragraph"><strong>Location</strong>: Like the alert.log, the attention.log is also found in the DIAGNOSTIC_DEST directory, usually under $ORACLE_BASE/diag/rdbms/&lt;db_name&gt;/&lt;instance_name&gt;/log.</p>



<p class="wp-block-paragraph">It can be very helpful for not so experienced database administrators or to get a quick overview in difficult or unexpected cases, as I had on a productive environment some time ago: an internal error had occurred, the database crashed and the alert.log was far too large to read without splitting it up which of course makes troubleshooting unnecessarily difficult (under time pressure).</p>



<h2 class="wp-block-heading" id="h-how-to-get-information-about-the-attention-log"><strong>How to get information about the attention.log:</strong></h2>



<p class="wp-block-paragraph">The location of the attention log can be found by querying the&nbsp;<code>V$DIAG_INFO</code>&nbsp;view, it is in the same directory as the alert. log, (since Oracle 11g: $OH/diag/rdbms&#8230; )</p>



<pre class="wp-block-code"><code>select name, value
from   v$diag_info
where  name = 'Attention Log';

NAME                      VALUE
--------------------- -------------------------------------------------------------
Attention Log         /u01/app/oracle/diag/rdbms/cdb1/cdb1/trace/attention_cdb1.log</code></pre>



<p class="wp-block-paragraph">The oracle documentation proposes to query the V$DIAG_ALERT_EXT view to get relevant attention.log information, but it is a view over the XML-based alert.log (in the Automatic Diagnostic Repository for the current container), not the attention log! But nevertheless we can get very useful information out of it, divided into the same categories as in the attention.log:</p>



<pre class="wp-block-code"><code>--message_type 2=INCIDENT_ERROR, message_type 3=ERROR
SELECT message_type, message_level, message_text
FROM V$DIAG_ALERT_EXT 
WHERE message_type in (2, 3);

MESSAGE_TYPE MESSAGE_LEVEL MESSAGE_TEXT
------------ ------------- ---------------------------------------------------------
           3    4294967295 PMON (ospid: 3565): terminating the instance due to ORA error 471 </code></pre>



<p class="wp-block-paragraph">Querying <code>V$DIAG_ALERT_EXT</code> the most important labels are: </p>



<p class="wp-block-paragraph">MESSAGE_LEVEL:</p>



<p class="wp-block-paragraph"><code>1</code>:&nbsp;<code>CRITICAL</code>: critical errors</p>



<p class="wp-block-paragraph"><code>2</code>:&nbsp;<code>SEVERE</code>: severe errors</p>



<p class="wp-block-paragraph"><code>8</code>:&nbsp;<code>IMPORTANT</code>: important message</p>



<p class="wp-block-paragraph"><code>16</code>:&nbsp;<code>NORMAL</code>: normal message</p>



<p class="wp-block-paragraph">MESSAGE_TYPE:</p>



<p class="wp-block-paragraph"><code>1</code>:&nbsp;<code>UNKNOWN</code>: essentially the NULL type</p>



<p class="wp-block-paragraph"><code>2</code>:&nbsp;<code>INCIDENT_ERROR</code>: the program has encountered an error for some internal or unexpected reason, and it must be reported to Oracle Support</p>



<p class="wp-block-paragraph"><code>3</code>: <code>ERROR</code>: an error of some kind has occurred</p>



<p class="wp-block-paragraph"><code>4</code>: <code>WARNING</code>: an action occurred or a condition was discovered that should be reviewed and may require action</p>



<p class="wp-block-paragraph"><code>5</code>: <code>NOTIFICATION</code>: reports a normal action or event, this could be a user action such as &#8220;logon completed&#8221;</p>



<p class="wp-block-paragraph"><code>6</code>: <code>TRACE</code>: output of a diagnostic trace</p>



<p class="wp-block-paragraph">Opening the attention.log with vi</p>



<pre class="wp-block-code"><code>vi /u01/app/oracle/diag/rdbms/cdb1/cdb1/trace/attention_cdb1.log</code></pre>



<p class="wp-block-paragraph">will give you an output like this (JSON formatted), which is obviously pretty comfortable to read:</p>



<pre class="wp-block-code"><code>{
IMMEDIATE : "PMON (ospid: 3565): terminating the instance due to ORA error 471" 
CAUSE: "PMON detected fatal background process death"
ACTION: "Termination of fatal background is not recommended, Investigate cause of process termination"
CLASS : CDB-INSTANCE / CDB_ADMIN / ERROR / DBAL-35782660
TIME : 2024-07-10T14:15:16.159-07:00
INFO : "Some additional data on error PMON error"
}
</code></pre>



<p class="wp-block-paragraph">It is possible to convert the output into plain text format:</p>



<pre class="wp-block-code"><code>jq -r '.tags&#091;].name' input.json &gt; output.txt</code></pre>



<p class="wp-block-paragraph">which gives us a formatted expression that might look like this:</p>



<pre class="wp-block-code"><code>2024-07-01T10:15:32.123456+00:00
&#091;SEVERE] ORA-00600: internal error code, arguments: &#091;1234], &#091;], &#091;], &#091;], &#091;], &#091;], &#091;], &#091;], &#091;], &#091;], &#091;]
Action: Please contact Oracle Support Services.

2024-07-01T11:20:45.789012+00:00
&#091;CRITICAL] ORA-01578: ORACLE data block corrupted (file # 23, block # 220734)
Action: This error signifies a corrupted data block. The data block has been marked as corrupt. Consider restoring from backup.

2024-07-02T08:42:27.654321+00:00
&#091;ALERT] Database instance crashed due to unexpected termination.
Action: Investigate the cause of the instance termination. Review related logs and diagnostic information.

2024-07-03T12:34:56.987654+00:00
&#091;INFO] System global area (SGA) resized. New size: 68GB.
Action: No immediate action required. Monitor performance and stability.</code></pre>



<h2 class="wp-block-heading" id="h-key-points"><strong>Key Points</strong></h2>



<p class="wp-block-paragraph"><strong>Severity Levels</strong>: Entries are tagged with severity levels such as [SEVERE], [CRITICAL], [IMPORTANT] or [NORMAL] to highlight their importance.</p>



<p class="wp-block-paragraph"><strong>Timestamp</strong>: Each entry begins with a timestamp in ISO 8601 format.</p>



<p class="wp-block-paragraph"><strong>Messages and Actions</strong>: Each entry provides a brief description of the event and recommended actions.</p>



<h2 class="wp-block-heading" id="h-benefits-for-dbas"><strong>Benefits for DBAs</strong></h2>



<p class="wp-block-paragraph"><strong>Quick Identification</strong>: The attention.log helps DBAs quickly identify and respond to critical issues without sifting through the more detailed alert.log.</p>



<p class="wp-block-paragraph"><strong>Conciseness</strong>: It captures only the most significant events, reducing noise and making it easier to focus on urgent matters.</p>



<p class="wp-block-paragraph"><strong>Complementary to </strong><strong>alert.log</strong>: It complements the alert.log by summarizing critical events, while the alert.log continues to provide detailed information for troubleshooting.</p>



<p class="wp-block-paragraph">Overall, the attention.log is a useful addition for DBAs, enabling more efficient monitoring and quicker responses to significant database events.</p>



<h2 class="wp-block-heading" id="h-sources-links-amp-blogs"><strong>Sources, Links &amp; Blogs:</strong></h2>



<p class="wp-block-paragraph"><a href="https://oracle-base.com/articles/21c/attention-log-oracle-database-21c">https://oracle-base.com/articles/21c/attention-log-oracle-database-21c</a></p>



<p class="wp-block-paragraph"><a href="https://blogs.oracle.com/cloud-infrastructure/post/alert-log-support-for-oci-database-management">https://blogs.oracle.com/cloud-infrastructure/post/alert-log-support-for-oci-database-management</a></p>



<p class="wp-block-paragraph"><a href="https://docs.oracle.com/en/database/oracle/oracle-database/21/nfcon/management-solutions.html#GUID-F2EB58EC-4B22-473F-A2D3-40161372610E">https://docs.oracle.com/en/database/oracle/oracle-database/21/nfcon/management-solutions.html#GUID-F2EB58EC-4B22-473F-A2D3-40161372610E</a></p>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-21c-attention-log-useful-or-superflous/">Oracle 21c: Attention Log &#8211; Useful or Superflous?</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/oracle-21c-attention-log-useful-or-superflous/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How I killed my M-Files instance…and brought it back to life!</title>
		<link>https://www.dbi-services.com/blog/how-i-killed-my-m-files-instanceand-brought-it-back-to-life/</link>
					<comments>https://www.dbi-services.com/blog/how-i-killed-my-m-files-instanceand-brought-it-back-to-life/#respond</comments>
		
		<dc:creator><![CDATA[Guillaume Meunier]]></dc:creator>
		<pubDate>Wed, 29 May 2024 09:07:01 +0000</pubDate>
				<category><![CDATA[Application integration & Middleware]]></category>
		<category><![CDATA[Enterprise content management]]></category>
		<category><![CDATA[M-Files]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=33318</guid>

					<description><![CDATA[<p>I work with M-Files since 1 year now, and to be honest the solution is pretty robust.I had really few issues at &#8220;Server level&#8221;, but sooner and later while playing sorcerer&#8217;s apprentice you finish by breaking something. The inevitable happened, my M-Files instance became unusable, I assume the root cause is a combination of several [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-i-killed-my-m-files-instanceand-brought-it-back-to-life/">How I killed my M-Files instance…and brought it back to life!</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-medium"><img fetchpriority="high" decoding="async" width="300" height="300" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-300x300.png" alt="Oops it's broken" class="wp-image-33325" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-300x300.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-1024x1024.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-150x150.png 150w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-768x768.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over-1536x1536.png 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/game-over.png 1592w" sizes="(max-width: 300px) 100vw, 300px" /></figure>
</div>


<p class="wp-block-paragraph">I work with M-Files since 1 year now, and to be honest the solution is pretty robust.<br>I had really few issues at &#8220;Server level&#8221;, but sooner and later while playing sorcerer&#8217;s apprentice you finish by breaking something.</p>



<p class="wp-block-paragraph">The inevitable happened, my M-Files instance became unusable, I assume the root cause is a combination of several things:</p>



<ul class="wp-block-list">
<li>First I instanced too many Vaults on an undersized VM.</li>



<li>Then I restarted (violently) the host while M-Files was still working on some Vaults (using embedded Firebird DBs).</li>
</ul>



<p class="wp-block-paragraph">As a result, impossible to launch the Admin console: infinite loading when I wanted to list the Vaults.<br>Same behavior with the Desktop client and the Web Interface.</p>



<p class="wp-block-paragraph">My first and, naive thought was: </p>



<p class="wp-block-paragraph"><em>“OK, I applied the last monthly update and it might be related to that”.</em></p>



<p class="wp-block-paragraph">But no one is talking about this problem in the community….so I need to check for something else.</p>



<p class="wp-block-paragraph">Then I checked the logs, and I found some events like:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="572" height="251" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/EventError.png" alt="M-Files database error" class="wp-image-33320" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/EventError.png 572w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/EventError-300x132.png 300w" sizes="(max-width: 572px) 100vw, 572px" /></figure>
</div>


<p class="wp-block-paragraph">I was in a situation where the snake bites its tail, the problem is services cannot be stopped gracefully because some Vaults are not responding properly.<br>The admin tool is also not responding, I can&#8217;t bring the Vault offline neither run a &#8220;Verify and Repair&#8221;.</p>



<p class="wp-block-paragraph">It&#8217;s unusual to say that, but one of the problems with M-Files&#8217; stability is that there are very few resources (<a href="https://userguide.m-files.com/user-guide/latest/eng/managing_the_m_files_system.html" target="_blank" rel="noreferrer noopener">admin guide</a> or <a href="https://community.m-files.com/" target="_blank" rel="noreferrer noopener">community </a>threads) that talk about troubleshooting and recovery.</p>



<h2 class="wp-block-heading" id="h-how-i-fixed-it"><br>How I fixed it</h2>



<p class="wp-block-paragraph">I had then to &#8220;improvise&#8221; and find a way to move back in a stable state.</p>



<ol class="wp-block-list">
<li>First I changed the M-Files services startup mode to &#8220;Manual&#8221; and I restarted the host.</li>



<li>After the reboot, I moved all the folders with Vault data to a temporary location.</li>



<li>I changed back the services startup mode to &#8220;Automatic&#8221; and started M-Files.</li>



<li>I was able to access the Admin tool and list the Vault (all flagged Offline as folders are missing)</li>



<li>I moved back the Vault folder one by one, bring the Vault online and run the &#8220;Verify and Repair&#8221; on each.</li>



<li>Some of the Vaults required to be fixed:</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="433" height="306" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/VerifyDocumentVault.jpg" alt="Vault inconsistency" class="wp-image-33321" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/VerifyDocumentVault.jpg 433w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/VerifyDocumentVault-300x212.jpg 300w" sizes="(max-width: 433px) 100vw, 433px" /></figure>
</div>


<p class="wp-block-paragraph">Luckily it worked</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="320" height="155" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/Vault-issues.jpg" alt="it's fixed!" class="wp-image-33322" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/Vault-issues.jpg 320w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2024/05/Vault-issues-300x145.jpg 300w" sizes="auto, (max-width: 320px) 100vw, 320px" /></figure>
</div>


<p class="wp-block-paragraph">Finally my M-Files server is back with all the Vaults running and without having to restore any backup.</p>



<h2 class="wp-block-heading" id="h-in-conclusion">In conclusion </h2>



<p class="wp-block-paragraph">This mishap highlighted me one thing that may have an impact. My server is hosted in the Cloud and stopped during the night. I moved the backup schedules during evening hours when the server is still up, but I forgot to re-schedule the Maintenance activities when the VM is running.</p>



<p class="wp-block-paragraph">But the most important thing is to point out that it took me a year before I encountered a major incident. I have worked on several ECMs in recent years, and <strong>I remain impressed by the stability of M-Files</strong>.</p>



<p class="wp-block-paragraph">Feel free to contact <a href="https://www.dbi-services.com/technologies/m-files/" target="_blank" rel="noreferrer noopener">us</a> for any question about M-Files.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-i-killed-my-m-files-instanceand-brought-it-back-to-life/">How I killed my M-Files instance…and brought it back to life!</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/how-i-killed-my-m-files-instanceand-brought-it-back-to-life/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to delete a resource with the error: failed calling webhook</title>
		<link>https://www.dbi-services.com/blog/how-to-delete-a-resource-with-the-error-failed-calling-webhook/</link>
					<comments>https://www.dbi-services.com/blog/how-to-delete-a-resource-with-the-error-failed-calling-webhook/#respond</comments>
		
		<dc:creator><![CDATA[Nicolas Meunier]]></dc:creator>
		<pubDate>Thu, 25 Jan 2024 09:20:46 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[Cert-Manager]]></category>
		<category><![CDATA[GitLab]]></category>
		<category><![CDATA[kubernetes]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=30426</guid>

					<description><![CDATA[<p>The original mistake In preparation of the GitLab essentials workshop, I&#8217;m using helm to deploy it. After a few tests, I wanted to clean up my cluster, and accidentally deleted the namespace before doing helm uninstall. As a result, the namespace got stuck in the &#8220;terminating&#8221; state… Troubleshooting Now the namespace is stuck, but why [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-to-delete-a-resource-with-the-error-failed-calling-webhook/">How to delete a resource with the error: failed calling webhook</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="h-the-original-mistake">The original mistake</h2>



<p class="wp-block-paragraph">In preparation of the <a href="https://www.dbi-services.com/courses/gitlab-essentials/" target="_blank" rel="noreferrer noopener">GitLab essentials workshop</a>, I&#8217;m using helm to deploy it. After a few tests, I wanted to clean up my cluster, and accidentally deleted the namespace before doing helm uninstall. As a result, the namespace got stuck in the &#8220;terminating&#8221; state…</p>



<h2 class="wp-block-heading" id="h-troubleshooting">Troubleshooting</h2>



<p class="wp-block-paragraph">Now the namespace is stuck, but why ?</p>



<p class="wp-block-paragraph">However, no resources seem to exist yet in the namespace:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl get all -n gitlab
&gt; No resources found</code></pre>



<p class="wp-block-paragraph">By default, GitLab installs the cert-manager controller, which comes with CRDs. However, the get all command does not return the CRDs:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl get challenges.acme.cert-manager.io -n gitlab
NAME                                              STATE     DOMAIN                                   AGE
gitlab-gitlab-tls-c5nxj-1256604583-3239988248     invalid   gitlab-workshop.dbi-services.com     27m
gitlab-kas-tls-qghrb-3784695029-3983492218        invalid   kas-workshop.dbi-services.com        27m
gitlab-minio-tls-l8676-2620392232-3964581703      invalid   minio-workshop.dbi-services.com      27m
gitlab-registry-tls-k9j6n-1904257687-1249029966   invalid   registry-workshop.dbi-services.com   27m</code></pre>



<p class="wp-block-paragraph">CRDs delete does not work because the finalizer does not respond during deletion.</p>



<p class="wp-block-paragraph">The easiest way to do this is to remove the finalizer from the resource:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl patch challenges.acme.cert-manager.io/gitlab-gitlab-tls-c5nxj-1256604583-3239988248 --type=json --patch='&#091; { "op": "remove", "path": "/metadata/finalizers" } ]' -n gitlab
&gt; Error from server (InternalError): Internal error occurred: failed calling webhook "webhook.cert-manager.io": failed to call webhook: Post "https://gitlab-certmanager-webhook.gitlab.svc:443/mutate?timeout=10s": service "gitlab-certmanager-webhook" not found</code></pre>



<p class="wp-block-paragraph">Unfortunately, in this case, the patch doesn&#8217;t work because the delete of the namespace has removed some resources needed by the finalizer…</p>



<h2 class="wp-block-heading" id="h-solution">Solution</h2>



<p class="wp-block-paragraph">The cert-manager installs webhooks to manage CRDs:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl get ValidatingWebhookConfiguration
NAME                            WEBHOOKS   AGE
cert-manager-webhook            1          81m

rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl get MutatingWebhookConfiguration
NAME                         WEBHOOKS   AGE
gitlab-certmanager-webhook   1          81m</code></pre>



<p class="wp-block-paragraph">Webhooks call services and pods that no longer exist in our case. As a result, the webhook call fails and blocks the finalizer.</p>



<p class="wp-block-paragraph">To correct the problem, simply delete the webhooks:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl delete ValidatingWebhookConfiguration cert-manager-webhook
rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl delete MutatingWebhookConfiguration gitlab-certmanager-webhook</code></pre>



<p class="wp-block-paragraph">After that, it is possible to delete the remaining CRDs:</p>



<pre class="wp-block-code"><code>rocky@gitlab-master1:dbi-gitlab-ws:~$ kubectl patch challenges.acme.cert-manager.io/gitlab-gitlab-tls-c5nxj-1256604583-3239988248 --type=json --patch='&#091; { "op": "remove", "path": "/metadata/finalizers" } ]' -n gitlab
&gt; challenge.acme.cert-manager.io/gitlab-gitlab-tls-c5nxj-1256604583-3239988248 patched</code></pre>



<p class="wp-block-paragraph">The namespace will be automatically deleted once all CRDs have been cleaned.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-to-delete-a-resource-with-the-error-failed-calling-webhook/">How to delete a resource with the error: failed calling webhook</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/how-to-delete-a-resource-with-the-error-failed-calling-webhook/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ODA and KVM: Debugging of DBsystem creation failure</title>
		<link>https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/</link>
					<comments>https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/#respond</comments>
		
		<dc:creator><![CDATA[David Hueber]]></dc:creator>
		<pubDate>Fri, 05 Nov 2021 10:47:59 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ODA]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/</guid>

					<description><![CDATA[<p>Debugging errors when working with ODA is not always the easiest thing do&#8230; 😛 It may become a bit tricky and not a straightforward process. In this blog I wanted to show you and example we faced with the debugging of a Dbsystem creation failure and how we found out the real reason it failed. [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/">ODA and KVM: Debugging of DBsystem creation failure</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Debugging errors when working with ODA is not always the easiest thing do&#8230; <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>It may become a bit tricky and not a straightforward process. In this blog I wanted to show you and example we faced with the debugging of a Dbsystem creation failure and how we found out the real reason it failed.</p>
<p><span id="more-16770"></span></p>
<p>Before starting let&#8217;s do a short reminder about <a href="https://docs.oracle.com/en/engineered-systems/oracle-database-appliance/19.12/cmtxn/managing-oracle-database-appliance-kvm-deployment1.html#GUID-7123ADEA-7134-42E8-95CC-E2F444DBAC27">KVM virtualisation on ODA</a>.</p>
<p>Since 19.9, ODA supports hard partitioning for database virtualisation on ODA. This works on a principle based on 2 types of VMs:</p>
<ol>
<li>Compute instance (more info <a href="https://www.dbi-services.com/blog/oracle-database-appliance-kvm-virtual-instance-on-oda-19-12/">here</a>)</li>
<li>DB Systems</li>
</ol>
<p>While the first one is intended for traditional VM hosted any workload except oracle DBs, the second one is dedicated to database virtualisation.<br />
A DB System is then an Oracle Linux with a similar stack than the ODA  BM (GI, DB, &#8230;).</p>
<p>Provisioning a new DBSystem is pretty easy and straightforward using the command odaacli create-dbsystem and a JSON file as input&#8230;as long as it works&#8230;and you don&#8217;t do any mistake.</p>
<p>In our case, here the error we got when trying to create a new DB System:</p>
<pre class="brush: bash; gutter: true; first-line: 1">Job details
----------------------------------------------------------------
                     ID:  75115716-4ce3-4eb1-af1a-4d3d8bef441a
            Description:  DB System srvdb01 creation
                 Status:  Failure
                Created:  November 5, 2021 11:37:48 AM CET
                Message:  DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.

Task Name                                Start Time                          End Time                            Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
Create DB System metadata                November 5, 2021 11:37:48 AM CET    November 5, 2021 11:37:48 AM CET    Success
Persist new DB System                    November 5, 2021 11:37:48 AM CET    November 5, 2021 11:37:48 AM CET    Success
Validate DB System prerequisites         November 5, 2021 11:37:48 AM CET    November 5, 2021 11:37:52 AM CET    Success
Setup DB System environment              November 5, 2021 11:37:52 AM CET    November 5, 2021 11:37:53 AM CET    Success
Create DB System ASM volume              November 5, 2021 11:37:53 AM CET    November 5, 2021 11:38:00 AM CET    Success
Create DB System ACFS filesystem         November 5, 2021 11:38:00 AM CET    November 5, 2021 11:38:09 AM CET    Success
Create DB System VM ACFS snapshots       November 5, 2021 11:38:09 AM CET    November 5, 2021 11:38:39 AM CET    Success
Create temporary SSH key pair            November 5, 2021 11:38:39 AM CET    November 5, 2021 11:38:39 AM CET    Success
Create DB System cloud-init config       November 5, 2021 11:38:39 AM CET    November 5, 2021 11:38:40 AM CET    Success
Provision DB System VM(s)                November 5, 2021 11:38:40 AM CET    November 5, 2021 11:38:41 AM CET    Success
Attach disks to DB System                November 5, 2021 11:38:41 AM CET    November 5, 2021 11:38:41 AM CET    Success
Add DB System to Clusterware             November 5, 2021 11:38:41 AM CET    November 5, 2021 11:38:41 AM CET    Success
Start DB System                          November 5, 2021 11:38:41 AM CET    November 5, 2021 11:38:44 AM CET    Success
Wait DB System VM first boot             November 5, 2021 11:38:44 AM CET    November 5, 2021 11:39:56 AM CET    Success
Setup Mutual TLS (mTLS)                  November 5, 2021 11:39:56 AM CET    November 5, 2021 11:40:15 AM CET    Success
Export clones repository                 November 5, 2021 11:40:15 AM CET    November 5, 2021 11:40:15 AM CET    Success
Setup ASM client cluster config          November 5, 2021 11:40:16 AM CET    November 5, 2021 11:40:18 AM CET    Success
Install DB System                        November 5, 2021 11:40:18 AM CET    November 5, 2021 11:40:26 AM CET    InternalError</pre>
<p>So&#8230;it failed on installing DB into the newly creaated VM. Error code is: DCS-10001:Internal error</p>
<p>The first we tried is to get more info on this error code using dcserr:</p>
<pre class="brush: bash; gutter: true; first-line: 1">[root@dbi-oda-x8 log]# dcserr 10001
10001, Internal_Error, "Internal error encountered: {0}."
// *Cause: An internal error occurred.
// *Action: Contact Oracle Support Services for assistance.
/</pre>
<p>Not helping very much&#8230; Unfortunately the describe-job doesn&#8217;t give much more information about any kind of log file&#8230;</p>
<p>The only remaining solution is then to analyse the DCS log file. All operation we run using odacli are going through the dcsagent which generates a log in:</p>
<pre>/opt/oracle/dcs/log</pre>
<p class="brush: bash; gutter: true; first-line: 1">There you will find several types of log file such as the dcs-admin one or the dcs-components and obviously the dcs-agent log file</p>
<pre class="brush: bash; gutter: true; first-line: 1">[root@dbi-oda-x8 log]# pwd
/opt/oracle/dcs/log
[root@dbi-oda-x8 log]# ls -l dcs-agent*
-rw-r--r-- 1 root root 144752279 Nov 3 23:30 dcs-agent-2021-11-03.log
-rw-r--r-- 1 root root 231235959 Nov 4 23:30 dcs-agent-2021-11-04.log
-rw-r--r-- 1 root root 151900 Nov 3 11:59 dcs-agent-requests-2021-11-03-03.log
-rw-r--r-- 1 root root 60331 Nov 3 12:59 dcs-agent-requests-2021-11-03-11.log
-rw-r--r-- 1 root root 122337 Nov 3 13:58 dcs-agent-requests-2021-11-03-13.log
-rw-r--r-- 1 root root 74029 Nov 3 14:59 dcs-agent-requests-2021-11-03-14.log
-rw-r--r-- 1 root root 112641 Nov 3 15:59 dcs-agent-requests-2021-11-03-15.log
-rw-r--r-- 1 root root 154503 Nov 3 16:59 dcs-agent-requests-2021-11-03-16.log
-rw-r--r-- 1 root root 10575 Nov 3 17:03 dcs-agent-requests-2021-11-03-17.log
-rw-r--r-- 1 root root 184 Nov 4 07:53 dcs-agent-requests-2021-11-04-07.log
-rw-r--r-- 1 root root 24097 Nov 4 08:42 dcs-agent-requests-2021-11-04-08.log
-rw-r--r-- 1 root root 6556 Nov 4 09:59 dcs-agent-requests-2021-11-04-09.log
-rw-r--r-- 1 root root 7711 Nov 4 10:56 dcs-agent-requests-2021-11-04-10.log
-rw-r--r-- 1 root root 17646 Nov 4 11:52 dcs-agent-requests-2021-11-04-11.log
-rw-r--r-- 1 root root 1837 Nov 4 12:58 dcs-agent-requests-2021-11-04-12.log
-rw-r--r-- 1 root root 122202 Nov 4 13:59 dcs-agent-requests-2021-11-04-13.log
-rw-r--r-- 1 root root 71837 Nov 4 14:59 dcs-agent-requests-2021-11-04-14.log
-rw-r--r-- 1 root root 215518 Nov 4 15:59 dcs-agent-requests-2021-11-04-15.log
-rw-r--r-- 1 root root 4497 Nov 4 16:24 dcs-agent-requests-2021-11-04-16.log
-rw-r--r-- 1 root root 660 Nov 5 07:56 dcs-agent-requests-2021-11-05-07.log
-rw-r--r-- 1 root root 513 Nov 5 08:00 dcs-agent-requests-2021-11-05-08.log
-rw-r--r-- 1 root root 45592 Nov 5 10:59 dcs-agent-requests-2021-11-05-10.log
-rw-r--r-- 1 root root 126945 Nov 5 11:59 dcs-agent-requests-2021-11-05-11.log
-rw-r--r-- 1 root root 17460 Nov 5 12:21 dcs-agent-requests.log
-rw-r--r-- 1 root root 75603907 Nov 5 12:21 dcs-agent.log</pre>
<p>However the challenge is that this log file is pretty verbose and therefore pretty long.<br />
Just to give you and idea, on our test ODA (where there were nothing much running) we had already almost 1 million rows in an half day.</p>
<p>So the option we used was to run a grep command to gather only the lines concerning the DB System we tried to create:</p>
<p>grep srvdb01 dcs-agent.log</p>
<p>&#8230;which still represents 850+ lines <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Going bottom up, we found first all entries about the DELET DB SYSTEM we run after the failure, such as:</p>
<pre class="brush: bash; gutter: true; first-line: 1">...
2021-11-05 11:47:50,962 INFO [dw-19811 - DELETE /dbsystem/srvdb01] [] c.o.d.a.k.o.l.SingleNodeLockController: Thread 'dw-19811 - DELETE /dbsystem/srvdb01' released READ lock for Resource type 'Metadata' with name 'metadata'
2021-11-05 11:47:50,963 INFO [dw-19811 - DELETE /dbsystem/srvdb01] [] c.o.d.a.k.m.KvmBaseModule: Starting new job 586fce36-8131-4f46-b447-36fab882f060 for taskFlow: seq(id: 586fce36-8131-4f46-b447-36fab882f060, name: 586fce36-8131-4f46-b447-36fab882f060, jobId: 586fce36-8131-4f46-b447-36fab882f060, status: Created,exposeTaskResultToJob: false, result: null, output: , on_failure: FailOnAny):
2021-11-05 11:47:50,963 INFO [dw-19811 - DELETE /dbsystem/srvdb01] [] c.o.d.a.k.m.KvmBaseModule: Job report: ServiceJobReport(jobId=586fce36-8131-4f46-b447-36fab882f060, status=Created, message=null, reports=[], createTimestamp=2021-11-05 11:47:50.957, resourceList=[], description=DB System srvdb01 deletion, updatedTime=2021-11-05 11:47:50.957)
  "description" : "DB System srvdb01 deletion",
  "description" : "DB System srvdb01 deletion",
2021-11-05 11:47:50,973 INFO [DeleteDbSystem_KvmLockContainer_38554 : JobId=586fce36-8131-4f46-b447-36fab882f060] [] c.o.d.a.k.o.l.SingleNodeLockController: Thread 'DeleteDbSystem_KvmLockContainer_38554 : JobId=586fce36-8131-4f46-b447-36fab882f060' trying to acquire WRITE lock for Resource type 'DB System' with name 'srvdb01'
2021-11-05 11:47:50,973 INFO [DeleteDbSystem_KvmLockContainer_38554 : JobId=586fce36-8131-4f46-b447-36fab882f060] [] c.o.d.a.k.o.l.SingleNodeLockController: Thread 'DeleteDbSystem_KvmLockContainer_38554 : JobId=586fce36-8131-4f46-b447-36fab882f060' acquired WRITE lock for Resource type 'DB System' with name 'srvdb01'
	 Mountpath: /u05/app/sharedrepo/srvdb01
...</pre>
<p>So we could simply skip all lines containing DELET or Operation Type = Delete.</p>
<p>Then arrive plenty of lines which contains the error message you receive in the odacli describe-job as well as the content of the JSON file used to run the job.</p>
<pre class="brush: bash; gutter: true; first-line: 1">...
2021-11-05 11:46:48,763 DEBUG [Process new DB System] [] c.o.d.a.k.t.KvmBaseTaskBuilder$KvmTaskExecutor: Output request: DbSystemCreateRequest(systemInfo=DbSystemCreateRequest.SystemInfo(dbSystemName=srvdb01, shapeName=odb2, cpuPoolName=cpupool4srv, diskGroup=DATA, systemPassword=*****, provisionType=rhp, timeZone=Europe/Zurich, enableRoleSeparation=true, customRoleSeparationInfo=DbSystemCreateRequest.CustomRoleSeparationInfo(groups=[DbSystemCreateRequest.GroupInfo(id=1001, role=oinstall, name=oinstall), DbSystemCreateRequest.GroupInfo(id=1002, role=dbaoper, name=dbaoper), DbSystemCreateRequest.GroupInfo(id=1003, role=dba, name=dba), DbSystemCreateRequest.GroupInfo(id=1004, role=asmadmin, name=asmadmin), DbSystemCreateRequest.GroupInfo(id=1005, role=asmoper, name=asmoper), DbSystemCreateRequest.GroupInfo(id=1006, role=asmdba, name=asmdba)], users=[DbSystemCreateRequest.UserInfo(id=1000, role=gridUser, name=grid), DbSystemCreateRequest.UserInfo(id=1001, role=oracleUser, name=oracle)])), networkInfo=DbSystemCreateRequest.NetworkInfo(domainName=dbi-lab.ch, ntpServers=[216.239.35.0], dnsServers=[8.8.8.8, 8.8.4.4], scanName=null, scanIps=null, nodes=[DbSystemCreateRequest.NetworkNodeInfo(number=0, name=srvdb01, ipAddress=10.36.0.245, netmask=255.255.255.0, gateway=10.36.0.1, vipName=null, vipAddress=null)], publicVNetwork=pubnet), gridInfo=DbSystemCreateRequest.GridInfo(language=en, enableAfd=false), dbInfo=DbSystemCreateRequest.DbInfo(name=srvTEST, uniqueName=srvTEST, domainName=dbi-lab.ch, adminPassword=**********, version=19.12.0.0.210720, edition=EE, type=SI, dbClass=OLTP, shape=odb2, role=PRIMARY, redundancy=MIRROR, characterSet=DbSystemCreateRequest.DbCharacterSetInfo(characterSet=AL32UTF8, nlsCharacterSet=AL16UTF16, dbTerritory=AMERICA, dbLanguage=ENGLISH), enableDbConsole=false, enableFlashStorage=false, enableFlashCache=false, enableSEHA=false, rmanBackupPassword=*****, level0BackupDay=null, tdePassword=*****, enableTde=false, enableUnifiedAuditing=true, isCdb=false, pdbName=null, pdbAdminUser=null, targetNodeNumber=null), devInfo=null)
2021-11-05 11:46:48,763 DEBUG [CreateDbSystem_KvmLockContainer_38327 : JobId=33793dd8-6704-407a-8dd0-f2b83a9deb10] [] c.o.d.c.t.TaskDetail: set task result as DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
2021-11-05 11:46:48,763 INFO [CreateDbSystem_KvmLockContainer_38327 : JobId=33793dd8-6704-407a-8dd0-f2b83a9deb10] [] c.o.d.a.k.t.KvmBaseTaskBuilder$KvmLockContainer:  Task[id: CreateDbSystem_KvmLockContainer_38327, TaskName: CreateDbSystem_KvmLockContainer_38327] result: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
2021-11-05 11:46:48,763 DEBUG [33793dd8-6704-407a-8dd0-f2b83a9deb10 : JobId=33793dd8-6704-407a-8dd0-f2b83a9deb10] [] c.o.d.c.t.TaskDetail: set task result as DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
2021-11-05 11:46:48,763 DEBUG [33793dd8-6704-407a-8dd0-f2b83a9deb10 : JobId=33793dd8-6704-407a-8dd0-f2b83a9deb10] [] c.o.d.a.k.m.i.KvmJobHelper$KvmTaskReportRecorder: Recording job report: id: 33793dd8-6704-407a-8dd0-f2b83a9deb10, name: 33793dd8-6704-407a-8dd0-f2b83a9deb10, jobId: 33793dd8-6704-407a-8dd0-f2b83a9deb10, status: Failure,exposeTaskResultToJob: false, result: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''., output:
  "message" : "DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.",
  "description" : "DB System srvdb01 creation",
  "message" : "<strong>DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.</strong>",
  "description" : "DB System srvdb01 creation",
...</pre>
<p>Still not much useful&#8230;so we skipped these too and continue our journey upward. Finally looking for the first (going up) line without any error, we could found in the next one the following message:</p>
<pre class="brush: bash; gutter: true; first-line: 1">2021-11-05 11:46:47,948 INFO [dw-18140 - GET /instances/storage/dgSpace/ALL] [] c.o.i.a.IDMAgentAuthorizer: IDMAgentAuthorizer::user:ODA-srvdb01:role:list-dgstorages
! Causing: com.oracle.dcs.commons.exception.DcsException: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
! Causing: com.oracle.dcs.commons.exception.DcsException: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
! Causing: com.oracle.dcs.commons.exception.DcsException: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.
2021-11-05 11:46:48,745 DEBUG [Install DB System : JobId=33793dd8-6704-407a-8dd0-f2b83a9deb10] [] c.o.d.a.k.m.i.KvmJobHelper$KvmTaskReportRecorder: Recording task report: id: CreateDbSystem_KvmTask_38345,name: Install DB System, jobId: 33793dd8-6704-407a-8dd0-f2b83a9deb10, status: InternalError,exposeTaskResultToJob: false, result: DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.,output: DcsException{errorHttpCode=InternalError, msg=Internal error encountered: Error creating job 'Provision DB System 'srvdb01''., msgId=10001,causedBy=com.oracle.pic.commons.client.exceptions.RestClientException: <strong>DCS-11002:Password for database admin user does not comply with the password policy</strong>.}
  "taskResult" : "DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.",
  "taskResult" : "DCS-10001:Internal error encountered: Error creating job 'Provision DB System 'srvdb01''.",</pre>
<p>Look at the 4th line <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> &#8230;yes at the end&#8230;scroll a bit more&#8230;here we go:</p>
<pre>client.exceptions.RestClientException: <strong>DCS-11002:Password for database admin user does not comply with the password policy</strong>.}</pre>
<p>&nbsp;</p>
<p>So finally the root cause of the failure was &#8220;simply&#8221; that the password given for the sys/system accounts was not compliant&#8230; <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f615.png" alt="😕" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f615.png" alt="😕" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>However the remaining question is: Why don&#8217;t we get this error message back in the odacli describe-job instead of a useless generic error message??</p>
<p>It would have been so easier:</p>
<pre class="brush: bash; gutter: true; first-line: 1">[root@dbi-oda-x8 log]# dcserr 11002
11002, Password_too_simple, "Password for {0} does not comply with the password policy."
// *Cause: The user provided password does not satisfy the password policy rules.
// *Action: Refer to the Deployment and User's Guide for the password policy.
//          Provide a password which meets the criteria.
/

</pre>
<p>I hope that this can help.</p>
<p>Enjoy! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f60e.png" alt="😎" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>L’article <a href="https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/">ODA and KVM: Debugging of DBsystem creation failure</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/oda-and-kvm-debugging-of-dbsystem-creation-failure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to view and change SQL Server Agent properties with T-SQL queries</title>
		<link>https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/</link>
					<comments>https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/#comments</comments>
		
		<dc:creator><![CDATA[Stéphane Haby]]></dc:creator>
		<pubDate>Tue, 24 Aug 2021 04:26:30 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/</guid>

					<description><![CDATA[<p>Few days ago, after a reboot, we had this warning on the Agent Error Logs on many servers: Warning [396] An idle CPU condition has not been defined &#8211; OnIdle job schedules will have no effect “The CPU idle definition influences how Microsoft SQL Server Agent responds to events. For example, suppose that you define [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/">How to view and change SQL Server Agent properties with T-SQL queries</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Few days ago, after a reboot, we had this warning on the Agent Error Logs on many servers:<br />
<strong>Warning [396] An idle CPU condition has not been defined &#8211; OnIdle job schedules will have no effect</strong><br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_00.png"><img loading="lazy" decoding="async" class="size-medium wp-image-51275 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_00.png" alt="" width="300" height="126" /></a></p>
<p>“The CPU idle definition influences how Microsoft SQL Server Agent responds to events. For example, suppose that you define the CPU idle condition as when the average CPU usage falls below 10 percent and remains at this level for 10 minutes. Then if you have defined jobs to execute whenever the server CPU reaches an idle condition, the job will start when the CPU usage falls below 10 percent and remains at that level for 10 minutes. “ dixit Microsoft documentation <a href="https://docs.microsoft.com/en-us/sql/ssms/agent/set-cpu-idle-time-and-duration-sql-server-management-studio?redirectedfrom=MSDN&amp;view=sql-server-ver15" target="_blank" rel="noopener">here</a>.<br />
To resolve this warning, you need to go to the Agent Properties&gt;Advanced and check “Define idle CPU condition”<br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_01.png"><img loading="lazy" decoding="async" class="size-medium wp-image-51274 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_01.png" alt="" width="300" height="167" /></a><br />
The query used to check it is:</p>
<pre class="brush: sql; gutter: true; first-line: 1">USE [msdb]
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @cpu_poller_enabled=1
GO</pre>
<p>With this issue, I will also give you some helpful queries to have a look on the Agent properties.<br />
The best way to retrieve the information about the Agent properties is to use the Store Procedure: <strong>msdb.dbo.sp_get_sqlagent_properties</strong><br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_02.png"><img loading="lazy" decoding="async" class="size-medium wp-image-51272 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_02.png" alt="" width="300" height="155" /></a><br />
All information about the Agent Properties are in the Registry: <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent</strong><br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_03.png"><img loading="lazy" decoding="async" class="size-medium wp-image-51271 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_03.png" alt="" width="300" height="207" /></a><br />
You can of course read directly the value in the Registry with the query:</p>
<pre class="brush: sql; gutter: true; first-line: 1">EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent',N' CoreEngineMask', @cpu_poller_enabled OUTPUT, N'no_output'</pre>
<p>In my case the information is on the Value Name CoreEngineMask and to have the value, you need to do a filter like this:</p>
<pre class="brush: sql; gutter: true; first-line: 1">IF (@cpu_poller_enabled IS NOT NULL)
SELECT @cpu_poller_enabled = CASE WHEN (@cpu_poller_enabled &amp; 32) = 32 THEN 0 ELSE 1 END</pre>
<p>To finish this article, I will give you the query that I use to put the information from the Stored Procedure in a Table to retrieve the information that need more easily:</p>
<pre class="brush: sql; gutter: true; first-line: 1">CREATE TABLE #sqlagent_properties
(
auto_start INT,
msx_server_name sysname NULL,
sqlagent_type INT,
startup_account NVARCHAR(100) NULL,
sqlserver_restart INT,
jobhistory_max_rows INT,
jobhistory_max_rows_per_job INT,
errorlog_file NVARCHAR(255) NULL,
errorlogging_level INT,
errorlog_recipient NVARCHAR(255) NULL,
monitor_autostart INT,
local_host_server sysname NULL,
job_shutdown_timeout INT,
cmdexec_account VARBINARY(64) NULL,
regular_connections INT,
host_login_name sysname NULL,
host_login_password VARBINARY(512) NULL,
login_timeout INT,
idle_cpu_percent INT,
idle_cpu_duration INT,
oem_errorlog INT,
sysadmin_only NVARCHAR(64) NULL,
email_profile NVARCHAR(64) NULL,
email_save_in_sent_folder INT,
cpu_poller_enabled INT,
alert_replace_runtime_tokens INT
)

INSERT INTO #sqlagent_properties
EXEC msdb.dbo.sp_get_sqlagent_properties
GO

SELECT cpu_poller_enabled FROM #sqlagent_properties

DROP TABLE #sqlagent_properties</pre>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_04.png"><img loading="lazy" decoding="async" class="size-medium wp-image-51270 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/SQLAgent_396_04.png" alt="" width="168" height="300" /></a></p>
<p>I hope this can help you when you search the Agent Properties and want to change it on your SQL Server environment</p>
<p>L’article <a href="https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/">How to view and change SQL Server Agent properties with T-SQL queries</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/how-to-view-and-change-sql-server-agent-properties-with-t-sql-queries/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Upgrade to Oracle 19c &#8211; performance issue</title>
		<link>https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/</link>
					<comments>https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/#respond</comments>
		
		<dc:creator><![CDATA[Oracle Team]]></dc:creator>
		<pubDate>Thu, 15 Oct 2020 11:37:54 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[12.2]]></category>
		<category><![CDATA[Oracle 12c]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pluggable Databases]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Upgrade]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/</guid>

					<description><![CDATA[<p>In this blog I want to introduce you to a workaround for a performance issue which randomly appeared during the upgrades of several Oracle 12c databases to 19c I performed for a financial services provider. During the upgrades we ran into a severe performance issue after the upgrades of more than 40 databases had worked [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/">Upgrade to Oracle 19c &#8211; performance issue</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this blog I want to introduce you to a workaround for a performance issue which randomly appeared during the upgrades of several Oracle 12c databases to 19c I performed for a financial services provider. During the upgrades we ran into a severe performance issue after the upgrades of more than 40 databases had worked just fine. While most of them finished in less than one hour, we run into one which would have taken days to complete.</p>
<p><u>Issue</u></p>
<p>After starting the database upgrade from Oracle 12.2.0.1.0 to Production Version 19.8.0.0.0 the upgrade locked up during compiling:</p>
<pre class="brush: sql; gutter: true; first-line: 1">@utlrp</pre>
<p>&nbsp;</p>
<p><u>Reason</u></p>
<p>One select-statement on the unified_audit_trail was running for hours with no result, blocking the upgrade progress and consuming nearly all database resources. The size of the audit_trail itself was about 35MB, so not the size you would expect such a bottleneck from:</p>
<pre class="brush: sql; gutter: true; first-line: 1">SQL&gt; SELECT count(*) from gv$unified_audit_trail;</pre>
<p>&nbsp;</p>
<p><u>Solution</u></p>
<p>After some research and testing (see notes below) I found the following workaround (after killing the upgrade process):</p>
<pre class="brush: sql; gutter: true; first-line: 1">SQL&gt; begin
DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(
audit_trail_type =&gt; DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
use_last_arch_timestamp =&gt; FALSE);
end;
/
SQL&gt; set timing on;
SELECT count(*) from gv$unified_audit_trail;
exec DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
</pre>
<p>&nbsp;</p>
<p><u>Note</u></p>
<p>As a first attempt I used the procedure below, described in Note 2212196.1.</p>
<p>But flush_unified_audit_trail lasted too long, so I killed the process after it ran for one hour. The flash procedure again worked fine after using clean_audit_trail as described above:</p>
<pre class="brush: sql; gutter: true; first-line: 1">SQL&gt; begin
DBMS_AUDIT_MGMT.FLUSH_UNIFIED_AUDIT_TRAIL;
for i in 1..10 loop
DBMS_AUDIT_MGMT.TRANSFER_UNIFIED_AUDIT_RECORDS;
end loop;
end;
/</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>A few days later we encountered the same issue on an Oracle 12.1.0.2 database which requires <a href="https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&amp;sourceId=2212196.1&amp;patchId=25985768">Patch 25985768</a> for executing dbms_audit_mgmt.transfer_unified_audit_records.</p>
<p>This procedure is available out of the box in the Oracle 12.2 database and in the Oracle 12.1.0.2 databases which have been patched with <a href="https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&amp;sourceId=2212196.1&amp;patchId=25985768">Patch 25985768</a>.</p>
<p>To avoid to get caught in this trap it is my advise that you gather all relevant statistics before any upgrade from Oracle 12c to 19c and to query gv$unified_audit_trail in advance. This query usually finishes within a few seconds.</p>
<p>&nbsp;</p>
<p><u>Related documents</u></p>
<p>Doc ID 2212196.1</p>
<p>https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=257639407234852&#038;id=2212196.1&#038;_afrWindowMode=0&#038;_adf.ctrl-state=rd4zvw12p_4</p>
<p>Master Note For Database Unified Auditing (Doc ID 2351084.1)</p>
<p>Bug 18920838 : 12C POOR QUERY PERFORMANCE ON DICTIONARY TABLE SYS.X$UNIFIED_AUDIT_TRAIL</p>
<p>Bug 21119008 : POOR QUERY PERFORMANCE ON UNIFIED_AUDIT_TRAIL</p>
<p>Performance Issues While Monitoring the Unified Audit Trail of an Oracle12c Database (Doc ID 2063340.1)</p>
<p>L’article <a href="https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/">Upgrade to Oracle 19c &#8211; performance issue</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/upgrade-to-oracle-19c-performance-issue/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Troubleshooting performance on Autonomous Database</title>
		<link>https://www.dbi-services.com/blog/troubleshooting-autonomous-database/</link>
					<comments>https://www.dbi-services.com/blog/troubleshooting-autonomous-database/#respond</comments>
		
		<dc:creator><![CDATA[Oracle Team]]></dc:creator>
		<pubDate>Sat, 29 Aug 2020 16:05:10 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[19c]]></category>
		<category><![CDATA[Autonomous]]></category>
		<category><![CDATA[PerfHub]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/troubleshooting-autonomous-database/</guid>

					<description><![CDATA[<p>By Franck Pachot . On my Oracle Cloud Free Tier Autonomous Transaction Processing service, a database that can be used for free with no time limit, I have seen this strange activity. As I&#8217;m running nothing scheduled, I was surprised by this pattern and looked at it by curiosity. And I got the idea to [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/troubleshooting-autonomous-database/">Troubleshooting performance on Autonomous Database</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>By Franck Pachot</h2>
<p>.<br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Annotation-2020-08-28-171455.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42869" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Annotation-2020-08-28-171455.jpg" alt="" width="1853" height="145" /></a><br />
On my Oracle Cloud Free Tier Autonomous Transaction Processing service, a database that can be used for free with no time limit, I have seen this strange activity. As I&#8217;m running nothing scheduled, I was surprised by this pattern and looked at it by curiosity. And I got the idea to take some screenshot to show you how I look at those things. The easiest performance tool available in the Autonomous Database is the Performance Hub which shows the activity though time with detail on multiple dimensions for drill-down analysis. This is based on ASH of course.</p>
<p>In the upper pane, I focus on the part with homogenous activity because I may views the content without the timeline and then want to compare the activity metric (Average Active Session) with the peak I observed. Without this, I may start to look to something that is not significant and waste my time. Here, where the activity is about 1 active session, I want to drill-down on dimensions that account for around 0.8 active sessions to be sure to address 80% of the surprising activity. If the part selected includes some idle time around, I would not be able to do this easily.</p>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Session-Attributes.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42852" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Session-Attributes.jpg" alt="" width="1896" height="893" /></a></p>
<p>The second pane let me drill-down either on 3 dimensions in a load map (we will see that later), or one main dimension with the time axis (in this screenshot the dimension is &#8220;Consumer Group&#8221;) with two other dimensions below displayed without the time detail, here &#8220;Wait Class&#8221; and &#8220;Wait Event&#8221;. This is where I want to compare the activity (0.86 average active session on CPU) to the load I&#8217;m looking at, as I don&#8217;t have the time to see peaks and idle periods.</p>
<ul>
<li>I see &#8220;Internal&#8221; for all &#8220;Session Attributes&#8221; ASH dimensions, like &#8220;Consumer Group&#8221;, &#8220;Module&#8221;, &#8220;Action&#8221;, &#8220;Client&#8221;, &#8220;Client Host Port&#8221;</li>
<li>About &#8220;Session Identifiers&#8221; ASH dimensions, I still see &#8220;internal&#8221; for &#8220;User Session&#8221;, &#8220;User Name&#8221; and &#8220;Program&#8221;.</li>
<li>&#8220;Parallel Process&#8221; shows &#8220;Serial&#8221; and &#8220;Session Type&#8221; shows &#8220;Foreground&#8221; which doesn&#8217;t give me more information</li>
</ul>
<p>I have more information from &#8220;Resource Consumption&#8221;:</p>
<ul>
<li>ASH Dimension &#8220;Wait Class&#8221;: mostly &#8220;CPU&#8221; and some &#8220;User I/O&#8221;</li>
<li>ASH Dimension &#8220;Wait Event&#8221;: the &#8220;User I/O&#8221; is &#8220;direct path read temp&#8221;</li>
</ul>
<p>I&#8217;ll dig into those details later. There&#8217;s no direct detail for the CPU consumption. I&#8217;ll look at logical reads of course, and SQL Plan but I cannot directly match the CPU time with that. Especially from Average Active Session where I don&#8217;t have the CPU time &#8211; I have only samples there. It may be easier with &#8220;User I/O&#8221; because they should show up in other dimensions.</p>
<p>There are no &#8220;Blocking Session&#8221; but the ASH Dimension &#8220;Object&#8221; gives interesting information:</p>
<ul>
<li>ASH Dimension &#8220;Object&#8221;: SYS.SYS_LOB0000009134C00039$$ and SYS.SYS_LOB0000011038C00004$$ (LOB)</li>
</ul>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Objects.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42858" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Objects.jpg" alt="" width="1900" height="425" /></a></p>
<p>I don&#8217;t know an easy way to copy/paste from the Performance Hub so I have generated an AWR report and found them in the Top DB Objects section:</p>
<table class="tdiff" border="0" summary="This table shows the Top DB Objects">
<tbody>
<tr>
<th class="awrbg" scope="col">Object ID</th>
<th class="awrbg" scope="col">% Activity</th>
<th class="awrbg" scope="col">Event</th>
<th class="awrbg" scope="col">% Event</th>
<th class="awrbg" scope="col">Object Name (Type)</th>
<th class="awrbg" scope="col">Tablespace</th>
<th class="awrbg" scope="col">Container Name</th>
</tr>
<tr>
<td class="awrc" scope="row" align="right">9135</td>
<td class="awrc" align="right">24.11</td>
<td class="awrc">direct path read</td>
<td class="awrc" align="right">24.11</td>
<td class="awrc">SYS.SYS_LOB0000009134C00039$$ (LOB)</td>
<td class="awrc">SYSAUX</td>
<td class="awrc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
<tr>
<td class="awrnc" scope="row" align="right">11039</td>
<td class="awrnc" align="right">10.64</td>
<td class="awrnc">direct path read</td>
<td class="awrnc" align="right">10.64</td>
<td class="awrnc">SYS.SYS_LOB0000011038C00004$$ (LOB)</td>
<td class="awrnc">SYSAUX</td>
<td class="awrnc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>That&#8217;s the beauty of ASH. In addition, to show you the load per multiple dimensions, it links all dimensions. Here, without guessing, I know that those objects are responsible for the &#8220;direct path read temp&#8221; I have seen above.</p>
<p>Let me insist on the numbers. I mentioned that I selected, in the upper chart, a homogeneous activity time window in order to compare the activity number with and without the time axis. My total activity during this time window is a little bit over 1 session active (on average, AAS &#8211; Average Active Session). I can see this on the time chart y-axis. And I confirm it if I sum-up the aggregations on other dimensions. Like above CPU + USER I/O was 0.86 + 0.37 =1.23 when the selected part was around 1.25 active sessions. Here when looking at &#8220;Object&#8221; dimension, I see around 0.5 sessions on SYS_LOB0000011038C00004$$ (green) during one minute, then around 0.3 sessions on SYS_LOB0000009134C00039$$ (blue) for 5 minutes and no activity on objects during 1 minute. That matches approximately the 0.37 AAS on User I/O. From the AWR report this is displayed as &#8220;% Event&#8221; and 24.11 + 10.64 = 34.75% which is roughly the ratio of those 0.37 to 1.25 we had with Average Active Sessions. When looking at sampling activity details, it is important to keep in mind the weight of each component we look at.</p>
<p>Let&#8217;s get more detail about those objects, from SQL Developer Web, or any connection:</p>
<pre><code>
DEMO@atp1_tp&gt; select owner,object_name,object_type,oracle_maintained from dba_objects 
where owner='SYS' and object_name in ('SYS_LOB0000009134C00039$$','SYS_LOB0000011038C00004$$');

   OWNER                  OBJECT_NAME    OBJECT_TYPE    ORACLE_MAINTAINED
________ ____________________________ ______________ ____________________
SYS      SYS_LOB0000009134C00039$$    LOB            Y
SYS      SYS_LOB0000011038C00004$$    LOB            Y

DEMO@atp1_tp&gt; select owner,table_name,column_name,segment_name,tablespace_name from dba_lobs 
where owner='SYS' and segment_name in ('SYS_LOB0000009134C00039$$','SYS_LOB0000011038C00004$$');

   OWNER                TABLE_NAME    COLUMN_NAME                 SEGMENT_NAME    TABLESPACE_NAME
________ _________________________ ______________ ____________________________ __________________
SYS      WRI$_SQLSET_PLAN_LINES    OTHER_XML      SYS_LOB0000009134C00039$$    SYSAUX
SYS      WRH$_SQLTEXT              SQL_TEXT       SYS_LOB0000011038C00004$$    SYSAUX
</code></pre>
<p>Ok, that&#8217;s interesting information. It confirms why I see &#8216;internal&#8217; everywhere: those are dictionary tables.</p>
<p>WRI$_SQLSET_PLAN_LINES is about SQL Tuning Sets and in 19c, especially with the Auto Index feature, the SQL statements are captured every 15 minutes and analyzed to find index candidates. A look at SQL Tuning Sets confirms this:</p>
<pre><code>
DEMO@atp1_tp&gt; select sqlset_name,parsing_schema_name,count(*),dbms_xplan.format_number(sum(length(sql_text))),min(plan_timestamp)
from dba_sqlset_statements group by parsing_schema_name,sqlset_name order by count(*);


    SQLSET_NAME    PARSING_SCHEMA_NAME    COUNT(*)    DBMS_XPLAN.FORMAT_NUMBER(SUM(LENGTH(SQL_TEXT)))    MIN(PLAN_TIMESTAMP)
_______________ ______________________ ___________ __________________________________________________ ______________________
SYS_AUTO_STS    C##OMLIDM                        1 53                                                 30-APR-20
SYS_AUTO_STS    FLOWS_FILES                      1 103                                                18-JUL-20
SYS_AUTO_STS    DBSNMP                           6 646                                                26-MAY-20
SYS_AUTO_STS    XDB                              7 560                                                20-MAY-20
SYS_AUTO_STS    ORDS_PUBLIC_USER                 9 1989                                               30-APR-20
SYS_AUTO_STS    GUEST0001                       10 3656                                               20-MAY-20
SYS_AUTO_STS    CTXSYS                          12 1193                                               20-MAY-20
SYS_AUTO_STS    LBACSYS                         28 3273                                               30-APR-20
SYS_AUTO_STS    AUDSYS                          29 3146                                               26-MAY-20
SYS_AUTO_STS    ORDS_METADATA                   29 4204                                               20-MAY-20
SYS_AUTO_STS    C##ADP$SERVICE                  33 8886                                               11-AUG-20
SYS_AUTO_STS    MDSYS                           39 4964                                               20-MAY-20
SYS_AUTO_STS    DVSYS                           65 8935                                               30-APR-20
SYS_AUTO_STS    APEX_190200                    130 55465                                              30-APR-20
SYS_AUTO_STS    C##CLOUD$SERVICE               217 507K                                               30-APR-20
SYS_AUTO_STS    ADMIN                          245 205K                                               30-APR-20
SYS_AUTO_STS    DEMO                           628 320K                                               30-APR-20
SYS_AUTO_STS    APEX_200100                  2,218 590K                                               18-JUL-20
SYS_AUTO_STS    SYS                        106,690 338M                                               30-APR-20
</code></pre>
<p>All gathered by this SYS_AUTO_STS job. And the statements captured were parsed by SYS &#8211; a system job has hard work because of system statements, as I mentioned when seeing this for the first time:</p>
<blockquote class="twitter-tweet" data-width="500" data-dnt="true">
<p lang="en" dir="ltr">Auto Index having hard work on ATP. </p>
<p>select count(*) from dba_sqlset_statements;</p>
<p>   COUNT(*)<br />___________<br />    109,770 <a href="https://t.co/TFHTbVhSvd">pic.twitter.com/TFHTbVhSvd</a></p>
<p>&mdash; Franck Pachot (@FranckPachot) <a href="https://twitter.com/FranckPachot/status/1299096985656532994?ref_src=twsrc%5Etfw">August 27, 2020</a></p></blockquote>
<p><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>With this drill-down from the &#8220;Object&#8221; dimension, I&#8217;ve already gone far enough to get an idea about the problem: an internal job is reading the huge SQL Tuning Sets that have been collected by the Auto STS job introduced in 19c (and used by Auto Index). But I&#8217;ll continue to look at all other ASH Dimensions. They can give me more detail or at least confirm my guesses. That&#8217;s the idea: you look at all the dimensions and once one gives you interesting information, you dig down to more details.</p>
<p>I look at &#8220;PL/SQL&#8221; ASH dimension first because an application should call SQL from procedural code and not the opposite. And, as all this is internal, developed by Oracle, I expect they do it this way.</p>
<ul>
<li>ASH Dimension &#8220;PL/SQL&#8221;: I see &#8216;7322,38&#8217;</li>
<li>ASH Dimension &#8220;Top PL/SQL&#8221;: I see &#8216;19038,5&#8217;</li>
</ul>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/plsql.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42859" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/plsql.jpg" alt="" width="1883" height="268" /></a></p>
<p>Again, I copy/paste to avoid typos and got them from the AWR report &#8220;Top PL/SQL Procedures&#8221; section:</p>
<table class="tdiff" border="0" summary="This table displays the Top PL/SQL procedures">
<tbody>
<tr>
<th class="awrbg" scope="col">PL/SQL Entry Subprogram</th>
<th class="awrbg" scope="col">% Activity</th>
<th class="awrbg" scope="col">PL/SQL Current Subprogram</th>
<th class="awrbg" scope="col">% Current</th>
<th class="awrbg" scope="col">Container Name</th>
</tr>
<tr>
<td class="awrc" scope="row">UNKNOWN_PLSQL_ID &lt;19038, 5&gt;</td>
<td class="awrc" align="right">78.72</td>
<td class="awrc">SQL</td>
<td class="awrc" align="right">46.81</td>
<td class="awrc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
<tr>
<td class="awrnc" scope="row">
<div class="hidden">UNKNOWN_PLSQL_ID &lt;19038,5&gt;</div>
</td>
<td class="awrnc" align="right">
<div class="hidden">78.72</div>
</td>
<td class="awrnc">UNKNOWN_PLSQL_ID &lt;7322, 38&gt;</td>
<td class="awrnc" align="right">31.21</td>
<td class="awrnc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
<tr>
<td class="awrc" scope="row">UNKNOWN_PLSQL_ID &lt;13644, 332&gt;</td>
<td class="awrc" align="right">2.13</td>
<td class="awrc">SQL</td>
<td class="awrc" align="right">2.13</td>
<td class="awrc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
<tr>
<td class="awrnc" scope="row">UNKNOWN_PLSQL_ID &lt;30582, 1&gt;</td>
<td class="awrnc" align="right">1.42</td>
<td class="awrnc">SQL</td>
<td class="awrnc" align="right">1.42</td>
<td class="awrnc" align="right">SUULFLFCSYX91Z0_ATP1</td>
</tr>
</tbody>
</table>
<p>Side note on the number: activity was 0.35 AAS on top-level PL/SQL, 0.33 on current PL/SQL. 0.33 is included within 0.35 as a session active on a PL/SQL call. In AWR (where &#8220;Entry&#8221; means &#8220;top-level&#8221;) you see them nested and including the SQL activity. This is why you see 78.72% here, it is SQL + PL/SQL executed under the top-level call. But actually, the procedure (7322,38) is 31.21% if the total AAS, which matches the 0.33 AAS.</p>
<p>By the way, I didn&#8217;t mention it before but this in AWR report is actually an ASH report that is included in the AWR html report.</p>
<p>Now trying to know which are those procedures. I think the &#8220;UNKNOWN&#8221; comes from not finding it in the packages procedures:</p>
<pre><code>
DEMO@atp1_tp&gt; select * from dba_procedures where (object_id,subprogram_id) in ( (7322,38) , (19038,5) );

no rows selected
</code></pre>
<p>but I find them from DBA_OBJECTS:</p>
<pre><code>
DEMO@atp1_tp&gt; select owner,object_name,object_id,object_type,oracle_maintained,last_ddl_time from dba_objects where object_id in (7322,19038);

   OWNER           OBJECT_NAME    OBJECT_ID    OBJECT_TYPE    ORACLE_MAINTAINED    LAST_DDL_TIME
________ _____________________ ____________ ______________ ____________________ ________________
SYS      XMLTYPE                      7,322 TYPE           Y                    18-JUL-20
SYS      DBMS_AUTOTASK_PRVT          19,038 PACKAGE        Y                    22-MAY-20
</code></pre>
<p>and DBA_PROCEDURES:</p>
<pre><code>
DEMO@atp1_tp&gt; select owner,object_name,procedure_name,object_id,subprogram_id from dba_procedures where object_id in(7322,19038);


   OWNER                   OBJECT_NAME    PROCEDURE_NAME    OBJECT_ID    SUBPROGRAM_ID
________ _____________________________ _________________ ____________ ________________
SYS      DBMS_RESULT_CACHE_INTERNAL    RELIES_ON               19,038                1
SYS      DBMS_RESULT_CACHE_INTERNAL                            19,038                0
</code></pre>
<p>All this doesn&#8217;t match <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>My guess is that the top level PL/SQL object is DBMS_AUTOTASK_PRVT as I can see in the container it is running on, which is the one I&#8217;m connected to (an autonomous database is a pluggable database in the Oracle Cloud container database). It has the OBJECT_ID=19038 in my PDB. But the DBA_PROCEDURES is an extended data link and the OBJECT_ID of common objects are different in CDB$ROOT and PDBs. And OBJECT_ID=7322 is probably an identifier in CDB$ROOT, where active session monitoring runs. I cannot verify as I have only a local user. Because of this inconsistency, my drill-down on the PL/SQL dimension stops there.</p>
<p>The package calls some SQL and from browsing the AWR report I&#8217;ve seen in the time model that &#8220;sql execute elapsed time&#8221; is the major component:</p>
<table class="tdiff" border="0" summary="This table displays different time model statistics. For each statistic, time and % of DB time are displayed">
<tbody>
<tr>
<th class="awrbg" scope="col">Statistic Name</th>
<th class="awrbg" scope="col">Time (s)</th>
<th class="awrbg" scope="col">% of DB Time</th>
<th class="awrbg" scope="col">% of Total CPU Time</th>
</tr>
<tr>
<td class="awrc" scope="row">sql execute elapsed time</td>
<td class="awrc" align="right">1,756.19</td>
<td class="awrc" align="right">99.97</td>
<td class="awrc" align="right"></td>
</tr>
<tr>
<td class="awrnc" scope="row">DB CPU</td>
<td class="awrnc" align="right">1,213.59</td>
<td class="awrnc" align="right">69.08</td>
<td class="awrnc" align="right">94.77</td>
</tr>
<tr>
<td class="awrc" scope="row">PL/SQL execution elapsed time</td>
<td class="awrc" align="right">498.62</td>
<td class="awrc" align="right">28.38</td>
<td class="awrc" align="right"></td>
</tr>
</tbody>
</table>
<p>I&#8217;ll follow the hierarchy of this dimension &#8211; the most detailed will be the SQL Plan operation. But let&#8217;s start with &#8220;SQL Opcode&#8221;</p>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/topsql.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42860" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/topsql.jpg" alt="" width="1968" height="439" /></a></p>
<ul>
<li>ASH Dimension &#8220;Top Level Opcode&#8221;: mostly &#8220;PL/SQL EXECUTE&#8221; which confirms that the SQL I&#8217;ll see is called by the PL/SQL.</li>
<li>ASH Dimension &#8220;top level SQL ID&#8221;: mostly dkb7ts34ajsjy here. I&#8217;ll look at its details further.</li>
</ul>
<p>From the AWR report, I see all statements with no distinction about the top level one, and there&#8217;s no <a href="https://twitter.com/FranckPachot/status/1299096985656532994?s=20" target="_blank" rel="noopener noreferrer">spinning top</a> to help you find what is running as a recursive call or the top-level one. It can be often guessed from the time and other statistics &#8211; here I have 3 queries taking almost the same database time:</p>
<table class="tdiff" border="0" summary="This table displays top SQL by elapsed time">
<tbody>
<tr>
<th class="awrbg" scope="col">Elapsed Time (s)</th>
<th class="awrbg" scope="col">Executions</th>
<th class="awrbg" scope="col">Elapsed Time per Exec (s)</th>
<th class="awrbg" scope="col">%Total</th>
<th class="awrbg" scope="col">%CPU</th>
<th class="awrbg" scope="col">%IO</th>
<th class="awrbg" scope="col">SQL Id</th>
<th class="awrbg" scope="col">SQL Module</th>
<th class="awrbg" scope="col">SQL Text</th>
</tr>
<tr>
<td class="awrc" align="right">1,110.86</td>
<td class="awrc" align="right">3</td>
<td class="awrc" align="right">370.29</td>
<td class="awrc" align="right">63.24</td>
<td class="awrc" align="right">61.36</td>
<td class="awrc" align="right">50.16</td>
<td class="awrc" scope="row">dkb7ts34ajsjy</td>
<td class="awrc">DBMS_SCHEDULER</td>
<td class="awrc">DECLARE job BINARY_INTEGER := &#8230;</td>
</tr>
<tr>
<td class="awrnc" align="right">1,110.85</td>
<td class="awrnc" align="right">3</td>
<td class="awrnc" align="right">370.28</td>
<td class="awrnc" align="right">63.24</td>
<td class="awrnc" align="right">61.36</td>
<td class="awrnc" align="right">50.16</td>
<td class="awrnc" scope="row">f6j6vuum91fw8</td>
<td class="awrnc">DBMS_SCHEDULER</td>
<td class="awrnc">begin /*KAPI:task_proc*/ dbms_&#8230;</td>
</tr>
<tr>
<td class="awrc" align="right">1,087.12</td>
<td class="awrc" align="right">3</td>
<td class="awrc" align="right">362.37</td>
<td class="awrc" align="right">61.88</td>
<td class="awrc" align="right">61.65</td>
<td class="awrc" align="right">49.93</td>
<td class="awrc" scope="row">0y288pk81u609</td>
<td class="awrc">SYS_AI_MODULE</td>
<td class="awrc">SELECT /*+dynamic_sampling(11)&#8230;</td>
</tr>
</tbody>
</table>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/opcode.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42862" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/opcode.jpg" alt="" width="1875" height="296" /></a></p>
<p>SYS_AI_MODULE is the Auto Indexing feature</p>
<pre><code>
DEMO@atp1_tp&gt; select distinct sql_id,sql_text from v$sql where sql_id in ('dkb7ts34ajsjy','f6j6vuum91fw8','0y288pk81u609');
dkb7ts34ajsjy    DECLARE job BINARY_INTEGER := :job;  next_date TIMESTAMP WITH TIME ZONE := :mydate;  broken BOOLEAN := FALSE;  job_name VARCHAR2(128) := :job_name;  job_subname VARCHAR2(128) := :job_subname;  job_owner VARCHAR2(128) := :job_owner;  job_start TIMESTAMP WITH TIME ZONE := :job_start;  job_scheduled_start TIMESTAMP WITH TIME ZONE := :job_scheduled_start;  window_start TIMESTAMP WITH TIME ZONE := :window_start;  window_end TIMESTAMP WITH TIME ZONE := :window_end;  chain_id VARCHAR2(14) :=  :chainid;  credential_owner VARCHAR2(128) := :credown;  credential_name  VARCHAR2(128) := :crednam;  destination_owner VARCHAR2(128) := :destown;  destination_name VARCHAR2(128) := :destnam;  job_dest_id varchar2(14) := :jdestid;  log_id number := :log_id;  BEGIN  begin dbms_autotask_prvt.run_autotask(3, 0);  end;  :mydate := next_date; IF broken THEN :b := 1; ELSE :b := 0; END IF; END;
f6j6vuum91fw8    begin /*KAPI:task_proc*/ dbms_auto_index_internal.task_proc(FALSE); end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
0y288pk81u609    SELECT /*+dynamic_sampling(11) NO_XML_QUERY_REWRITE */ SQL_ID, PLAN_HASH_VALUE, ELAPSED_TIME/EXECUTIONS ELAPSED_PER_EXEC, DBMS_AUTO_INDEX_INTERNAL.AUTO_INDEX_ALLOW(CE) SESSION_TYPE FROM (SELECT SQL_ID, PLAN_HASH_VALUE, MIN(ELAPSED_TIME) ELAPSED_TIME, MIN(EXECUTIONS) EXECUTIONS, MIN(OPTIMIZER_ENV) CE, MAX(EXISTSNODE(XMLTYPE(OTHER_XML), '/other_xml/info[@type = "has_user_tab"]')) USER_TAB FROM (SELECT F.NAME AS SQLSET_NAME, F.OWNER AS SQLSET_OWNER, SQLSET_ID, S.SQL_ID, T.SQL_TEXT, S.COMMAND_TYPE, P.PLAN_HASH_VALUE, SUBSTRB(S.MODULE, 1, (SELECT KSUMODLEN FROM X$MODACT_LENGTH)) MODULE, SUBSTRB(S.ACTION, 1, (SELECT KSUACTLEN FROM X$MODACT_LENGTH)) ACTION, C.ELAPSED_TIME, C.BUFFER_GETS, C.EXECUTIONS, C.END_OF_FETCH_COUNT, P.OPTIMIZER_ENV, L.OTHER_XML FROM WRI$_SQLSET_DEFINITIONS F, WRI$_SQLSET_STATEMENTS S, WRI$_SQLSET_PLANS P,WRI$_SQLSET_MASK M, WRH$_SQLTEXT T, WRI$_SQLSET_STATISTICS C, WRI$_SQLSET_PLAN_LINES L WHERE F.ID = S.SQLSET_ID AND S.ID = P.STMT_ID AND S.CON_DBID = P.CON_DBID AND P.
</code></pre>
<p>It looks like dbms_autotask_prvt.run_autotask calls dbms_auto_index_internal.task_proc that queries WRI$_SQLSET tables and this is where all the database time goes.</p>
<ul>
<li>ASH Dimension &#8220;SQL Opcode&#8221;: most of SELECT statements here</li>
<li>ASH Dimension &#8220;SQL Force Matching Signature&#8221; is interesting to group all statements that differ only by literals.</li>
<li>ASH Dimension &#8220;SQL Plan Hash Value&#8221;, and the more detailed &#8220;SQL Full Plan Hash Value&#8221;, are interesting to group all statements having the same execution plan shape, or exactly the same execution plan</li>
</ul>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/sqlplan.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-42863" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/sqlplan.jpg" alt="" width="1889" height="669" /></a></p>
<ul>
<li>ASH Dimension &#8220;SQL ID&#8221; is the most interesting here to see which of this SELECT query is seen most of the time below this Top Level call, but unfortunately, I see &#8220;internal here&#8221;. Fortunately, the AWR report above did not hide this.</li>
<li>ASH Dimension &#8220;SQL Plan Operation&#8221; shows me that within this query I&#8217;m spending time on HASH GROUP BY operation (which, is the workarea is large, does some &#8220;direct path read temp&#8221; as we encountered on the &#8220;wait event&#8221; dimension)</li>
<li>ASH Dimension &#8220;SQL Plan Operation Line&#8221; helps me to find this operation in the plan as in addition to the SQL_ID (the one that was hidden in the &#8220;SQL_ID&#8221; dimension) I have the plan identification (plan hash value) and plan line number.</li>
</ul>
<p>Again, I use the graphical Performance Hub to find where I need to drill down and find all details in the AWR report &#8220;Top SQL with Top Events&#8221; section:</p>
<table class="tdiff" border="0" summary="This table displays the Top SQL by Top Wait Events">
<tbody>
<tr>
<th class="awrbg" scope="col">SQL ID</th>
<th class="awrbg" scope="col">Plan Hash</th>
<th class="awrbg" scope="col">Executions</th>
<th class="awrbg" scope="col">% Activity</th>
<th class="awrbg" scope="col">Event</th>
<th class="awrbg" scope="col">% Event</th>
<th class="awrbg" scope="col">Top Row Source</th>
<th class="awrbg" scope="col">% Row Source</th>
<th class="awrbg" scope="col">SQL Text</th>
</tr>
<tr>
<td class="awrc" align="right">0y288pk81u609</td>
<td class="awrc" align="right">2011736693</td>
<td class="awrc" align="right">3</td>
<td class="awrc" align="right">70.21</td>
<td class="awrc">CPU + Wait for CPU</td>
<td class="awrc" align="right">35.46</td>
<td class="awrc">HASH &#8211; GROUP BY</td>
<td class="awrc" align="right">28.37</td>
<td class="awrc">SELECT /*+dynamic_sampling(11)&#8230;</td>
</tr>
<tr>
<td class="awrnc" align="right">
<div class="hidden">0y288pk81u609</div>
</td>
<td class="awrnc" align="right">
<div class="hidden">2011736693</div>
</td>
<td class="awrnc" align="right">
<div class="hidden">3</div>
</td>
<td class="awrnc" align="right">
<div class="hidden">70.21</div>
</td>
<td class="awrnc">direct path read</td>
<td class="awrnc" align="right">34.75</td>
<td class="awrnc">HASH &#8211; GROUP BY</td>
<td class="awrnc" align="right">24.11</td>
<td class="awrnc"></td>
</tr>
<tr>
<td class="awrc" align="right">444n6jjym97zv</td>
<td class="awrc" align="right">1982042220</td>
<td class="awrc" align="right">18</td>
<td class="awrc" align="right">12.77</td>
<td class="awrc">CPU + Wait for CPU</td>
<td class="awrc" align="right">12.77</td>
<td class="awrc">FIXED TABLE &#8211; FULL</td>
<td class="awrc" align="right">12.77</td>
<td class="awrc">SELECT /*+ unnest */ * FROM GV&#8230;</td>
</tr>
<tr>
<td class="awrnc" align="right">1xx2k8pu4g5yf</td>
<td class="awrnc" align="right">2224464885</td>
<td class="awrnc" align="right">2</td>
<td class="awrnc" align="right">5.67</td>
<td class="awrnc">CPU + Wait for CPU</td>
<td class="awrnc" align="right">5.67</td>
<td class="awrnc">FIXED TABLE &#8211; FIXED INDEX</td>
<td class="awrnc" align="right">2.84</td>
<td class="awrnc">SELECT /*+ first_rows(1) */ s&#8230;</td>
</tr>
<tr>
<td class="awrc" align="right">3kqrku32p6sfn</td>
<td class="awrc" align="right">3786872576</td>
<td class="awrc" align="right">3</td>
<td class="awrc" align="right">2.13</td>
<td class="awrc">CPU + Wait for CPU</td>
<td class="awrc" align="right">2.13</td>
<td class="awrc">FIXED TABLE &#8211; FULL</td>
<td class="awrc" align="right">2.13</td>
<td class="awrc">MERGE /*+ OPT_PARAM(&#8216;_parallel&#8230;</td>
</tr>
<tr>
<td class="awrnc" align="right">64z4t33vsvfua</td>
<td class="awrnc" align="right">3336915854</td>
<td class="awrnc" align="right">2</td>
<td class="awrnc" align="right">1.42</td>
<td class="awrnc">CPU + Wait for CPU</td>
<td class="awrnc" align="right">1.42</td>
<td class="awrnc">FIXED TABLE &#8211; FIXED INDEX</td>
<td class="awrnc" align="right">0.71</td>
<td class="awrnc">WITH LAST_HOUR AS ( SELECT ROU&#8230;</td>
</tr>
</tbody>
</table>
<p>I can see the full SQL Text in the AWR report and get the AWR statement report with dbms_workload_repository. I can also fetch the plan with DBMS_XPLAN.DISPLAY_AWR:</p>
<pre><code>
DEMO@atp1_tp&gt; select * from dbms_xplan.display_awr('0y288pk81u609',2011736693,null,'+peeked_binds');


                                                                                                              PLAN_TABLE_OUTPUT
_______________________________________________________________________________________________________________________________
SQL_ID 0y288pk81u609
--------------------
SELECT /*+dynamic_sampling(11) NO_XML_QUERY_REWRITE */ SQL_ID,
PLAN_HASH_VALUE, ELAPSED_TIME/EXECUTIONS ELAPSED_PER_EXEC,
DBMS_AUTO_INDEX_INTERNAL.AUTO_INDEX_ALLOW(CE) SESSION_TYPE FROM (SELECT
SQL_ID, PLAN_HASH_VALUE, MIN(ELAPSED_TIME) ELAPSED_TIME,
MIN(EXECUTIONS) EXECUTIONS, MIN(OPTIMIZER_ENV) CE,
MAX(EXISTSNODE(XMLTYPE(OTHER_XML), '/other_xml/info[@type =
"has_user_tab"]')) USER_TAB FROM (SELECT F.NAME AS SQLSET_NAME, F.OWNER
AS SQLSET_OWNER, SQLSET_ID, S.SQL_ID, T.SQL_TEXT, S.COMMAND_TYPE,
P.PLAN_HASH_VALUE, SUBSTRB(S.MODULE, 1, (SELECT KSUMODLEN FROM
X$MODACT_LENGTH)) MODULE, SUBSTRB(S.ACTION, 1, (SELECT KSUACTLEN FROM
X$MODACT_LENGTH)) ACTION, C.ELAPSED_TIME, C.BUFFER_GETS, C.EXECUTIONS,
C.END_OF_FETCH_COUNT, P.OPTIMIZER_ENV, L.OTHER_XML FROM
WRI$_SQLSET_DEFINITIONS F, WRI$_SQLSET_STATEMENTS S, WRI$_SQLSET_PLANS
P,WRI$_SQLSET_MASK M, WRH$_SQLTEXT T, WRI$_SQLSET_STATISTICS C,
WRI$_SQLSET_PLAN_LINES L WHERE F.ID = S.SQLSET_ID AND S.ID = P.STMT_ID
AND S.CON_DBID = P.CON_DBID AND P.STMT_ID = C.STMT_ID AND
P.PLAN_HASH_VALUE = C.PLAN_HASH_VALUE AND P.CON_DBID = C.CON_DBID AND
P.STMT_ID = M.STMT_ID AND P.PLAN_HASH_VALUE = M.PLAN_HASH_VALUE AND
P.CON_DBID = M.CON_DBID AND S.SQL_ID = T.SQL_ID AND S.CON_DBID =
T.CON_DBID AND T.DBID = F.CON_DBID AND P.STMT_ID=L.STMT_ID AND
P.PLAN_HASH_VALUE = L.PLAN_HASH_VALUE AND P.CON_DBID = L.CON_DBID) S,
WRI$_ADV_OBJECTS OS WHERE SQLSET_OWNER = :B8 AND SQLSET_NAME = :B7 AND
(MODULE IS NULL OR (MODULE != :B6 AND MODULE != :B5 )) AND SQL_TEXT NOT
LIKE 'SELECT /* DS_SVC */%' AND SQL_TEXT NOT LIKE 'SELECT /*
OPT_DYN_SAMP */%' AND SQL_TEXT NOT LIKE '/*AUTO_INDEX:ddl*/%' AND
SQL_TEXT NOT LIKE '%/*+%dbms_stats%' AND COMMAND_TYPE NOT IN (9, 10,
11) AND PLAN_HASH_VALUE &gt; 0 AND BUFFER_GETS &gt; 0 AND EXECUTIONS &gt; 0 AND
OTHER_XML IS NOT NULL AND OS.SQL_ID_VC (+)= S.SQL_ID AND OS.TYPE (+)=
:B4 AND DECODE(OS.TYPE(+), :B4 , TO_NUMBER(OS.ATTR2(+)), -1) =
S.PLAN_HASH_VALUE AND OS.TASK_ID (+)= :B3 AND OS.EXEC_NAME (+) IS NULL
AND (OS.SQL_ID_VC IS NULL OR TO_DATE(OS.ATTR18, :B2 )  0 ORDER BY
DBMS_AUTO_INDEX_INTERNAL.AUTO_INDEX_ALLOW(CE) DESC, ELAPSED_TIME DESC

Plan hash value: 2011736693

----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                 | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                          |                                |       |       |   957 (100)|          |
|   1 |  SORT ORDER BY                            |                                |   180 |   152K|   957  (18)| 00:00:01 |
|   2 |   FILTER                                  |                                |       |       |            |          |
|   3 |    HASH GROUP BY                          |                                |   180 |   152K|   957  (18)| 00:00:01 |
|   4 |     NESTED LOOPS                          |                                |  3588 |  3030K|   955  (18)| 00:00:01 |
|   5 |      FILTER                               |                                |       |       |            |          |
|   6 |       HASH JOIN RIGHT OUTER               |                                |  3588 |  2964K|   955  (18)| 00:00:01 |
|   7 |        TABLE ACCESS BY INDEX ROWID BATCHED| WRI$_ADV_OBJECTS               |     1 |    61 |     4   (0)| 00:00:01 |
|   8 |         INDEX RANGE SCAN                  | WRI$_ADV_OBJECTS_IDX_02        |     1 |       |     3   (0)| 00:00:01 |
|   9 |        HASH JOIN                          |                                |  3588 |  2750K|   951  (18)| 00:00:01 |
|  10 |         TABLE ACCESS STORAGE FULL         | WRI$_SQLSET_PLAN_LINES         | 86623 |  2706K|   816  (19)| 00:00:01 |
|  11 |         HASH JOIN                         |                                |  3723 |  2737K|   134   (8)| 00:00:01 |
|  12 |          TABLE ACCESS STORAGE FULL        | WRI$_SQLSET_STATISTICS         | 89272 |  2789K|    21  (10)| 00:00:01 |
|  13 |          HASH JOIN                        |                                |  3744 |  2636K|   112   (7)| 00:00:01 |
|  14 |           JOIN FILTER CREATE              | :BF0000                        |  2395 |   736K|    39  (13)| 00:00:01 |
|  15 |            HASH JOIN                      |                                |  2395 |   736K|    39  (13)| 00:00:01 |
|  16 |             TABLE ACCESS STORAGE FULL     | WRI$_SQLSET_STATEMENTS         |  3002 |   137K|    13  (24)| 00:00:01 |
|  17 |              FIXED TABLE FULL             | X$MODACT_LENGTH                |     1 |     5 |     0   (0)|          |
|  18 |              FIXED TABLE FULL             | X$MODACT_LENGTH                |     1 |     5 |     0   (0)|          |
|  19 |              FIXED TABLE FULL             | X$MODACT_LENGTH                |     1 |     5 |     0   (0)|          |
|  20 |             NESTED LOOPS                  |                                |  1539 |   402K|    25   (4)| 00:00:01 |
|  21 |              TABLE ACCESS BY INDEX ROWID  | WRI$_SQLSET_DEFINITIONS        |     1 |    27 |     1   (0)| 00:00:01 |
|  22 |               INDEX UNIQUE SCAN           | WRI$_SQLSET_DEFINITIONS_IDX_01 |     1 |       |     0   (0)|          |
|  23 |              TABLE ACCESS STORAGE FULL    | WRH$_SQLTEXT                   |  1539 |   362K|    24   (5)| 00:00:01 |
|  24 |           JOIN FILTER USE                 | :BF0000                        | 89772 |    34M|    73   (3)| 00:00:01 |
|  25 |            TABLE ACCESS STORAGE FULL      | WRI$_SQLSET_PLANS              | 89772 |    34M|    73   (3)| 00:00:01 |
|  26 |      INDEX UNIQUE SCAN                    | WRI$_SQLSET_MASK_PK            |     1 |    19 |     0   (0)|          |
----------------------------------------------------------------------------------------------------------------------------

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 7 (U - Unused (7))
---------------------------------------------------------------------------

   0 -  SEL$5
         U -  MERGE(@"SEL$5" &gt;"SEL$4") / duplicate hint
         U -  MERGE(@"SEL$5" &gt;"SEL$4") / duplicate hint

   1 -  SEL$5C160134
         U -  dynamic_sampling(11) / rejected by IGNORE_OPTIM_EMBEDDED_HINTS

  17 -  SEL$7286615E
         U -  PUSH_SUBQ(@"SEL$7286615E") / duplicate hint
         U -  PUSH_SUBQ(@"SEL$7286615E") / duplicate hint

  17 -  SEL$7286615E / X$MODACT_LENGTH@SEL$5
         U -  FULL(@"SEL$7286615E" "X$MODACT_LENGTH"@"SEL$5") / duplicate hint
         U -  FULL(@"SEL$7286615E" "X$MODACT_LENGTH"@"SEL$5") / duplicate hint

Peeked Binds (identified by position):
--------------------------------------

   1 - :B8 (VARCHAR2(30), CSID=873): 'SYS'
   2 - :B7 (VARCHAR2(30), CSID=873): 'SYS_AUTO_STS'
   5 - :B4 (NUMBER): 7
   7 - :B3 (NUMBER): 15

Note
-----
   - SQL plan baseline SQL_PLAN_gf2c99a3zrzsge1b441a5 used for this statement
</code></pre>
<p>I can confirm what I&#8217;ve seen about HASH GROUP BY on line ID=3<br />
I forgot to mention that SQL Monitor is not available for this query probably because it is disabled for internal queries. Anyway, the most interesting here is that the plan comes from SQL Plan Management</p>
<p>Here is more information about this SQL Plan Baseline:</p>
<pre><code>
DEMO@atp1_tp&gt; select * from dbms_xplan.display_sql_plan_baseline('','SQL_PLAN_gf2c99a3zrzsge1b441a5');
                                                                                                                  ...
--------------------------------------------------------------------------------
SQL handle: SQL_f709894a87fbff0f
SQL text: SELECT /*+dynamic_sampling(11) NO_XML_QUERY_REWRITE */ SQL_ID,
          PLAN_HASH_VALUE, ELAPSED_TIME/EXECUTIONS ELAPSED_PER_EXEC,
...
--------------------------------------------------------------------------------
Plan name: SQL_PLAN_gf2c99a3zrzsge1b441a5         Plan id: 3786686885
Enabled: YES     Fixed: NO      Accepted: YES     Origin: AUTO-CAPTURE
Plan rows: From dictionary
--------------------------------------------------------------------------------
...
</code></pre>
<p>This shows only one plan, but I want to see all plans for this statement.</p>
<pre><code>
DEMO@atp1_tp&gt; select 
CREATOR,ORIGIN,CREATED,LAST_MODIFIED,LAST_EXECUTED,LAST_VERIFIED,ENABLED,ACCEPTED,FIXED,REPRODUCED
from dba_sql_plan_baselines where sql_handle='SQL_f709894a87fbff0f' order by created;


   CREATOR                           ORIGIN            CREATED      LAST_MODIFIED      LAST_EXECUTED      LAST_VERIFIED    ENABLED    ACCEPTED    FIXED    REPRODUCED
__________ ________________________________ __________________ __________________ __________________ __________________ __________ ___________ ________ _____________
SYS        EVOLVE-LOAD-FROM-AWR             30-MAY-20 11:50    30-JUL-20 23:34                       30-JUL-20 23:34    YES        NO          NO       YES
SYS        EVOLVE-LOAD-FROM-AWR             30-MAY-20 11:50    31-JUL-20 05:03                       31-JUL-20 05:03    YES        NO          NO       YES
SYS        EVOLVE-LOAD-FROM-CURSOR-CACHE    30-MAY-20 11:50    31-JUL-20 06:09                       31-JUL-20 06:09    YES        NO          NO       YES
SYS        EVOLVE-LOAD-FROM-AWR             30-MAY-20 11:50    31-JUL-20 06:09                       31-JUL-20 06:09    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     30-MAY-20 16:08    31-JUL-20 07:15                       31-JUL-20 07:15    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     30-MAY-20 19:10    30-MAY-20 19:30    30-MAY-20 19:30    30-MAY-20 19:29    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     30-MAY-20 19:30    31-JUL-20 08:21                       31-JUL-20 08:21    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     30-MAY-20 23:32    31-JUL-20 08:21                       31-JUL-20 08:21    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 03:14    31-JUL-20 08:21                       31-JUL-20 08:21    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 04:14    31-JUL-20 08:21                       31-JUL-20 08:21    YES        NO          NO       YES
SYS        EVOLVE-LOAD-FROM-AWR             31-MAY-20 13:04    31-JUL-20 23:43                       31-JUL-20 23:43    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 13:19    31-JUL-20 23:43                       31-JUL-20 23:43    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 13:39    11-JUL-20 04:35    11-JUL-20 04:35    31-MAY-20 14:09    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 18:01    10-AUG-20 22:05                       10-AUG-20 22:05    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     31-MAY-20 22:44    10-AUG-20 22:05                       10-AUG-20 22:05    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     01-JUN-20 06:48    10-AUG-20 22:05                       10-AUG-20 22:05    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     01-JUN-20 07:09    10-AUG-20 22:05                       10-AUG-20 22:05    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     02-JUN-20 05:22    02-JUN-20 05:49                       02-JUN-20 05:49    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     02-JUN-20 21:52    10-AUG-20 22:06                       10-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     03-JUN-20 08:20    23-AUG-20 20:45    23-AUG-20 20:45    03-JUN-20 08:49    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     04-JUN-20 01:34    10-AUG-20 22:06                       10-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     05-JUN-20 21:43    10-AUG-20 22:06                       10-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     14-JUN-20 06:01    18-AUG-20 23:22    18-AUG-20 23:22    14-JUN-20 10:52    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     14-JUN-20 06:21    13-AUG-20 22:35                       13-AUG-20 22:35    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     27-JUN-20 16:43    27-AUG-20 22:11                       27-AUG-20 22:11    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     28-JUN-20 02:09    28-JUN-20 06:52    28-JUN-20 06:52    28-JUN-20 06:41    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     28-JUN-20 08:13    29-JUL-20 23:24                       29-JUL-20 23:24    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     29-JUN-20 03:05    30-JUL-20 22:28                       30-JUL-20 22:28    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     29-JUN-20 10:50    30-JUL-20 23:33                       30-JUL-20 23:33    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     30-JUN-20 13:28    11-JUL-20 05:15    11-JUL-20 05:15    30-JUN-20 23:09    YES        YES         NO       YES
SYS        AUTO-CAPTURE                     01-JUL-20 14:04    31-JUL-20 22:37                       31-JUL-20 22:37    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     11-JUL-20 06:36    10-AUG-20 22:07                       10-AUG-20 22:07    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     11-JUL-20 14:00    11-AUG-20 22:06                       11-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     12-JUL-20 00:47    11-AUG-20 22:06                       11-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     12-JUL-20 01:47    11-AUG-20 22:06                       11-AUG-20 22:06    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     12-JUL-20 09:52    13-AUG-20 22:34                       13-AUG-20 22:34    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     13-JUL-20 04:03    13-AUG-20 22:34                       13-AUG-20 22:34    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     18-JUL-20 12:15    17-AUG-20 22:15                       17-AUG-20 22:15    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     18-JUL-20 23:43    18-AUG-20 22:44                       18-AUG-20 22:44    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     24-JUL-20 01:38    23-AUG-20 06:24                       23-AUG-20 06:24    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     24-JUL-20 06:42    24-AUG-20 22:09                       24-AUG-20 22:09    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     30-JUL-20 02:21    30-JUL-20 02:41                       30-JUL-20 02:41    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     07-AUG-20 18:33    07-AUG-20 19:16                       07-AUG-20 19:16    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     13-AUG-20 22:52    14-AUG-20 22:10                       14-AUG-20 22:10    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     14-AUG-20 05:16    14-AUG-20 22:10                       14-AUG-20 22:10    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     14-AUG-20 15:42    14-AUG-20 22:10                       14-AUG-20 22:10    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     18-AUG-20 23:22    19-AUG-20 22:11                       19-AUG-20 22:11    YES        NO          NO       YES
SYS        AUTO-CAPTURE                     27-AUG-20 00:07    27-AUG-20 22:11                       27-AUG-20 22:11    YES        NO          NO       YES
</code></pre>
<p>Ok, there was a huge SQL Plan Management activity here. All starts on 30-MAY-20 and this is when my ATP database has been upgraded to 19c. 19c comes with two new features. First new feature is &#8220;Automatic SQL tuning set&#8221; which gathers a lot of statements in SYS_AUTO_STS as we have seen above. The other feature, &#8220;Automatic SQL Plan Management&#8221;, or &#8220;Automatic Resolution of Plan Regressions&#8221; look into AWR for resource intensive statements with several execution plans. Then it create SQL Plan BAselines for them, loading all alternative plans that are found in AWR, SQL Tuning Sets, and Cursor Cache. And this is why I have EVOLVE-LOAD-FROM-AWR and EVOLVE-LOAD-FROM-CURSOR-CACHE loaded on 30-MAY-20 11:50<br />
This feature is explained by Nigel Bayliss <a href="https://blogs.oracle.com/optimizer/what-is-automatic-sql-plan-management-and-why-should-you-care" target="_blank" rel="noopener noreferrer">blog post</a>.</p>
<p>So, here are the settings in the Autonomous Database, ALTERNATE_PLAN_BASELINE=AUTO which enables the Auto SPM and ALTERNATE_PLAN_SOURCE=AUTO which means: AUTOMATIC_WORKLOAD_REPOSITORY+CURSOR_CACHE+SQL_TUNING_SET</p>
<pre><code>
DEMO@atp1_tp&gt; select parameter_name, parameter_value from   dba_advisor_parameters
              where  task_name = 'SYS_AUTO_SPM_EVOLVE_TASK' and parameter_value  'UNUSED' order by 1;

             PARAMETER_NAME    PARAMETER_VALUE
___________________________ __________________
ACCEPT_PLANS                TRUE
ALTERNATE_PLAN_BASELINE     AUTO
ALTERNATE_PLAN_LIMIT        UNLIMITED
ALTERNATE_PLAN_SOURCE       AUTO
DAYS_TO_EXPIRE              UNLIMITED
DEFAULT_EXECUTION_TYPE      SPM EVOLVE
EXECUTION_DAYS_TO_EXPIRE    30
JOURNALING                  INFORMATION
MODE                        COMPREHENSIVE
TARGET_OBJECTS              1
TIME_LIMIT                  3600
_SPM_VERIFY                 TRUE

</code></pre>
<p>This query (and explanations) are from Mike Dietrich <a href="https://mikedietrichde.com/2019/06/03/automatic-sql-plan-management-in-oracle-database-19c/" target="_blank" rel="noopener noreferrer">blog post</a> which you should read.</p>
<p>So, I can see many plans for this query, some accepted and some not. The Auto Evolve advisor task should help to see which plan is ok or not but it seems that it cannot for this statement:</p>
<pre><code>
SELECT DBMS_SPM.report_auto_evolve_task FROM   dual;
...

---------------------------------------------------------------------------------------------
 Object ID          : 848087
 Test Plan Name     : SQL_PLAN_gf2c99a3zrzsgd6c09b5e
 Base Plan Name     : Cost-based plan
 SQL Handle         : SQL_f709894a87fbff0f
 Parsing Schema     : SYS
 Test Plan Creator  : SYS
 SQL Text           : SELECT /*+dynamic_sampling(11) NO_XML_QUERY_REWRITE */
...

FINDINGS SECTION
---------------------------------------------------------------------------------------------

Findings (1):
-----------------------------
 1. This plan was skipped because either the database is not fully open or the
    SQL statement is ineligible for SQL Plan Management.

</code></pre>
<p>I dropped all those SQL Plan Baselines:</p>
<pre><code>
set serveroutput on
exec dbms_output.put_line ( DBMS_SPM.DROP_SQL_PLAN_BASELINE(sql_handle =&gt; 'SQL_f709894a87fbff0f') );
</code></pre>
<p>but the query is still long. The problem is not about the Auto SPM job which just tries to find a solution.</p>
<p>It seems that the Auto Index query spends time on this HASH GROUP BY because of the following:</p>
<pre><code>
     SELECT
...
     FROM
     (SELECT SQL_ID, PLAN_HASH_VALUE,MIN(ELAPSED_TIME) ELAPSED_TIME,MIN(EXECUTIONS) EXECUTIONS,MIN(OPTIMIZER_ENV) CE,
             MAX(EXISTSNODE(XMLTYPE(OTHER_XML),
                            '/other_xml/info[@type = "has_user_tab"]')) USER_TAB
       FROM
...       
     GROUP BY SQL_ID, PLAN_HASH_VALUE
     )
     WHERE USER_TAB &gt; 0
</code></pre>
<p>This is the AI job looking at many statements, with their OTHER_XML plan information and doing a group by on that. There are probably no optimal plans for this query.</p>
<p>Them why do I have so many statements in the auto-captured SQL Tuning Set? An application should have a limited set of statements. In OLTP, with many executions for different values, we should use bind variables to limit the set of statements. In DWH, ad-hoc queries should have so many executions.</p>
<p>When looking at the statements not using bind variables, the FORCE_MATCHING_SIGNATURE is the right dimension on which to aggregates them as there are too many SQL_ID:</p>
<pre><code>

DEMO@atp1_tp&gt; select force_matching_signature from dba_sqlset_statements group by force_matching_signature order by count(*) desc fetch first 2 rows only;

     FORCE_MATCHING_SIGNATURE
_____________________________
    7,756,258,419,218,828,704
   15,893,216,616,221,909,352

DEMO@atp1_tp&gt; select sql_text from dba_sqlset_statements where force_matching_signature=15893216616221909352 fetch first 3 rows only;
                                                     SQL_TEXT
_____________________________________________________________
select FLAGS from SYS_FBA_TRACKEDTABLES where OBJ# = 50867
select FLAGS from SYS_FBA_TRACKEDTABLES where OBJ# = 51039
select FLAGS from SYS_FBA_TRACKEDTABLES where OBJ# = 51048

DEMO@atp1_tp&gt; select sql_text from dba_sqlset_statements where force_matching_signature=7756258419218828704 fetch first 3 rows only;
                                                                                   SQL_TEXT
___________________________________________________________________________________________
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = 51039 and bitand(FLAGS, 128)=0
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = 51049 and bitand(FLAGS, 128)=0
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = 51047 and bitand(FLAGS, 128)=0

</code></pre>
<p>I have two FORCE_MATCHING_SIGNATURE that have the most rows in DBA_SQLSET_STATEMENTS and looking at a sample of them confirms that they don&#8217;t use bind variables. They are oracle internal queries and because I have the FORCE_MATCHING_SIGNATURE I put it in a google search in order to see if others already have seen the issue (Oracle Support notes are also indexed by Google).</p>
<p>First result is a Connor McDonald blog post from 2016, taking this example to show how to hunt for SQL which should use bind variables:<br />
<a href="https://connor-mcdonald.com/2016/05/30/sql-statements-using-literals/" target="_blank" rel="noopener noreferrer">https://connor-mcdonald.com/2016/05/30/sql-statements-using-literals/</a></p>
<p>There is also a hit on My Oracle Support for those queries:<br />
<a href="https://support.oracle.com/epmos/faces/DocContentDisplay?id=15931756.8" target="_blank" rel="noopener noreferrer">5931756 QUERIES AGAINST SYS_FBA_TRACKEDTABLES DON&#8217;T USE BIND VARIABLES</a> which is supposed to be fixed in 19c but obviously it is not. When I look at the patch I see &#8220;where OBJ# = :1&#8221; in ktfa.o</p>
<pre><code>
$ strings 15931756/files/lib/libserver18.a/ktfa.o | grep "SYS_FBA_TRACKEDTABLES where OBJ# = "
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = :1 and bitand(FLAGS, :2)=0
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = :1
select FLAGS from SYS_FBA_TRACKEDTABLES where OBJ# = :1
</code></pre>
<p>This uses bind variable.</p>
<p>But I checked in 19.6 and 20.3:</p>
<pre><code>
[oracle@cloud libserver]$ strings /u01/app/oracle/product/20.0.0/dbhome_1/bin/oracle | grep "SYS_FBA_TRACKEDTABLES where OBJ# = "
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = %d and bitand(FLAGS, %d)=0
select count(FA#) from SYS_FBA_TRACKEDTABLES where OBJ# = %d
select FLAGS from SYS_FBA_TRACKEDTABLES where OBJ# = %d
</code></pre>
<p>This is string substitution. Not bind variable.</p>
<p>Ok, as usual, I went too far from my initial goal which was just sharing some screenshots about looking at Performance Hub. With the autonomous database we don&#8217;t have all tools we are used to. On a self-managed database I would have tkprof&#8217;ed this job that runs every 15 minutes. Different tools but still possible. In this example I drilled down the problematic query execution plan, found that a system table was too large, got the bug number that should be fixed and verified that it wasn&#8217;t.</p>
<p>If you want to drill down by yourself, I&#8217;m sharing one AWR report easy to download from the Performance Hub:<br />
<a href="https://www.dropbox.com/s/vp8ndas3pcqjfuw/troubleshooting-autonomous-database-AWRReport.html?dl=0" target="_blank" rel="noopener noreferrer">https://www.dropbox.com/s/vp8ndas3pcqjfuw/troubleshooting-autonomous-database-AWRReport.html</a><br />
and PerfHub report gathered with dbms_perf.report_perfhub: <a href="https://www.dropbox.com/s/yup5m7ihlduqgbn/troubleshooting-autonomous-database-perfhub.html?dl=0" target="_blank" rel="noopener noreferrer">https://www.dropbox.com/s/yup5m7ihlduqgbn/troubleshooting-autonomous-database-perfhub.html</a></p>
<p>Comments and questions welcome. If you are interested in an Oracle Performance Workshop tuning, I can do it in our office, customer premises or remotely (Teams, Teamviewer, or any tool you want). Just request it on: <a href="https://www.dbi-services.com/trainings/oracle-performance-tuning-training/#onsite" target="_blank" rel="noopener noreferrer">https://www.dbi-services.com/trainings/oracle-performance-tuning-training/#onsite</a>. We can deliver a 3 days workshop on the optimizer concepts and hands-on lab to learn the troubleshooting method and tools. Or we can do some coaching looking at your environment on a shared screen: your database, your tools.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/troubleshooting-autonomous-database/">Troubleshooting performance on Autonomous Database</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/troubleshooting-autonomous-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Tips: Path of the default trace file is null</title>
		<link>https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/</link>
					<comments>https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/#respond</comments>
		
		<dc:creator><![CDATA[Stéphane Haby]]></dc:creator>
		<pubDate>Tue, 28 Jan 2020 08:01:57 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Database management]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SQL Server 2014]]></category>
		<category><![CDATA[SQL Server 2016]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/</guid>

					<description><![CDATA[<p>In addition of my precedent blog about this subject “SQL Server Tips: Default trace enabled but no file is active…”, I add a new case where the default path of the trace file was empty. The first step was to verify if the default trace is enabled with the command: SELECT * FROM sys.configurations WHERE [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/">SQL Server Tips: Path of the default trace file is null</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In addition of my precedent blog about this subject “<a href="https://www.dbi-services.com/blog/sql-server-tips-default-trace-enabled-but-no-file-is-active/" target="_blank" rel="noopener noreferrer">SQL Server Tips: Default trace enabled but no file is active…</a>”, I add a new case where the default path of the trace file was empty.</p>
<p>The first step was to verify if the default trace is enabled with the command:</p>
<pre class="brush: sql; gutter: true; first-line: 1">SELECT * FROM sys.configurations WHERE name=’default trace enable’</pre>
<p>It is enabled, then I check the current running trace with the view sys.traces</p>
<pre class="brush: sql; gutter: true; first-line: 1">SELECT * FROM sys.traces</pre>
<p><a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Trace01a-1.png"><img loading="lazy" decoding="async" class="size-medium wp-image-36740 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Trace01a-1.png" alt="" width="300" height="96" /></a><br />
As you can see, this time I have a trace but with a null in the Path for the trace file…</p>
<p>To correct this issue, the only way is to stop and reactive the trace in the configuration:</p>
<pre class="brush: sql; gutter: true; first-line: 1">EXEC sp_configure 'show advanced options',1;
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'default trace enabled',0;
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'default trace enabled',1;
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'show advanced options',0;
GO
RECONFIGURE WITH OVERRIDE;
GO</pre>
<p>Et voila, I have a trace file now…<br />
<a href="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Trace02.png"><img loading="lazy" decoding="async" class="size-medium wp-image-36741 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Trace02.png" alt="" width="300" height="117" /></a></p>
<p>L’article <a href="https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/">SQL Server Tips: Path of the default trace file is null</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/sql-server-tips-path-of-the-default-trace-file-is-null/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: www.dbi-services.com @ 2026-09-21 13:53:49 by W3 Total Cache
-->