<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sikkandar Badusha on Medium]]></title>
        <description><![CDATA[Stories by Sikkandar Badusha on Medium]]></description>
        <link>https://medium.com/@sikkius?source=rss-0dbe92148a89------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eH-fFhqLKBB_MnUKuhHlXA.jpeg</url>
            <title>Stories by Sikkandar Badusha on Medium</title>
            <link>https://medium.com/@sikkius?source=rss-0dbe92148a89------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:11:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sikkius/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Linux Best Practices for Boosting Database Performance]]></title>
            <link>https://medium.com/@sikkius/linux-best-practices-for-boosting-database-performance-9bb9aaec78bb?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb9aaec78bb</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 05:50:55 GMT</pubDate>
            <atom:updated>2025-11-12T05:50:55.773Z</atom:updated>
            <content:encoded><![CDATA[<p>🚀 <strong>Linux Best Practices for Boosting Database Performance</strong></p><p>As most tuning experts agree, performance optimization begins with the <strong>database layer</strong> itself.<br> If your <strong>SQL queries</strong>, <strong>data modeling</strong>, <strong>indexing</strong>, and <strong>fragmentation</strong> follow best practices, you’ll rarely run into performance bottlenecks.</p><p>That said, the <strong>operating system layer</strong> also offers significant opportunities for performance gains — especially on <strong>Linux</strong>.<br> After tuning countless database servers over the years, here are the Linux configurations I’ve found to make a measurable difference 👇</p><h3>1️⃣ HugePages Configuration</h3><p>If your Oracle <strong>SGA</strong> is above 5 GB, correctly configuring HugePages can make a big difference.<br> You can also enable HugePages for MySQL/MariaDB or PostgreSQL — though I haven’t observed major benefits there (happy to hear your experiences!).</p><p><strong>Quick check:</strong> After database startup, your alert log should <strong>not</strong> show “RECOMMENDATIONS”, and <strong>ALLOCATED pages</strong> should be <em>equal to or greater than</em> <strong>EXPECTED pages</strong>.<br> If not, HugePages may need reconfiguration.</p><h3>2️⃣ I/O Scheduler</h3><p>For <strong>write-heavy databases</strong> (especially those impacted by “log file sync” waits), setting the I/O scheduler to <strong>deadline</strong> can significantly reduce latency.</p><p>On RHEL 7+ systems, you can use tuned-adm to apply the <strong>oracle</strong> profile, which uses the <em>deadline</em> scheduler by default.<br> If your database runs on flash storage, try <strong>noop</strong> — results may vary, but it’s worth testing.<br> 💡 You can use the “oracle” profile even for non-Oracle RDBMS workloads.</p><p>tuned-adm list<br>Available profiles:<br>- accelerator-performance — Throughput performance based tuning with disabled higher latency STOP states<br>- aws — Optimize for aws ec2 instances<br>- balanced — General non-specialized tuned profile<br>- desktop — Optimize for the desktop use-case<br>- epyc-eda — Optimize for EDA compute workloads on AMD EPYC CPUs<br>- hpc-compute — Optimize for HPC compute workloads<br>- intel-sst — Configure for Intel Speed Select Base Frequency<br>- latency-performance — Optimize for deterministic performance at the cost of increased power consumption<br>- network-latency — Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance<br>- network-throughput — Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks<br>- optimize-serial-console — Optimize for serial console use.<br>- oracle — Optimize for Oracle RDBMS<br>- powersave — Optimize for low power consumption<br>- throughput-performance — Broadly applicable tuning that provides excellent performance across a variety of common server workloads<br>- virtual-guest — Optimize for running inside a virtual guest<br>- virtual-host — Optimize for running KVM guests<br>Current active profile: oracle</p><h3>3️⃣ ASMFD over ASMLIB</h3><p>Even on standalone setups, <strong>ASMFD</strong> generally offers better performance and lower CPU overhead than ASMLIB.</p><h3>4️⃣ Assess RAC Requirements Carefully</h3><p>Not every production workload needs <strong>RAC</strong>.<br> Remember — RAC is designed primarily for <strong>high availability</strong>, not for <strong>performance scalability</strong>.<br> In many cases, a simpler architecture provides better stability and easier management.</p><p>5️⃣ Disable Transparent HugePages</p><p>cat /sys/kernel/mm/transparent_hugepage/enabled<br>always madvise [never]</p><p>6️⃣ Optimize Swap and Swappiness</p><p>Keep swap at a minimum of <strong>8 GB</strong> for production workloads, and set vm.swappiness=1.<br> To make it persistent across reboots:</p><p>echo “vm.swappiness=1” &gt;&gt; /etc/sysctl.conf<br>sysctl -p</p><p>These Linux-level optimizations have consistently delivered real-world performance improvements in my experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb9aaec78bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oracle SQL Developer Extension for VS Code: Unlock AI with SQLcl MCP]]></title>
            <link>https://medium.com/@sikkius/oracle-sql-developer-extension-for-vs-code-unlock-ai-with-sqlcl-mcp-4424131935bf?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/4424131935bf</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 14:46:22 GMT</pubDate>
            <atom:updated>2025-08-24T14:46:22.635Z</atom:updated>
            <content:encoded><![CDATA[<p>VS Code has earned its reputation as one of the most versatile and powerful code editors, thanks to its vast library of extensions. These extensions empower developers to customize their environment, streamline workflows, and unlock enhanced productivity. With over <strong>75% of developers</strong> already using this IDE, chances are you’re familiar with it — and probably a fan.</p><p>Now, Oracle has added something special to the mix — the <strong>Oracle SQL Developer Extension for VS Code</strong>, released in mid-January 2024. This extension seamlessly integrates the Oracle Database development experience into the modern, flexible, and lightweight VS Code environment.</p><p><strong>Why This Extension Stands Out</strong></p><p>This extension is more than just another plugin. It brings the familiar SQL Developer experience — from executing SQL queries and scripts to interacting with schema objects — into a <strong>modern and powerful foundation</strong> within VS Code.</p><p>While the initial release doesn’t yet include every SQL Developer feature, Oracle has committed to <strong>quarterly updates</strong>, ensuring continuous enhancement and innovation.</p><p>Some quick highlights:</p><ul><li>Supports <strong>Oracle Database versions from 11g to 23ai</strong></li><li>Works across <strong>all deployment models</strong> — on-premises, virtual machines, containers, or cloud environments</li><li>Designed for both developers and DBAs looking to optimize their workflow</li></ul><h3>AI Meets SQL Developer: MCP Integration</h3><p>One of the most exciting aspects of this release is its integration with <strong>SQLcl MCP (Model Context Protocol) Server</strong>.</p><p>This feature enables developers to <strong>interact with Oracle Databases using Large Language Models (LLMs)</strong>, making it easier than ever to:</p><ul><li>Diagnose and troubleshoot performance issues</li><li>Explore schemas and understand data relationships</li><li>Analyze data patterns for insights and analytics</li></ul><p>Imagine connecting with your application schema, asking natural-language questions, and receiving optimized SQL queries — <strong>all without leaving VS Code</strong>. For this article, I’ll focus on how it helps with <strong>performance tuning</strong>, though its potential extends to data exploration and analytics as well.</p><p>Lets see how it assisted in fixing Performance issue, and you can connect using application schema and discover more, use it as much as you want to have deep insights on the schema design and what sort of the data is stored and to give on insights data analytics as well. I’m limiting this page to performance tuning not extending to data insights.</p><h3>Security Comes First</h3><p>With great power comes great responsibility — especially when integrating LLMs with databases.</p><p>A key security concern is <strong>unintended data exposure</strong>, as LLMs process and generate responses based on the data they interact with. Oracle emphasizes maintaining strict security boundaries when deploying MCP:</p><ul><li><strong>Least privilege principle</strong>: Ensure that database connections used by MCP are associated with users who have <strong>only the required permissions</strong>.</li><li><strong>Avoid direct production access</strong>: Use a <strong>sanitized, read-only replica</strong> or a dedicated data subset instead.</li><li><strong>Audit regularly</strong>: Monitor all LLM-driven queries for unusual or unauthorized activity.</li></ul><p>The MCP Server also adds transparency. It identifies itself in <strong>V$SESSION</strong> via the MODULE and ACTION properties and logs all interactions in the DBTOOLS$MCP_LOG table — a helpful feature for auditing and traceability.</p><h3>What This Unlocks</h3><p>With this extension, AI assistants and LLM-driven workflows can now <strong>seamlessly interact with Oracle Databases</strong>. Developers can:</p><ul><li>Connect to databases directly</li><li>Generate, run, and validate SQL queries and scripts</li><li>Leverage AI to quickly understand unfamiliar schemas or datasets</li></ul><p>For example, imagine inheriting a poorly documented project. Instead of manually digging through schemas and tables, you could <strong>ask your AI assistant to analyze the schema, summarize relationships, and even suggest optimized SQL queries</strong> — all within seconds.</p><p>This moves developers from a <strong>static workflow</strong>, where AI only provides SQL suggestions, to a <strong>dynamic agentic workflow</strong>, where AI can execute, validate, and iterate on those queries in real time.</p><h3>The Bottom Line</h3><p>The <strong>Oracle SQL Developer Extension for VS Code</strong> isn’t just another tool — it’s a <strong>next-generation platform</strong> that blends the power of Oracle’s SQL Developer with the agility of modern development environments and the intelligence of LLMs.</p><p>With quarterly updates and expanding features, this is the perfect time for DBAs and developers alike to <strong>explore, experiment, and embrace this new capability</strong></p><p><strong>Easy steps to install</strong></p><p><a href="https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer">Oracle SQL Developer Extension for VSCode - Visual Studio Marketplace</a></p><p>Click the <strong>Install</strong> button, and you’re all set.<br> Next, open <strong>Visual Studio Code</strong>, go to the <strong>Extensions</strong> tab, search for <strong>GitHub Copilot</strong>, and click <strong>Install</strong> to complete the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*Mg3ogQjZfZ4RyuIku_0rPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*Mwm36ebfYzJc13vwyBycCA.png" /></figure><p>Once this is installed, proceed to create connections to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*zgEYXf_k5kP4BasCRGyPqg.png" /></figure><p>Add connections and save it, for testing I’ve used the user and granted DBA privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQeH4A_wrod57SmhEtXg9g.png" /></figure><p>Once tested and saved, you’ll see the new connection listed among your available connections.</p><p>Now, here’s where it gets interesting — I ran a few tests by asking questions about my database’s health and even performed some load tests to evaluate the responses. While I can’t include every detail here, I can say the tool provided valuable insights into performance tuning (PT), helping diagnose and locate issues much faster than traditional methods.</p><p>When you’re ready, press <strong>Shift + Ctrl + P</strong> to open the search panel and access the chat. Alternatively, navigate to <strong>View → Open Chat</strong>.</p><p>For every question you ask, the response will be generated in <strong>GPT code (SQLcl MCP server)</strong>. From there, you can click <strong>Continue</strong> to execute the query directly against the database or choose <strong>Show More</strong> to view the SQL query first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcrOKQQcFAUTzKKInLeiqw.png" /></figure><p>The load test was performed on <strong>22nd August</strong>, and I’ve requested a detailed review of the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fUTd7Irai-YiHpaiZcrsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Alfir_fZu1SgO6-_W7IjzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fgSqMp5aETQGIqOa35uPYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMKbHkMa92clgMmzxl3jyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Ss1tLN3xuO6s0SM4dxz2A.png" /></figure><p>It has executed the commands to defragment the tables and new sizes are displayed. I did the same for indexes and have asked to gather stats. All the tables and the respective indexes have been defragmented and stats has been gathered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myX-A1QxByEiTUbDft1T3g.png" /></figure><p>Can it help in rewriting the query ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5fIOk5g_Lbq6s0CiQiekQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Bu3va-Hra3Z1_Lmx6DEZA.png" /></figure><p>That’s it — test the query and implement it.<br> I applied this approach to all the top queries.</p><p><strong>Result:</strong> The performance improved significantly.</p><p>I hope you found this informative. Install, test, and remember to stay cautious about security.<br>Note: You can even connect to an <strong>11g database</strong> to experiment and explore!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4424131935bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Auto-Scaling of Oracle Databases Using VMware API]]></title>
            <link>https://medium.com/@sikkius/dynamic-auto-scaling-of-oracle-databases-using-vmware-api-9771248c2e35?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/9771248c2e35</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 06:30:41 GMT</pubDate>
            <atom:updated>2024-10-16T06:30:41.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I rolled out vertical scaling as part of a core Right-sizing and operational efficiency initiative, and the results have been outstanding! Ever wondered what Oracle logs during a scaling event?</p><p>Here’s an exclusive look: my auto-scaling script kicks in when CPU usage consistently exceeds 80% for 5 minutes, seamlessly adding resources to avoid business disruptions from sudden spikes and boosting operational efficiency.</p><p>The logic is simple: I monitor CPU usage every 5 seconds, focussing on the CPU idle percentage. If the specified conditions are met, the script automatically adds 2 cores while continuously monitoring usage.</p><blockquote><strong><em>Extracted from my auto-scaling log: </em></strong><br>High CPU usage detected — CPU idle — Mon Oct 7 15:35:27 +04 2024- 10%<br>High CPU usage detected — CPU idle — Mon Oct 7 15:35:33 +04 2024- 8%<br>High CPU usage detected — CPU idle — Mon Oct 7 15:35:39 +04 2024- 7%<br>High CPU usage detected — CPU idle — Mon Oct 7 15:35:45 +04 2024- 10%<br>High CPU usage detected — CPU idle — Mon Oct 7 15:35:51 +04 2024- 5%<br><strong>CPU idle time has consistently remained below 20% for 300 seconds. Taking action to scale up… </strong><br>sleeping for 75 seconds to scale and then proceed.</blockquote><p><strong><em>After scaling the CPU idle % increased:</em></strong></p><p>CPU Idle: Mon Oct 7 15:46:47 +04 2024–27%<br>CPU Idle: Mon Oct 7 15:46:53 +04 2024–24%<br>CPU Idle: Mon Oct 7 15:46:59 +04 2024–32%<br>CPU Idle: Mon Oct 7 15:47:05 +04 2024–24%</p><p>The system began scaling, automatically boosting the core count from 34 to 46 in 10 minutes. Below is the summary of the scaling process, with the assurance that scaling never exceeds 50% of the original core count.</p><p><strong><em>Oracle Alert log messages:</em></strong></p><blockquote>2024–10–07T15:45:13.106511+04:00<br><strong>Detected change in CPU count to 46 ← — — — — — — — — — — -</strong><br>* Load Monitor used for high load check<br>* New Low — High Load Threshold Range = [0–0]<br>2024–10–07T15:45:49.021806+04:00</blockquote><p>DB parameter cpu_count has been updated as well.</p><p>SQL&gt; show parameter cpu_cou</p><p>NAME TYPE VALUE<br> — — — — — — — — — — <br>cpu_count integer 46</p><p><strong><em>VMware API for scaling:</em></strong></p><p>curl -k -X PATCH ‘<a href="https://&/#39;">https://&#39;</a>&quot;$vcenter_domain&quot;&#39;.vmwarescaling.iop/api/vcenter/vm/&#39;&quot;$vmid&quot;&#39;/hardware/cpu&#39; -H “vmware-api-session-id: $tokenid” -H ‘Content-type: application/json’ -d ‘{ “count”: ‘“$revisedcorevalue”’, “hot_add_enabled”: true, “hot_remove_enabled”: true }’</p><p>The script automatically feeds the variables to this API, completing each scaling process in 2 seconds.</p><p>Happy scaling!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9771248c2e35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database tuning comes first! Heard db_big_table_cache_percent_target DB parameter in Oracle?]]></title>
            <link>https://medium.com/@sikkius/database-tuning-comes-first-heard-db-big-table-cache-percent-target-db-parameter-in-oracle-4f4a1d533177?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f4a1d533177</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Mon, 13 May 2024 09:52:10 GMT</pubDate>
            <atom:updated>2024-05-13T09:52:10.341Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJZSMp4YQh6_B8Q73nMg1Q.jpeg" /></figure><p>Database tuning comes first! Heard db_big_table_cache_percent_target DB parameter in Oracle?</p><p>1. Recently, I had to address a performance issue reported on AWS RDS. Due to a promotional offer, the DB experienced performance issues. According to CloudWatch, the RDS was experiencing high IOPS, and a Cloud engineer was troubleshooting the issue.<br>To simplify the situation, the Apps team encountered a performance issue, and based on CloudWatch data, the Cloud engineer decided to switch from General Purpose SSD to Provisioned IOPS SSD.</p><p>After discussions between the Cloud engineer and the Apps team, it was decided to proceed with the move to Provisioned IOPS. Fortunately, the Cloud engineer consulted with a Cloud DBA before proceeding.</p><p>Since the Cloud engineer had already conducted thorough investigations, I could directly analyze the queries causing the issue.</p><p>Upon examining the query, I discovered that the issue was due to a Full Table Scan, which led to high IOPS under additional load. I resolved the issue by creating an index.</p><p>Before deciding to upgrade the resources, exploring possible tuning options within the DB is important, especially considering that we have to pay the vendor for each service.</p><p>2. On another occasion, a similar issue occurred on a Database running on EC2. However, this time the issue was not caused by a Full Table Scan, as the query was already optimized and creating an index was not feasible.</p><p>In this case, the query had to perform a Full Table Scan while still providing better performance. Therefore, I decided to enable the DB parameter DB_BIG_TABLE_CACHE_PERCENT_TARGET. I initially tried using db_keep_cache_size, but since the queries were not regularly used and sometimes executed massively, it caused slowdowns. As db_big_table_cache_percent_target operates based on temperature, it proved to be more useful than keep/recycle cache.</p><p>The issue described here is similar to what is mentioned in the article below.</p><p><a href="https://geertdepaep.wordpress.com/2017/05/12/why-db_big_table_cache_percent_target-was-a-good-solution-in-my-case/">https://geertdepaep.wordpress.com/2017/05/12/why-db_big_table_cache_percent_target-was-a-good-solution-in-my-case/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f4a1d533177" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-click Oracle upgrade to 19c — Autonomous Oracle database upgrade, Augmented data management…]]></title>
            <link>https://medium.com/@sikkius/one-click-oracle-upgrade-to-19c-autonomous-oracle-database-upgrade-augmented-data-management-21516806330f?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/21516806330f</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Mon, 06 May 2024 04:54:18 GMT</pubDate>
            <atom:updated>2024-05-06T05:29:59.231Z</atom:updated>
            <content:encoded><![CDATA[<h3>One-Click Upgrade to Oracle 19c: Leveraging DevOps tools for Database Upgrades as part of Augmented Data Management Enablement</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*1t2ACE3f17IhsvGt9qNbcg.png" /></figure><p>A quick touch on Augmented data management</p><p><a href="https://www2.deloitte.com/nl/nl/pages/enterprise-technology-and-performance/articles/augmented-data-management-beyond-the-hype.html">https://www2.deloitte.com/nl/nl/pages/enterprise-technology-and-performance/articles/augmented-data-management-beyond-the-hype.html</a></p><p>While implementing augmented data management to automate manual tasks using modern architecture, I came across a situation where a client encountered substantial hurdles in resolving technical debt. The heavy dependence on the DBA team and the crucial requirement for DBA availability, especially during Oracle upgrades, posed significant challenges. With more than 200 non-production databases in the mix, it became evident that a more efficient approach was necessary.</p><p>However, I’ve successfully addressed this issue by leveraging DevOps tools like Jenkins (JaaS — Jenkins as a service) to enable one-click Oracle DB upgrades. This solution eliminates the need for manual intervention and reduces dependency on DBA availability. This is an Oracle 19c upgrade as a service.</p><p><strong>Here’s how it works:</strong></p><ol><li>I created a dedicated project in Jenkins specifically for Oracle DB upgrades.</li><li>Jenkins connects to the DB server and executes a predefined bash script, which automates the entire upgrade process.</li><li>The script handles tasks such as installation, pre-checks, upgrade execution, and modification of listener configurations.</li></ol><p>By implementing this automated approach, I’ve significantly streamlined the upgrade process and minimized downtime associated with technical debt clearance. This solution empowers teams to perform upgrades seamlessly with zero to minimal manual intervention.</p><p><strong>Two phases -</strong></p><p>In the initial phase, the Apps team executes the Jenkins job to verify if all prerequisites are met. Upon successful completion of these checks, the application team can proceed to submit the upgrade job.</p><p>In the second phase, the actual upgrade is performed autonomously. The entire upgrade process proceeds without any intervention from the DBA. Currently, this setup is deployed exclusively to non-production and non-RAC environments, reflecting the predominant setup of the customer.</p><p><strong>Below is a snippet of the Jenkins project.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uUtyeH9AmSIAjXm34dVIg.png" /></figure><p>What is expected from the Application team, just 2 inputs are required to perform an upgrade thru Jenkins. Database name and the server name it runs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*tYtumpFZ9oIUXbj5IHhPAA.png" /></figure><p>The following snippet demonstrates the successful execution of pre-check validation. It performs all necessary checks and provides the green light to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*ArhRgLAei_COF_Ryz80SjQ.png" /></figure><p><strong>Summary of the checks it does.</strong></p><ul><li>Red Hat Enterprise Linux (RHEL) version 7 or higher.</li><li>Verification of Oracle Database 19c binaries. If not found, it retrieves and installs them from the repository.</li><li>Downloading and execution of the latest preupgrade.jar file for conducting pre-checks on the specified database.</li><li>Database version must be 11.2.0.4 or higher to proceed with the upgrade process.</li><li>Creation of a restore point.</li><li>Validation of the System Global Area (SGA) size and configuration of parameters for db_recovery_file_dest and db_recovery_file_dest_size.</li><li>Collection of SYSTEM and Fixed Object statistics.</li><li>Comprehensive coverage of all Oracle recommended pre-checks essential for successful upgrades.</li></ul><p>Now let&#39;s move to the actual upgrade phase.</p><p>A snippet of the upgrade log when the apps team submitted the upgrade job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2B3xdla4EBAAGjQPhFPpQ.png" /></figure><p>I’ll cut down on other messages that come along with the upgrade and move towards the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*3jmwoA_dVV99tD-q02s7ww.png" /></figure><p>Performing time zone upgrade as part of an automated upgrade process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*tbvrxV6hOo_FqtVq-yS0BQ.png" /></figure><p>Executing Post — upgrade script automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*JlITCGAReDkJIvvplyPBdg.png" /></figure><p>Migrating the DB service to 19c automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrpo_lrY0YQ2PdAyKeDdJQ.png" /></figure><p>Finishing the upgrade job and releasing it to the apps team automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSK4QkpPKfJ0nxAe7g9LTA.png" /></figure><p>In our quest to streamline the Oracle upgrade process, Jenkins emerged as a crucial facilitator, freeing the DBA team from repetitive tasks and allowing them to concentrate on strategic pursuits such as optimization. While Oracle auto-upgrade does have its benefits, our approach prioritized a comprehensive upgrade process, which encompassed installation and key setup tasks, all accomplished without manual intervention.</p><p>This approach not only fully utilizes the capabilities of the DBA team, but also emphasizes the transformative effect of automation in enhancing efficiency and driving innovation.</p><p>The application team has enthusiastically embraced the new process, completing over 35 upgrades independently, without requiring any involvement from the DB team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21516806330f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auto repair Oracle SQL Performance Regression with ADD_VERIFIED_SQL_PLAN_BASELINE]]></title>
            <link>https://medium.com/@sikkius/auto-repair-oracle-sql-performance-regression-with-add-verified-sql-plan-baseline-f5d0055c8d2f?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5d0055c8d2f</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Wed, 01 May 2024 05:11:43 GMT</pubDate>
            <atom:updated>2024-05-02T07:17:54.920Z</atom:updated>
            <content:encoded><![CDATA[<p>Is your query suddenly running slower than usual? One potential reason could be a SQL plan change.</p><p>If you’re in 19c, simply apply the 19.22 patch and leverage this feature to tell Oracle to fix it. This is 23c feature backported to 19c (19.22).</p><p>There’s no need to invest time in scanning the history of SQL plans and baselining them manually. Oracle handles this intelligently for you as part of SQL Plan Management (SPM).</p><p>Here’s how it works:</p><p>The procedure ADD_VERIFIED_SQL_PLAN_BASELINEleverages SQL Plan Management, which is the optimal solution for maintaining plan stability.</p><p>It thoroughly examines all your SQL tuning sets, including automatic SQL tuning sets, AWR, and cursor cache, to identify alternative plans for the SQL in question.<br>Each potential plan undergoes testing to determine the most effective one.<br>Subsequently, a SQL plan baseline is established, incorporating the best plan.<br>In subsequent executions, the database will utilize the identified best plan, ensuring optimal performance.</p><p>To enable this for specific SQL, just pass the SQL_ID and you are done,</p><pre>EXEC DBMS_SPM.ADD_VERIFIED_SQL_PLAN_BASELINE(&#39;&lt;sql_id&#39;);</pre><p>In SQL Plus, you can use it like this:</p><p>set long 100000<br>set tab off<br>set linesize 200<br>column report format a150<br>var report clob</p><p>exec :report := dbms_spm.add_verified_sql_plan_baseline(‘sql_id’);<br>select :report report from dual;</p><p>For more info:</p><p><a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_SPM.html#GUID-3B5BEFD9-DBF2-490C-A8D6-2295CC3B8AD9">https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_SPM.html#GUID-3B5BEFD9-DBF2-490C-A8D6-2295CC3B8AD9</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5d0055c8d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Performance Enhancements: From 15+ Hours to 4+ Hours with Exadata Migration]]></title>
            <link>https://medium.com/@sikkius/unveiling-the-performance-enhancements-from-15-hours-to-4-hours-with-exadata-migration-2f3eeed2d7fc?source=rss-0dbe92148a89------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f3eeed2d7fc</guid>
            <dc:creator><![CDATA[Sikkandar Badusha]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 05:56:15 GMT</pubDate>
            <atom:updated>2024-04-17T06:02:58.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, this happened some time ago, but I wanted to share it with a wider audience in case it proves helpful. It was three months of effort, and I’ve tried to summarize it as concisely as possible.</p><p><strong>Background:</strong></p><p>The Oracle database installed on-premises was primarily used for generating analytical reports via Microstrategy. Despite my exhaustive efforts to optimize various aspects such as instance configuration, memory allocation, I/O optimization, and query performance, the application’s inherent complexities resulted in persistent performance issues. With a database size exceeding 25TB, the nightly processing time consistently exceeded 17 hours, surpassing our desired expectations</p><ul><li>The tables were appropriately partitioned, facilitating efficient partition pruning.</li><li>Correct indexes were implemented for the majority of queries.<br>Comprehensive statistics were collected for all critical tables.</li><li>The RHEL Oracle profile (tuned-adm) was enabled to optimize system performance.</li><li>Despite attempts with SQL profile, parallelism, and SQL Baseline, these measures proved ineffective due to the unique characteristics of queries generated by Microstrategy. I will elaborate on this later.</li><li>No underlying resource constraints like CPU, Memory and IO..</li><li>With multiple reports running together, the performance was really bad.</li></ul><p>After raising a service request with Oracle and undergoing multiple escalations, it was recommended that migrating to Exadata would address the underlying issue.</p><p>Here the Exadata machine was procured and we have successfully migrated on-premise 25TB+ data to Exadata.</p><p><strong>Exadata migration Outcome:</strong></p><ul><li>Process time reduced by 2 hours, but no positive impact on business.</li><li>Some reports improved significantly, e.g., from 30 minutes hours to 1 minute, due to Smart Scan, but no consistency.</li><li>Despite many reports using Smart Scan, overall satisfaction was not achieved.</li></ul><p><strong>Tuning options there were tried:</strong></p><ul><li>Enabled parallelism on key tables</li><li>Used Advanced compression</li><li>Tweaked _optimizer_gather_stats_on_load to keep the stats up to date.</li><li>Played with all optimizer parameters settings, I didn’t want to mention it as all the attempts were not successful.</li></ul><p>Inconsistent improvements in certain reports suggest that the product has the potential, but proper engineering is needed to find a solution. Microstrategy inherently generates tables using the CTAS method and then executes a final query to present the output. As slow performance is observed during CTAS, and the table name is always unique, conventional optimization techniques such as SQL profile or SQL Baseline are not applicable.</p><p>Failure to execute proper engineering within the product management lifecycle can lead to divergent paths or even render the product unsuccessful. Aware of Exadata’s capability to handle tasks efficiently, I was motivated to address the issue.</p><p>After raising a service request with Oracle, an Oracle ACS consultant visited and recommended query rewriting due to best practices not being followed. However, the intermittent nature of the issue puzzled me, as it should consistently manifest if the queries were the root cause. Collaborating with Microstrategy experts, we discovered that skipping indexes led to faster query execution, while using indexes resulted in slower performance. To address this, I made all indexes invisible except for DML processes, ensuring visibility only during DML operations.</p><ul><li>Indexes were made invisible.</li><li>Created logon trigger for DML operation not to have an impact.</li></ul><p>It did help to certain extent reducing the process time from 15+ hours to 12+ hours, but no consistency. This prompted me to deep dive more into CTAS queries.. It was hard to read execution plan for good and bad time because of the length of execution plan. SQL queries were having 100+ lines so imagine the execution plan. During problematic time, the execution plan was:</p><p><strong>Problematic Execution plan:</strong></p><p>===============================================================<br>| 55 | STATISTICS COLLECTOR | |<br>| 56 | NESTED LOOPS | | &lt;&lt;==========&lt;&lt;&lt;&lt; NESTED LOOPS<br>| 57 | BUFFER SORT | |<br>| 58 | PX RECEIVE | |<br>| 59 | PX SEND BROADCAST | :TQ10000 |<br>|* 60 | TABLE ACCESS FULL | BUS_DIM |<br>|* 61 |. FILTER | |<br>| 62 |. TABLE ACCESS FULL | BUS_CPO_DIM |<br>|* 63 |. TABLE ACCESS FULL | BUS_CPO_DETAIL |<br>| 64 |. SORT AGGREGATE | |<br>|* 65 |. TABLE ACCESS FULL | BUS_DETAIL_ML |<br>| 66 | PXBLOCK ITERATOR | |<br>|* 67 | TABLE ACCESS FULL | BUS_FL_FACT |<br>| 68 | BUFFER SORT | |<br>===============================================================</p><p>Interestingly, there was no evidence of Nested Loop usage during periods of faster query execution. After dedicating considerable time to investigation, I observed that queries performed better and consistently met time expectations when the optimizer opted for Hash Joins over Nested Loops.</p><p>I left with one option, How to favour the queries to take only Hash Join and ignore Nested loop. Having said earlier SQL tuning is not applicable here because reports runs CTAS with unique table name always.</p><p><strong>Example, one report time was :</strong></p><p>Partition + Smart scan + Nested loop — 16.2 mins</p><p>Partition + Smart scan + Hash — 42 seconds</p><p><strong>Microstrategy behaviour in giving table alias name:</strong></p><p>Microstrategy employs table aliases consistently, sequentially assigning them (e.g., a1, a2, etc.) when reports interact with multiple tables. I recommended Microstrategy expert to use SQL hints to enforce Hash Joins, specifying “use_hash” for each table alias (a1 to a25) to cover all relevant aliases. Surprisingly, this adjustment led to a reduction in processing time from over 10 hours to approximately 8 hours, <strong>while also ensuring consistency in performance</strong>. Remarkably, no issues were reported thereafter. However, it’s worth noting that this solution didn’t apply to ad-hoc reports due to the inability to apply hints.</p><p><strong>Implementing solution:</strong></p><p>Haved raised SR with Oracle and explained the situation and after multiple escalation got right engineer to work on this. Oracle engineer advised to set this parameter at the session level to favour Hash Join over Nested loop join, leveraged Logon trigger to set only for those reporting sessions.</p><p>create or replace trigger after_logon<br>after logon on schema<br>begin<br>execute immediate ‘alter session set “_new_initial_join_orders”=false’;<br>end;<br>/</p><p><strong>Results and Impact:</strong><br>Through persistent experimentation and collaboration, we successfully reduced processing time from over 15 hours to approximately 4 hours. Moreover, the optimized solution provided a foundation for smoother execution of ad-hoc queries, enhancing overall system reliability and user satisfaction despite the database growth from 25TB+ which is now 110TB+.</p><p><strong>Conclusion:</strong><br>Our journey to optimize database performance underscores the importance of perseverance, innovation, and collaboration in overcoming complex challenges. By embracing a data-driven approach and leveraging collective expertise, we transformed a longstanding bottleneck into a catalyst for operational efficiency.</p><p>In conclusion, the three-month effort has truly paid off and most importantly the business was super happy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f3eeed2d7fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>