<?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>Grégory Steulet, auteur/autrice sur dbi Blog</title>
	<atom:link href="https://www.dbi-services.com/blog/author/gregory-steulet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/author/gregory-steulet/</link>
	<description></description>
	<lastBuildDate>Tue, 10 Sep 2024 13:54:40 +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>Grégory Steulet, auteur/autrice sur dbi Blog</title>
	<link>https://www.dbi-services.com/blog/author/gregory-steulet/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Managing transaction priority in Oracle 23c</title>
		<link>https://www.dbi-services.com/blog/managing-transaction-priority-in-oracle-23c/</link>
					<comments>https://www.dbi-services.com/blog/managing-transaction-priority-in-oracle-23c/#comments</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Thu, 21 Sep 2023 03:39:32 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[23c]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=28001</guid>

					<description><![CDATA[<p>Introduction Out of the 300 features encapsulated in the new Oracle 23c database, I&#8217;ve chosen to write during the Oracle CloudWord a brief blog post about a feature that particularly caught my attention: Automatic Transaction Rollback. Starting from version 23c, Oracle enables automatic transaction rollback with parameters to manage this functionality. Through this blog post [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/managing-transaction-priority-in-oracle-23c/">Managing transaction priority in Oracle 23c</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-introduction">Introduction</h2>



<p class="wp-block-paragraph">Out of the 300 features encapsulated in the new Oracle 23c database, I&#8217;ve chosen to write during the Oracle CloudWord a brief blog post about a feature that particularly caught my attention: Automatic Transaction Rollback.</p>



<p class="wp-block-paragraph">Starting from version 23c, Oracle enables automatic transaction rollback with parameters to manage this functionality. Through this blog post I’ll demonstrate, with a practical example how this functionality works.</p>



<h2 class="wp-block-heading" id="h-use-case-scenario">Use case scenario</h2>



<p class="wp-block-paragraph">Let&#8217;s consider the following scenario: two developers are working on the table &#8220;employees&#8221; , and a critical batch process runs every 30 minutes on this same table. </p>



<p class="wp-block-paragraph">The first developer (Dev1) is performing an update operation that takes some time. Instead of waiting for the update to complete and deciding whether to commit or rollback the transaction, Dev1 decides to go to the cafeteria.</p>



<p class="wp-block-paragraph">The second developer (Dev2) is also working on the same project and needs to update the same table shortly after Dev1 started his update. However, because of the lock created by Dev1&#8217;s update, Dev2 is unable to execute his transaction. Becoming impatient while waiting at the laptop, Dev2 decides to leave for home, leaving the transaction pending.</p>



<p class="wp-block-paragraph">After a few minutes, the critical batch process (executed by &#8220;financial_app&#8221;) starts, but it too becomes stuck due to the ongoing update on the &#8220;employees&#8221; table.</p>



<h2 class="wp-block-heading" id="h-transaction-rollback-with-oracle-23c">Transaction Rollback with Oracle 23c</h2>



<p class="wp-block-paragraph">A situation like this can now be managed using Automatic Transaction Rollback. To set up transaction rollback, we need to consider two (or three) parameters:</p>



<ol class="wp-block-list">
<li>Transaction priority (txn_priority), which can be set on session level to low, medium or high.</li>



<li>Time a transaction holding row lock can be automatically rolled back. This setting can be set in the system parameters (TXN_AUTO_ROLLBACK_HIGH_PRIORITY_WAIT_TARGET &amp; TXN_AUTO_ROLLBACK_MEDIUM_PRIORITY_WAIT_TARGET)</li>
</ol>



<h3 class="wp-block-heading" id="h-transaction-priority">Transaction priority</h3>



<p class="wp-block-paragraph">The priority can be changed on session level using the below syntax:</p>



<pre class="wp-block-code"><code>ALTER SESSION SET "txn_priority" = "HIGH";</code></pre>



<p class="wp-block-paragraph">As stated in the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/refrn/TXN_PRIORITY.html#GUID-9E60833D-8B58-4E71-9CAF-60EB4C5648C7">Oracle documentation:</a></p>



<ul class="wp-block-list">
<li>If a&nbsp;<code><strong>HIGH</strong></code>&nbsp;priority transaction is blocked for a row lock, Oracle database can roll back the transaction that is holding the row lock only if the holder is&nbsp;<code>LOW</code>&nbsp;or&nbsp;<code>MEDIUM</code>&nbsp;priority.</li>



<li>If a&nbsp;<code><strong>MEDIUM</strong></code>&nbsp;priority transaction is blocked for a row lock, Oracle database can roll back the transaction that is holding the row lock only if the holder is&nbsp;<code>LOW</code>&nbsp;priority.</li>



<li>If a&nbsp;<strong><code>LOW</code>&nbsp;</strong>priority transaction is blocked for a row lock, Oracle database will not attempt to roll back the transaction holding the row lock irrespective of its priority.</li>



<li>Oracle database never rolls back a&nbsp;<code>HIGH</code>&nbsp;priority transaction.</li>
</ul>



<h3 class="wp-block-heading" id="h-time-a-transaction-holding-row-lock-can-be-automatically-rolled-back"><strong>Time a transaction holding row lock can be automatically rolled back</strong></h3>



<p class="wp-block-paragraph">There are two system parameters which define the time (in seconds) after a transaction holding row lock can be automatically rolled back:</p>



<ol class="wp-block-list">
<li><code>TXN_AUTO_ROLLBACK_<strong>HIGH</strong>_PRIORITY_WAIT_TARGET</code>&nbsp;</li>



<li><code>TXN_AUTO_ROLLBACK_<strong>MEDIUM</strong>_PRIORITY_WAIT_TARGET</code>&nbsp;</li>
</ol>



<p class="wp-block-paragraph">There is no low priority wait target parameter provided since Oracle database doesn&#8217;t roll back a blocker transaction if waiter&#8217;s priority is&nbsp;<code>LOW</code>.</p>



<p class="wp-block-paragraph">These system parameters can be defined using the below command (example for txn_auto_rollback_high_priority_wait_target):</p>



<pre class="wp-block-code"><code>ALTER SYSTEM SET txn_auto_rollback_high_priority_wait_target = 15;</code></pre>



<h2 class="wp-block-heading" id="h-preparation-of-the-environnement-to-run-our-example">Preparation of the environnement to run our example</h2>



<p class="wp-block-paragraph">Let&#8217;s revisit our example with two developers (dev1 and dev2) and one critical application (financial_app) and break down this scenario step by step:</p>



<h3 class="wp-block-heading" id="h-users-creation">Users creation</h3>



<p class="wp-block-paragraph">This step doesn&#8217;t add much to my example, except that it allows me to demonstrate the use of another new and interesting feature: the DB_DEVELOPER_ROLE. This role provides the fundamental roles and privileges that Oracle believes are essential for a database developer.</p>



<pre class="wp-block-code"><code>SQL&gt; create user dev1 identified by dev1;
SQL&gt; create user dev2 identified by dev2;
SQL&gt; create user financial_app identified by financial_app;
SQL&gt; alter user financial_app quota 128M on users;
SQL&gt; grant DB_DEVELOPER_ROLE to dev1, dev2, financial_app;</code></pre>



<p class="wp-block-paragraph">… well let’s say two others features with the &#8220;grant on schema&#8221; features (schema level privilege): </p>



<pre class="wp-block-code"><code>SQL&gt; grant select any table on schema financial_app to dev1, dev2;
SQL&gt; grant insert any table on schema financial_app to dev1, dev2;
SQL&gt; grant update any table on schema financial_app to dev1, dev2;</code></pre>



<h3 class="wp-block-heading" id="h-table-creation">Table creation</h3>



<p class="wp-block-paragraph">Let&#8217;s create a very basic employees table:</p>



<pre class="wp-block-code"><code>SQL&gt; CREATE TABLE financial_app.employees ( employee_id number(10) NOT NULL, employee_name varchar2(50) NOT NULL, city varchar2(50) );</code></pre>



<p class="wp-block-paragraph">We will now insert few rows: </p>



<pre class="wp-block-code"><code>SQL&gt; insert into financial_app.employees (employee_id, employee_name, city) values (1, 'Westermann', 'Basel'), (2, 'Wisson', 'Nidau'), (3, 'Usai', 'Sutz'), (4, 'Berbier', 'Zurich');</code></pre>



<h3 class="wp-block-heading" id="h-priority-wait-definition">Priority wait definition</h3>



<p class="wp-block-paragraph">For the sake of this example, we will assign different wait target to &#8220;Medium&#8221; and &#8220;High&#8221; priority transactions.</p>



<pre class="wp-block-code"><code>SQL&gt; ALTER SYSTEM SET txn_auto_rollback_high_priority_wait_target = 15;
SQL&gt; ALTER SYSTEM SET txn_auto_rollback_medium_priority_wait_target = 30;</code></pre>



<h2 class="wp-block-heading" id="h-let-s-run-our-example">Let&#8217;s run our example</h2>



<p class="wp-block-paragraph">As mentionned in our introduction we have three users with three different sessions (Dev1, Dev2 and financial_app). Dev1 and Dev2 will both update employees table and won&#8217;t commit nor rollback their transaction. Each of these three users will have a different priority:  </p>



<p class="wp-block-paragraph"><strong>Dev1</strong> &#8211; priority low</p>



<pre class="wp-block-code"><code>&#091;oracle@grs-oraclecloudinstance bin]$ ./sqlplus dev1/dev1
SQL&gt; ALTER SESSION SET "txn_priority" = "LOW";</code></pre>



<p class="wp-block-paragraph"><strong>Dev2</strong> &#8211; priority medium</p>



<pre class="wp-block-code"><code>&#091;oracle@grs-oraclecloudinstance bin]$ ./sqlplus dev2/dev2
SQL&gt; ALTER SESSION SET "txn_priority" = "MEDIUM";</code></pre>



<p class="wp-block-paragraph"><strong>financial_app</strong> &#8211; priority high</p>



<pre class="wp-block-code"><code>&#091;oracle@grs-oraclecloudinstance bin]$ ./sqlplus financial_app/financial_app
SQL&gt; ALTER SESSION SET "txn_priority" = "HIGH";</code></pre>



<h3 class="wp-block-heading" id="h-update-execution">Update execution</h3>



<p class="wp-block-paragraph"><strong>Dev 1 </strong></p>



<p class="wp-block-paragraph">First of all we have Dev1 who runs his update on employees table. In this example he only updates one row and it&#8217;s obviously very fast but anyway he do not commit his transaction. </p>



<pre class="wp-block-code"><code>SQL&gt; UPDATE financial_app.employees set employee_name = 'Steulet' where employee_ID=1;
1 row updated.

SQL&gt; SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
TO_CHAR(SYSDATE,'MM
-------------------
09-21-2023 <strong>01:08:30</strong>
</code></pre>



<p class="wp-block-paragraph"><strong>Dev2</strong></p>



<p class="wp-block-paragraph">5 second later, we have Dev2 who runs his update on employees table but as mentionned before Dev1 forgot to commit his transaction. </p>



<pre class="wp-block-code"><code>SQL&gt; SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
TO_CHAR(SYSDATE,'MM
-------------------
09-21-2023 01:08:35</code></pre>



<pre class="wp-block-code"><code>SQL&gt; UPDATE financial_app.employees set employee_name = 'Schweitzer' where employee_ID=1;</code></pre>



<p class="wp-block-paragraph">Here the transaction is stuck due to the row lock but after 30 seconds we get the below confirmation:</p>



<pre class="wp-block-code"><code>1 row updated.</code></pre>



<pre class="wp-block-code"><code>SQL&gt; SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
TO_CHAR(SYSDATE,'MM
-------------------
09-21-2023 01:09:05</code></pre>



<p class="wp-block-paragraph"><strong>Financial_app</strong></p>



<p class="wp-block-paragraph">The second developer, dev2, also did not commit his transaction but the financial_app runs his update at 01:10:16: </p>



<pre class="wp-block-code"><code>SQL&gt; SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
TO_CHAR(SYSDATE,'MM
-------------------
09-21-2023 01:10:16</code></pre>



<pre class="wp-block-code"><code>SQL&gt; Update financial_app.employees set employee_name = '*';</code></pre>



<p class="wp-block-paragraph">As before the transaction his stuck due to the row lock but after 15 seconds we get the following confirmation:</p>



<pre class="wp-block-code"><code>1 row updated.

SQL&gt; SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
TO_CHAR(SYSDATE,'MM
-------------------
09-21-2023 01:10:31</code></pre>



<h2 class="wp-block-heading" id="h-what-happened">What happened?</h2>



<p class="wp-block-paragraph">As often, a picture is worth a thousand words. The image below summarizes what happened with these three sessions.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="725" height="449" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleTransaction.png" alt="" class="wp-image-28002" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleTransaction.png 725w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleTransaction-300x186.png 300w" sizes="(max-width: 725px) 100vw, 725px" /><figcaption class="wp-element-caption"><em>Diagram with the transaction update sequence</em></figcaption></figure>



<p class="wp-block-paragraph">User Dev 1 runs his update at 01:08:30, he immediately received the confirmation that his row was updated. However, he did not commit his transaction, which resulted in a lock on the employees&#8217; table.</p>



<p class="wp-block-paragraph">5 seconds later at 01:08:35, Dev2 also performed an update on the same table. He did not receive an immediate confirmation of his update. However, after 30 seconds, at 01:09:05, the confirmation arrived. This eventually caused the session of Dev1 to end with a rollback of his transaction. Dev 2, did not commit his transaction neither, which also resulted in a lock on the employee&#8217;s table. </p>



<p class="wp-block-paragraph">Few seconds later at 01:10:16, financial_app runs his batch on employees table. As for Dev2, the batch was not able to execute immediately the update. However after 15 seconds, the confirmation arrived. This caused the session of Dev2 to end with a rollback of his transaction. </p>



<p class="wp-block-paragraph">The content of the employees&#8217; table at 01:10:31 in the financial_app&#8217;s session is as follows:</p>



<pre class="wp-block-code"><code>SQL&gt; set linesize 200
SQL&gt; select * from financial_app.employees;
EMPLOYEE_ID EMPLOYEE_NAME             CITY
----------- ------------------------- ---------------------
          1 *                         Basel
          2 *                         Nidau
          3 *                         Sutz
          4 *                         Zurich
</code></pre>
<p>L’article <a href="https://www.dbi-services.com/blog/managing-transaction-priority-in-oracle-23c/">Managing transaction priority in Oracle 23c</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/managing-transaction-priority-in-oracle-23c/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Larry Ellison &#8211; Oracle&#8217;s Vision for the future</title>
		<link>https://www.dbi-services.com/blog/artificial-intelligence/</link>
					<comments>https://www.dbi-services.com/blog/artificial-intelligence/#comments</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Wed, 20 Sep 2023 05:28:11 +0000</pubDate>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Oracle]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=27942</guid>

					<description><![CDATA[<p>Generative AI changes everything Larry Ellison kicked off his keynote by delving into Artificial Intelligence, particularly focusing on ChatGPT. The phrase is sure to become famous &#8220;About a year ago OpenAI demonstrated ChatGPT 3.5 and much to the shock of the people who developed ChatGPT… the baby talks. Seriously the developers did not expect that&#8220;. [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/artificial-intelligence/">Larry Ellison &#8211; Oracle&#8217;s Vision for the future</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-generative-ai-changes-everything">Generative AI changes everything</h2>



<p class="wp-block-paragraph">Larry Ellison kicked off his keynote by delving into Artificial Intelligence, particularly focusing on ChatGPT. The phrase is sure to become famous &#8220;<em><strong>About a year ago OpenAI demonstrated ChatGPT 3.5 and much to the shock of the people who developed ChatGPT… the baby talks. Seriously the developers did not expect that</strong></em>&#8220;.</p>



<p class="wp-block-paragraph">Larry then revisited OpenAI&#8217;s history, explaining that it was developed a decade ago. He notablity explained that they constructed an enormous neural network composed of billions of artificial neurons. After building it, they extensively trained it on a vast amount of data, including the entire public Internet. However, the underlying concept remained consistent with previous iterations. What set ChatGPT 3.5 apart was its larger neural network and broader training data. Due to this increase in scale, when prompted with questions, ChatGPT unexpectedly provided answers and engaged in conversation. This revelation surprised the ChatGPT team, AI professionals, and the world at large, capturing our collective imagination.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="483" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424-1024x483.jpeg" alt="" class="wp-image-27944" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424-1024x483.jpeg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424-300x142.jpeg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424-768x362.jpeg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424-1536x725.jpeg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/5CDE50A9-4955-4EC7-8A35-2154BDE6C424.jpeg 1592w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Larry Ellison during his keynote about Oracle&#8217;s vision for the future</em></figcaption></figure>



<p class="wp-block-paragraph">However, as Larry mentioned, most cool tech doesn&#8217;t come without risks. Everyone wants to know what comes next. &#8220;<em>What comes next is a wordwide race to build what comes next, to build better AI</em>&#8220;. While better features will undoubtedly emerge, they also bring new risks, like any new technology. &#8220;<em><strong>From early innovations like fire, which could be misused, to later technologies such as nuclear power, all new technology carries potential for misuse</strong></em>&#8220;.</p>



<p class="wp-block-paragraph">As stated in Larry&#8217;s slides: &#8220;<em>Is Generative AI the Most Important New Computer Technology Ever? Probably!</em>&#8221; </p>



<p class="wp-block-paragraph">To the question what does the future hold? &#8220;<em>Complete self-driving cars within the next 12 months from Tesla, computer-designed antiviral drugs, and much more.</em>&#8220;</p>



<h3 class="wp-block-heading" id="h-oracle-cloud-best-cloud-for-training-generative-ai-models">Oracle Cloud Best Cloud for training Generative AI Models</h3>



<p class="wp-block-paragraph">Larry mentionned that Oracle Gen2 Cloud stands out from other clouds in several significant ways. According to him, one of the key distinctions is the network that Oracle employs to interconnect its computers. He refers here about the <a href="https://en.wikipedia.org/wiki/Remote_direct_memory_access">RDMA (Remote Direct Memory Access)</a> Network which connects NVIDIA GPUS into Huge Superclusters. This network grants Oracle the ability to transfer large volumes of data between computers at incredible speeds, surpassing conventional networks. This remarkable speed enhances Oracle Cloud&#8217;s capacity for rapidly training AI models.</p>



<p class="wp-block-paragraph">In his own words: &#8220;<em>We are much faster and many times less expensive than the other clouds for training AI Models</em>&#8220;</p>



<h3 class="wp-block-heading" id="h-nvidia-supercomputer">NVIDIA Supercomputer</h3>



<p class="wp-block-paragraph">Larry Ellison then came back on NVIDIA&#8217;s announcement regarding the construction of the <a href="https://www.nvidia.com/en-us/industries/supercomputing/">world&#8217;s fastest AI supercomputer</a>, leveraging the NVIDIA H100 GPU and the Oracle Cloud RDMA Network. He emphasized that while the processing speed of data is crucial, the ability to move data quickly between computers is equally vital; otherwise, processors remain idle. Oracle&#8217;s exceptional data transfer speed advantage stems from their early adoption of this technology for their own database technology, effectively solving the data movement challenge.</p>



<h2 class="wp-block-heading" id="h-generative-ai-is-transformational"><strong>Generative AI is Transformational</strong></h2>



<p class="wp-block-paragraph">Larry explained that Generative AI is fundamentally changing how Oracle (will) build and run applications. He provided the following examples: </p>



<ul class="wp-block-list">
<li>Improved APEX Application Generator: No Code – not – Low code</li>



<li>Improved Autonomous Elastic Database: No Human Labor – No Human Error</li>



<li>New Object Relational Database: Generate Relational Schema from JSON documents</li>



<li>New Oracle Vector Database: Specializes Generative LLMS for Medicine, Law…</li>



<li>New Cloud Data Intelligence Platform: Population Scale Data Trains Medical AI Models</li>
</ul>



<h3 class="wp-block-heading" id="h-apex-for-all-future-oracle-applications-development">Apex for all future Oracle Applications development?</h3>



<p class="wp-block-paragraph">According to Oracle&#8217;s CTO and co-founder, most new Oracle applications will now be generated with APEX, including Cerner New Millennium, Fusion Marketing, Banking, Retail, Hospitality, and more. APEX enables development teams to be streamlined, significantly reduces development time, and ensures more secure and reliable results. While existing Java projects at Oracle will continue, no new Oracle products will be developed in Java, despite Oracle&#8217;s history of using Java for development. </p>



<p class="wp-block-paragraph">Additionally, all Oracle new or strategic applications will now run on Autonomous Database, typically Fusion &amp; NetSuite will move to Autonomous Elastic Database. Why this decision?</p>



<p class="wp-block-paragraph"><em><strong>&#8220;If there is no human labor, there is no human error… the only way to build a secure system is to eliminate human error.”</strong></em></p>



<p class="wp-block-paragraph">Larry then discussed the utilization of AI in the healthcare sector, including medical AI models, and the methods for collecting patient data using Cloud IoT devices such as blood pressure monitors, pulse oximeters, smartwatches, and more.</p>



<h3 class="wp-block-heading" id="h-ai-can-transform-other-industries"><strong>AI can transform other industries</strong></h3>



<p class="wp-block-paragraph">Following the previous examples that were given and aside from medicine, there are other industries that can be transformed by Artificial Intelligence. The CTO and co founder provided us with a compelling example from the agriculture sector, specifically Greenhouse Agriculture Robots. These technologies offer various advantages, including:</p>



<ul class="wp-block-list">
<li>Grow using 98% Less water</li>



<li>Grow using 90% less land</li>



<li>Grow new Population Centers</li>



<li>Daily Harvest with Same Day Delivery</li>



<li>Better Job Security and Job Quality</li>
</ul>



<p class="wp-block-paragraph">Other examples were shared, such as the current police cars. This also presented the opportunity to give us a glimpse of the future police cars (Larry and Elon&#8217;s personal favorites <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;" />). A few key points about these cars: &#8220;<em>They are safe, exceptionally fast, and have stainless steel bodies.</em>&#8220;&#8230; well I would say not a surprise.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="550" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleCar-1024x550.png" alt="" class="wp-image-27943" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleCar-1024x550.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleCar-300x161.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleCar-768x412.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/OracleCar.png 1147w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><em>Oracle/Tesla Police Car presented during the keynote</em></figcaption></figure>



<h2 class="wp-block-heading" id="h-multicloud-microsoft-amp-nri"><strong>MultiCloud: Microsoft &amp; NRI</strong></h2>



<p class="wp-block-paragraph">Last topic that Larry addressed was <a href="https://www.oracle.com/news/announcement/oracle-database-at-azure-2023-09-14/">his visit to Redmond last week</a> where he met with Microsoft&#8217;s CEO, Satya Nadella. During their meeting, they reached a consensus on significant ideas: &#8220;<em>Clouds should be open</em>&#8221; and &#8220;<em>Clouds should be interconnected</em>&#8220;. Many customers currently use multiple cloud services, including AWS, Azure, Google, Salesforce, and Oracle. </p>



<p class="wp-block-paragraph">Customers should find it easy to utilize various cloud services and seamlessly interconnect them, regardless of the provider. The concept revolves around ensuring that all these clouds can effectively interoperate. </p>



<p class="wp-block-paragraph">Both clouds are open and both cloud providers would like to avoid Egress fees on customers data. To the question “<em>Is it a complete Oracle Cloud Inside the Azure Datacenter the response is Yes !</em>&#8220;</p>



<p class="wp-block-paragraph"></p>
<p>L’article <a href="https://www.dbi-services.com/blog/artificial-intelligence/">Larry Ellison &#8211; Oracle&#8217;s Vision for the future</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/artificial-intelligence/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Oracle to the rescue of MGM with SQL Firewall?</title>
		<link>https://www.dbi-services.com/blog/oracle-sql-firewall-with-oracle-23c/</link>
					<comments>https://www.dbi-services.com/blog/oracle-sql-firewall-with-oracle-23c/#comments</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Mon, 18 Sep 2023 04:40:03 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[23c]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=27865</guid>

					<description><![CDATA[<p>Introduction It is true that it&#8217;s a somewhat daring title, and it&#8217;s unlikely that SQL firewall has changed anything about the attack that several casinos in Las Vegas suffered last week. However, the opportunity was too good to pass up on this topic. As I write this blog, Las Vegas casinos are experiencing a series [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-sql-firewall-with-oracle-23c/">Oracle to the rescue of MGM with SQL Firewall?</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-introduction">Introduction</h2>



<p class="wp-block-paragraph">It is true that it&#8217;s a somewhat daring title, and it&#8217;s unlikely that SQL firewall has changed anything about <a href="https://www.reuters.com/business/casino-giant-caesars-confirms-data-breach-2023-09-14/">the attack that several casinos in Las Vegas suffered last week</a>. However, the opportunity was too good to pass up on this topic. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="365" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7-1024x365.jpeg" alt="" class="wp-image-27871" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7-1024x365.jpeg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7-300x107.jpeg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7-768x273.jpeg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7-1536x547.jpeg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/6BE9A03F-58CB-4DD1-91AF-2A67D64C47F7.jpeg 1618w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">As I write this blog, Las Vegas casinos are experiencing a series of cyberattacks. It turns out that at the same time, OracleCloud World is taking place in Las Vegas, and one of its flagship products, the database, offers a new feature in its 23c version called &#8216;SQL firewall.&#8217; So, the opportunity was too good not to write a short blog about this new functionality. I would like to emphasize here that this is only a very brief overview of all the features of DBMS_SQL_FIREWALL. Oracle provides <a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/dbseg/using-sql-firewall.html#GUID-E16DAF38-B4D3-439D-8D01-A8B39AB76C62">extensive documentation</a> on this package/feature, and you will find several blogs on the internet that go beyond the tests below (have a look in my conclusion)</p>



<h2 class="wp-block-heading" id="h-how-does-sql-firewall-work">How does SQL Firewall work?</h2>



<p class="wp-block-paragraph">The principle of the package is very simple and is illustrated through the image below, which has been taken from the Oracle documentation:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="768" height="288" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sql_firewall_flow.png" alt="" class="wp-image-27866" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sql_firewall_flow.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sql_firewall_flow-300x113.png 300w" sizes="auto, (max-width: 768px) 100vw, 768px" /><figcaption class="wp-element-caption"><em>SQL Firewall flow &#8211; Source: <a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/dbseg/using-sql-firewall.html">Oracle documentation</a></em></figcaption></figure>



<ol class="wp-block-list">
<li>First, we capture the standard activity of an application (<em>Capture SQL Activities</em>). Naturally, the capture must run for a sufficient amount of time to cover all specific scenarios. </li>



<li>By examining this activity (<em>Review</em>), we ensure that there is nothing abnormal. </li>



<li>We generate the list (<em>Generate Allow-List</em>) of allowed execution contexts. This list can be modified if necessary by adding or removing specific executions using the following package procedures: DBMS_SQL_FIREWALL.ADD_ALLOWED_CONTEXT, DBMS_SQL_FIREWALL.DELETE_ALLOWED_CONTEXT, and DBMS_SQL_FIREWALL.DELETE_ALLOWED_SQL.</li>



<li>We enable the list (<em>Enable Allow-List</em>).</li>



<li>We monitor (<em>Monitor</em>) the operation using the DBA_SQL_FIREWALL_VIOLATIONS dictionary view.</li>
</ol>



<h2 class="wp-block-heading" id="h-example">Example</h2>



<p class="wp-block-paragraph">For this example I will need two users: </p>



<ul class="wp-block-list">
<li>schema_owner who is the owner of the tables &amp; views of the application</li>



<li>app_user who needs to access to the application</li>
</ul>



<p class="wp-block-paragraph">We could use a specific user to manage database firewall by providing him the sql_firewall_admin role but as stated in my introduction I&#8217;ll keep this example very short and simple. </p>



<h3 class="wp-block-heading" id="h-users-creation">Users creation</h3>



<p class="wp-block-paragraph">Creation of the user schema_owner:</p>



<pre class="wp-block-code"><code>SQL&gt; create user schema_owner identified by schema_owner quota unlimited on users;
grant connect,resource to schema_owner;
grant create session grant any privilege to schema_owner;
User created.
</code></pre>



<p class="wp-block-paragraph">Creation of the user app_user:</p>



<pre class="wp-block-code"><code>SQL&gt; create user app_user identified by app_user;
grant create session to app_user;
grant select any table on schema schema_owner to app_user;
User created.
</code></pre>



<h3 class="wp-block-heading" id="h-objects-creation">Objects creation</h3>



<p class="wp-block-paragraph">Now we will create few objects in our schema_owner schema:</p>



<pre class="wp-block-code"><code>SQL&gt; CREATE TABLE schema_owner.customers
( customer_id number(10) NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50),
credit_card number(16),
CONSTRAINT customers_pk PRIMARY KEY (customer_id)
);
Table created.

SQL&gt; create view schema_owner.non_sensitive_view as select customer_name, city from schema_owner.customers;

View created.</code></pre>



<h3 class="wp-block-heading" id="h-data-insertion">Data insertion</h3>



<p class="wp-block-paragraph">We will now insert data in our table:</p>



<pre class="wp-block-code"><code>SQL&gt; insert into schema_owner.customers values (001,'steulet','Delemont',00001111222233334444);
insert into schema_owner.customers values (002,'errard','Courrendlin',2222333344445555);
insert into schema_owner.customers values (003,'frund','Porrendutry',7777888899990000)
1 row created.</code></pre>



<h3 class="wp-block-heading" id="h-start-the-capture-of-the-statements-capture-sql-activities">Start the capture of the statements (Capture SQL Activities)</h3>



<p class="wp-block-paragraph">Before being able to capture the statements, we have to be sure that SQL Firewall is enabled: </p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<pre class="wp-block-code"><code>SQL&gt; select status
from dba_sql_firewall_status; 
STATUS
------------
DISABLED</code></pre>
</div></div>
</div></div>
</div></div>



<pre class="wp-block-code"><code>SQL&gt; exec dbms_sql_firewall.enable;

PL/SQL procedure successfully completed.</code></pre>



<pre class="wp-block-code"><code>SQL&gt; select status
from dba_sql_firewall_status;
STATUS
------------
Enable</code></pre>



<p class="wp-block-paragraph">We can now start the capure process of the standard context for the user app_user using the below procedure: </p>



<pre class="wp-block-code"><code>SQL&gt; begin
dbms_sql_firewall.create_capture (
username =&gt; 'app_user',
top_level_only =&gt; false,
start_capture =&gt; true);
end;
 
PL/SQL procedure successfully completed.</code></pre>



<h3 class="wp-block-heading" id="h-let-s-run-the-application">Let&#8217;s run the application</h3>



<p class="wp-block-paragraph">We now need to run the application for the necessary duration in order to collect all user context information related to those who will be querying the application. We will greatly simplify this phase by simply performing a select on the view we created earlier. This select will be done in a separate session using the application user login &amp; password: </p>



<pre class="wp-block-code"><code>&#091;oracle@grs-oraclecloudinstance bin]$ ./sqlplus app_user/app_user@free

SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Mon Sep 18 03:16:56 2023
Version 23.2.0.0.0Copyright (c) 1982, 2023, Oracle. All rights reserved.Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL&gt; set linesize 200 pagesize 40
SQL&gt; select * from schema_owner.non_sensitive_view;

CUSTOMER_NAME                                      CITY
-------------------------------------------------- ---------------------------------
steulet                                            Delemont
errard                                             Courrendlin</code></pre>



<h3 class="wp-block-heading" id="h-let-s-stop-the-capture">Let&#8217;s stop the capture</h3>



<p class="wp-block-paragraph">We can admit that the application ran for the necessary duration in order to catch all the contextual information and we stop the capture: </p>



<pre class="wp-block-code"><code>SQL&gt; exec dbms_sql_firewall.stop_capture('app_user');
PL/SQL procedure successfully completed.</code></pre>



<h3 class="wp-block-heading" id="h-let-s-have-a-look-on-what-we-captured-review">Let&#8217;s have a look on what we captured (Review)</h3>



<p class="wp-block-paragraph">When querying dba_sql_fiewall_capture_logs, one can view the logs as demonstrated below: </p>



<pre class="wp-block-code"><code>SQL&gt; column commande_type format a9
column current_user format a10
column client_program format a20
column os_user format a8
column ip_address format a10
column sql_text format a30
select command_type, current_user, client_program, os_user, ip_address, sql_text from dba_sql_firewall_capture_logs where username='APP_USER';

COMMAND_TYPE CURRENT_US CLIENT_PROGRAM       OS_USER  IP_ADDRESS SQL_TEXT
------------ ---------- -------------------- -------- ---------- ------------------------------
SELECT       APP_USER   sqlplus@grs-oraclecl oracle   10.0.0.79  SELECT * FROM SCHEMA_OWNER.NON
                        oudinstance (TNS V1-                     _SENSITIVE_VIEW
                        V3)

SELECT       APP_USER   sqlplus@grs-oraclecl oracle   Local      SELECT DECODE (USER,:"SYS_B_0"
                        oudinstance (TNS V1-                     ,XS_SYS_CONTEXT (:"SYS_B_1",:"
                        V3)                                      SYS_B_2"),USER) FROM SYS.DUAL

SELECT       APP_USER   sqlplus@grs-oraclecl oracle   10.0.0.79  SELECT DECODE (USER,:"SYS_B_0"
                        oudinstance (TNS V1-                     ,XS_SYS_CONTEXT (:"SYS_B_1",:"
                        V3)                                      SYS_B_2"),USER) FROM SYS.DUAL
  
</code></pre>



<p class="wp-block-paragraph">To read the output more easily you will find a screenshot below:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="772" height="215" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/printoutput.png" alt="" class="wp-image-27867" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/printoutput.png 772w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/printoutput-300x84.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/printoutput-768x214.png 768w" sizes="auto, (max-width: 772px) 100vw, 772px" /><figcaption class="wp-element-caption"><em>Output of the SQL command</em></figcaption></figure>



<h3 class="wp-block-heading" id="h-let-s-generate-the-allow-list-generate-allow-list">Let&#8217;s generate the allow list (Generate Allow-List)</h3>



<p class="wp-block-paragraph">Using DBMS_SQL_FIREWALL.GENERATE_ALLOW_LIST we generate the allow_list: </p>



<pre class="wp-block-code"><code>SQL&gt; exec DBMS_SQL_FIREWALL.GENERATE_ALLOW_LIST ('APP_USER');
PL/SQL procedure successfully completed.</code></pre>



<h3 class="wp-block-heading" id="h-let-s-enable-protect-our-database-enable-allow-list">Let&#8217;s enable protect our database (Enable Allow-List)</h3>



<p class="wp-block-paragraph">Using the below procedure we will activate the allow list and block violations:</p>



<pre class="wp-block-code"><code>SQL&gt; begin
dbms_sql_firewall.enable_allow_list (
username =&gt; 'app_user',
enforce =&gt; dbms_sql_firewall.enforce_all,
block =&gt; true);
end;
/ 

PL/SQL procedure successfully completed.</code></pre>



<h3 class="wp-block-heading" id="h-what-about-a-test">What about a test?</h3>



<p class="wp-block-paragraph">Let&#8217;s run a query that hasn&#8217;t been run before. We get a SQL Firewall violation:</p>



<pre class="wp-block-code"><code>&#091;oracle@grs-oraclecloudinstance bin]$ ./sqlplus app_user/app_user@free

SQL&gt; select credit_card from schema_owner.customers;
select credit_card from schema_owner.customers
*
ERROR at line 1:
ORA-47605: SQL Firewall violation</code></pre>



<h3 class="wp-block-heading" id="h-what-can-we-find-in-the-log">What can we find in the log?</h3>



<p class="wp-block-paragraph">Inspecting the log we can have some details regarding the rule violation: </p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<pre class="wp-block-code"><code>SQL&gt; select sql_text,
firewall_action,
ip_address,
cause,
occurred_at
from dba_sql_firewall_violations;</code></pre>



<pre class="wp-block-code"><code>SQL_TEXT                       FIREWAL IP_ADDRESS CAUSE                OCCURRED_AT
------------------------------ ------- ---------- -------------------- -------------
SELECT CREDIT_CARD FROM SCHEMA Blocked 10.0.0.79  SQL violation        18-SEP-23 04.08.54.371122 AM +00:00
_OWNER.CUSTOMERS</code></pre>
</div></div>
</div></div>



<p class="wp-block-paragraph">To read the output more easily you will find a screenshot below:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="903" height="83" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sqlplus.png" alt="" class="wp-image-27868" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sqlplus.png 903w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sqlplus-300x28.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/sqlplus-768x71.png 768w" sizes="auto, (max-width: 903px) 100vw, 903px" /><figcaption class="wp-element-caption"><em>Output of the SQL command</em></figcaption></figure>



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



<p class="wp-block-paragraph">Oracle provides a series of tools to control data access. SQL Firewall is added to the list of these tools, such as DBM_CRYPTO, TDE, Oracle Virtual Private Database, to name just a few. SQL Firewall is used in this blog to block queries, but it can also be configured for query monitoring only. It’s also interesting to note that we can use Oracle Data Pump to export and import SQL Firewall captures and allow-list metadata. Of course on large volume of Data SQL Firewall can have an impact on performance (I didn&#8217;t test it). In such a context Oracle recommends the two below measures: </p>



<ul class="wp-block-list" id="GUID-229866B6-7CE6-4C32-AD7C-B5448FF9F72A__UL_QX1_S12_NWB">
<li>Allocate at least an additional 2G to the&nbsp;<code>LARGE_POOL_SIZE</code>&nbsp;parameter setting, on top of the existing&nbsp;<code>LARGE_POOL_SIZE</code>&nbsp;requirement.</li>



<li>Resize the&nbsp;<code>SGA_TARGET</code>&nbsp;parameter setting to include this additional requirement. Ensure that the final size is 8G or more.</li>
</ul>



<p class="wp-block-paragraph">Among the different blogs that address this topic we can find: </p>



<ul class="wp-block-list">
<li><a href="https://blogs.oracle.com/coretec/post/23c-sql-firewall">23c Oracle Firewall from Rob Watson</a></li>



<li><a href="http://www.petefinnigan.com/weblog/archives/00001517.htm">SQL Firewall Oracle 23c from Pete Finnigan</a></li>



<li><a href="https://oracle-base.com/articles/23c/sql-firewall-23c">SQL Firewall in Oracle Database 23c from Oracle-Base (Tim)</a><br></li>
</ul>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-sql-firewall-with-oracle-23c/">Oracle to the rescue of MGM with SQL Firewall?</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-sql-firewall-with-oracle-23c/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Las Vegas, from sin city to green city?</title>
		<link>https://www.dbi-services.com/blog/las-vegas-from-sin-city-to-green-city/</link>
					<comments>https://www.dbi-services.com/blog/las-vegas-from-sin-city-to-green-city/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Thu, 14 Sep 2023 21:27:04 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=26987</guid>

					<description><![CDATA[<p>Introduction Oracle CloudWorld 2023 will start next week in Las Vegas, and I&#8217;m happy to participate in this worldwide event. As a Swiss citizen, when I think of Las Vegas, the first image that comes to my mind is that of dazzling lights, opulent casinos, and dancing fountains. A city that never sleeps, where excess [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/las-vegas-from-sin-city-to-green-city/">Las Vegas, from sin city to green city?</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-introduction">Introduction</h2>



<p class="wp-block-paragraph">Oracle CloudWorld 2023 will start next week in Las Vegas, and I&#8217;m happy to participate in this worldwide event. As a Swiss citizen, when I think of Las Vegas, the first image that comes to my mind is that of dazzling lights, opulent casinos, and dancing fountains. A city that never sleeps, where excess seems to be the norm. However, behind this glittering facade lies a surprising reality: Las Vegas appears to be a leader in many sustainable initiatives and a model of responsible water management. It&#8217;s perhaps also because of this that a company such as Oracle decided to organize its most famous event in this city.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="405" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival-1024x405.jpg" alt="" class="wp-image-27733" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival-1024x405.jpg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival-300x119.jpg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival-768x304.jpg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival-1536x608.jpg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/WaterFestival.jpg 1619w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">The well-known Bellagio fountains</figcaption></figure>



<h2 class="wp-block-heading" id="h-environmental-savior-or-sinful-excess">Environmental Savior or Sinful Excess?</h2>



<p class="wp-block-paragraph">While it won&#8217;t be my first visit to Sin City, as Las Vegas hosts several events like CES and is a popular destination for those exploring the West Coast on road trips, each visit brings its own unique experiences. On my previous trips to Las Vegas, what truly captivated my attention was how a city nestled in the heart of the desert could orchestrate mesmerizing water spectacles, such as the renowned ones adorning the famous Las Vegas Strip.</p>



<p class="wp-block-paragraph">As a company that has dedicated significant efforts to sustainability initiatives and proudly holds Ecovadis certification, I felt compelled to delve deeper into the question of how this desert city manages its energy, and its precious water resources. To craft this article, I had the privilege of engaging with Jace Radke, the Public &amp; Media Relations Supervisor in Las Vegas as well as Mack Branson, who represents both the Southern Nevada Water Authority (SNWA) and the Las Vegas Valley Water District. I thank them for generously sharing their time and expertise, which greatly enriched the content of this article.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="488" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/MackBranson-1024x488.png" alt="" class="wp-image-27734" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/MackBranson-1024x488.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/MackBranson-300x143.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/MackBranson-768x366.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/MackBranson.png 1379w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Mr. Branson L.Mack &#8211; SNWA | LVVWD Public Outreach</figcaption></figure>



<h2 class="wp-block-heading" id="h-world-class-in-terms-of-sustainability">World-class in terms of sustainability</h2>



<p class="wp-block-paragraph">As stated by Jace Radke, “<em>More than 2.1 million people reside in Southern Nevada and 40 million people from around the world travel to Las Vegas annually. Many know Las Vegas as a world-renowned entertainment and tourist destination, however, very few of them know that Las Vegas is also world-class when it comes to being green and sustainable.”</em> Just to provide few facts and figures that attests the efforts of Las Vegas in terms of sustainability (a more exhaustive list can be found here: <a href="http://www.lasvegasnevada.gov/sustainability">www.lasvegasnevada.gov/sustainability</a>) :</p>



<ul class="wp-block-list">
<li>Certifications such as LEED (Leadership in Energy and Environmental Design) certified. buildings, including Las Vegas City Hall that opened in 2012.</li>



<li>Investment in hundreds of miles of bike lanes.</li>



<li>Completion of more than six megawatts of solar.</li>



<li>Replacement of 42,000 streetlights with LED lighting.</li>



<li>Reduced annual water consumption by 256 million gallons from 2008 level.</li>



<li>Every public building, park and streetlight is served by renewable energy.</li>



<li>Several years ago, the largest rooftop solar array in the country went online at Mandalay Bay, with 26,000 panels covering 28 acres.</li>
</ul>



<p class="wp-block-paragraph">Many other initiatives will be undertaken. For example, the city plans to plant 60&#8217;000 new trees to help mitigate the heat island impacts in the city and lower temperatures. This initiative is part of the city&#8217;s 2050 Master Plan: <a href="https://www.lasvegasnevada.gov/Business/Planning-Zoning/Master-Plan">https://www.lasvegasnevada.gov/Business/Planning-Zoning/Master-Plan</a></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="529" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2-1024x529.jpg" alt="" class="wp-image-27741" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2-1024x529.jpg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2-300x155.jpg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2-768x397.jpg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2-1536x794.jpg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/light-2.jpg 1619w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Las Vegas Strip by night</figcaption></figure>



<p class="wp-block-paragraph">These measures have been awarded. In 2014, the city was honored with the US Conference of Mayors&#8217; Climate Protection Award in Dallas. Such initiatives also led to a reduction in annual energy costs, decreasing from a peak total of $15 million in 2008 to less than $10 million per year.</p>



<p class="wp-block-paragraph">However, despite these initiatives, Jace Radke remains aware of the ongoing challenges that pose a threat to community well-being: &#8220;<em>Many communities, like Las Vegas, are facing issues more heat waves, flooding, or drought – an issue they face together with cities across the Southwest. Of course, water is clearly a big part of our story&#8221;.</em></p>



<p class="wp-block-paragraph">While everything may not be perfect in Vegas in terms of sustainability, there is still room for improvement. However, when we examine the 2050 Master Plan, it becomes evident that the authorities are well aware of this potential for enhancement.</p>



<h2 class="wp-block-heading" id="h-water-savings-of-48-425-olympic-size-swimming-pools"><strong>Water savings of 48&#8217;425 Olympic-size swimming pools</strong></h2>



<p class="wp-block-paragraph">Before delving into water management, it&#8217;s crucial to establish a rough idea of the proportions we are discussing. As mentioned by Jace Radke and confirmed by Mack Branson, <em>“while many look at Las Vegas’s growth and water use at casinos, golf courses and fountains as the cause of declining water levels in Lake Mead, the fact is that Las Vegas uses less than 4% of Colorado River water. Additionally, it’s important to mention that the resort industry only uses 3% of all water used in Las Vegas.</em>”. <br><br>To maintain the focus on proportions, consider that the Southern Nevada region receives 100 millimeters of precipitation per year, while a country like Switzerland receives between 1000 to 1500 millimeters of precipitation per year (according to meteosuisse.admin.ch). Naturally, these conditions have prompted the Southern Nevada Water Authority to implement certain restrictions, such as:</p>



<ul class="wp-block-list">
<li>Replacing useless grass</li>



<li>Limiting water gardens</li>



<li>Prohibiting installation of new gras</li>



<li>Limiting residential pool sizes</li>



<li>Moratorium on evaporative cooling</li>



<li>Annual water budgeting for Golf courses</li>
</ul>



<p class="wp-block-paragraph">As explained by Mack Branson, some strong measures will be enforced: &#8220;<em>by the end of 2026, it will be illegal to irrigate grass which is considered decorative grass. This measure is due to the fact that grass needs approximately 3000 liters of water per square meters (73 Gallon per square foot). The reason of this measure is very simple, water that we use outdoor can be used only one time which is not the case of water used indoor because we can recycle it.</em>&#8220;</p>



<p class="wp-block-paragraph">Due to all these measures, Southern Nevada Authorities estimates that: <em>the Southern Nevada’s consumptive water use declined by approximately 32 billion gallons (121.25 trillion liters</em>) <em>between 2002 and 2022, despite the influx of approximately 750,000 new residents and nearly 40 million annual visitors during that span</em>. (Conservation fact sheet – Comprehensive 2023.pdf edited by Southern Nevada Water Authority) which represents approximately 48’425 Olympic size swimming pools.</p>



<h2 class="wp-block-heading" id="h-lake-mead-a-challenge-that-goes-beyond-the-borders-of-las-vegas"><strong>Lake Mead, a challenge that goes beyond the borders of Las Vegas</strong></h2>



<p class="wp-block-paragraph">As we all witnessed in recent years, the water level of Lake Mead significantly declined. Fortunately, the water level has rebounded in the past months. Nevertheless, to confront the challenge of declining mean water levels, it&#8217;s important to take into consideration that Las Vegas uses only 4% of the Colorado River water. Therefore, additional efforts are required beyond Las Vegas and Nevada. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="414" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake-1024x414.jpg" alt="" class="wp-image-27737" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake-1024x414.jpg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake-300x121.jpg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake-768x311.jpg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake-1536x621.jpg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/meadlake.jpg 1615w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Lake Mead and its dam</figcaption></figure>



<p class="wp-block-paragraph">As mentioned by Mack Branson “<em>Our community recycles and returns nearly every drop of indoor water use back to Lake Mead, which provides 90 percent of Southern Nevada water supply. Every liter returned allows us to tank another out of the lake, treat it to drinking water standards, and deliver it to the community. We are the only community in the U.S. that we know of that recycles all of its indoor water use.”</em></p>



<p class="wp-block-paragraph">However, Mack Branson is aware that the challenges related to Lake Mead do not stop at the borders of Las Vegas.: <em>“It&#8217;s going to require every sector in every state that uses Colorado River water to use less. The largest water user of the Colorado River by sector is agriculture, which is beneficial to us in our nation&#8217;s food supply. However, a significant portion of that agricultural water use still employs inefficient irrigation techniques and produces a lot of feed for cattle (alfalfa). It appears that alfalfa has become one of the dominant water users in the agricultural sector. While it&#8217;s essential to support the dairy industry, we also observe a substantial portion of this alfalfa being exported out of the United States. Thus, we are effectively exporting Colorado River water out of the United States.</em></p>



<h2 class="wp-block-heading" id="h-intake-3-a-drought-insurance">Intake 3, a drought insurance</h2>



<p class="wp-block-paragraph">In response to unprecedented drought conditions and for the long-term preservation of Southern Nevada&#8217;s primary water storage reservoir, Lake Mead, the Southern Nevada Water Authority built a third drinking water intake system (intake 3) capable of extracting Colorado River water when the lake&#8217;s elevation is below 1,000 feet (~304 meters) above sea level. </p>



<p class="wp-block-paragraph">In 2008, construction of the intake 3 commenced, involving the use of a 24-foot (~7,3 meters) diameter tunnel boring machine to excavate a tunnel beneath Lake Mead. This tunnel was subsequently connected to an intake structure anchored to the lakebed with over 1,000 truckloads of concrete.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="447" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/Intake3-1-1024x447.jpg" alt="" class="wp-image-27736" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/Intake3-1-1024x447.jpg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/Intake3-1-300x131.jpg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/Intake3-1-768x335.jpg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2023/09/Intake3-1.jpg 1385w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Intake 3 of Lake Mead &#8211; source Courtesy Southern Nevada Water Authority</figcaption></figure>



<p class="wp-block-paragraph">Currently, Lake Mead stands at a height of 1,066 feet (325 meters), as indicated by: <a href="https://mead.uslakes.info/level.asp">https://mead.uslakes.info/level.asp</a>. This means it is below the level of Intake Number 1. Consequently, Pumping Stations Number 2 and Number 3 are in operation. In a few months, when the Lake Mead elevation rises above Intake Number 1, Pumping Station 3 will be deactivated to conserve energy. This decision is driven by the greater energy consumption of Pumping Station Number 3, attributable to the depth of Intake Number 3.</p>



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



<p class="wp-block-paragraph">The challenges encountered by Las Vegas, and more globally South-West, are challenges that will impact other regions around the world in the future. Behavior adaptations such as the replacement of grass, water recycling techniques, strategies to reduce water evaporation, and environmental certifications for hotels are all practices that are expected to become more widespread in the coming years. </p>



<p class="wp-block-paragraph">Undoubtedly, Las Vegas is a city with high energy demands, and there is still much work to be done. However, over the past several years, awareness has been steadily increasing, giving rise to promising ideas and a genuine commitment to making meaningful improvements.</p>



<p class="wp-block-paragraph">Climate change is affecting all of us. We need to adapt to build resilience. Climate change in the Southwestern United States will result in a warmer and drier future and if we do not admit that degrowth can be a solution, people will have to be innovative to face these challenges. </p>
<p>L’article <a href="https://www.dbi-services.com/blog/las-vegas-from-sin-city-to-green-city/">Las Vegas, from sin city to green city?</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/las-vegas-from-sin-city-to-green-city/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL Server on Microsoft Azure 3rd part (backup and recovery)</title>
		<link>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-3rd-part-backup-and-recovery/</link>
					<comments>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-3rd-part-backup-and-recovery/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Mon, 22 Aug 2022 11:48:33 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Azure backup]]></category>
		<category><![CDATA[PITR]]></category>
		<category><![CDATA[Recovery process]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=18514</guid>

					<description><![CDATA[<p>Presentation of the Backup Recovery solution provided by Microsoft Azure for Azure Database for MySQL Server</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-3rd-part-backup-and-recovery/">MySQL Server on Microsoft Azure 3rd part (backup and recovery)</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="293" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-1024x293.png" alt="" class="wp-image-18471" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-1024x293.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-300x86.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-768x220.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2.png 1345w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Azure Database for MySQL</figcaption></figure>



<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This blog is the third chapter related to deploying a MySQL infrastructure on the Azure cloud. In <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-2nd-part-performance-tests/">addition to performance</a>,  we should indeed also consider backup and restore capabilities. The objective of this blog is to present the main backup and restore possibilities offered by Azure through a simple example and show a second backup/restore possibility using MySQL Shell dump utilities. </p>



<h2 class="wp-block-heading">Backup window and mechanism</h2>



<p class="wp-block-paragraph">Flexible Azure for MySQL generates by default a 7 days server backup retention period. This retention period can be extended up to 35 days or shorten to 1 day. In addition we can decide if you want to have a Geo Redundant backup storage. By default the backups are locally redundant. </p>



<p class="wp-block-paragraph">It’s important to understand that Azure makes backup of the whole server, not only the MySQL Server through mysqldump, MySQL Enterprise Backup or any other solution. These backups can only be used to restore MySQL Server in another Azure Database for MySQL Server. It means that these backups cannot be exported to generate a new database on our on-premise server for instance. If we want to extract part of our database in order to export data, we can use <a href="https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html" target="_blank" rel="noreferrer noopener">mysqldump</a>, <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-dump-instance-schema.html" target="_blank" rel="noreferrer noopener">MySQL Shell&#8217;s instance dump utility</a> or the set of tools provided by <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-dump-instance-schema.html" target="_blank" rel="noreferrer noopener">MySQL Shell.</a></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="725" height="182" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-031.png" alt="" class="wp-image-18515" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-031.png 725w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-031-300x75.png 300w" sizes="auto, (max-width: 725px) 100vw, 725px" /><figcaption class="wp-element-caption">Backup Retention period configuration and Redundancy options</figcaption></figure>



<p class="wp-block-paragraph">The backups provided by Azure can be used to make Point In Time Recovery of the Server with a granularity of 5 minutes since the system snapshots are done automatically every 5 minutes. As specified in the documentation, the backups are encrypted using AES 256-bit. </p>



<h3 class="wp-block-heading">Backup and restore costs</h3>



<p class="wp-block-paragraph">As explained on Microsoft website</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong><em>&#8220;Backup storage is the storage associated with automated backups of your server.&nbsp;</em><strong>Increasing your backup retention period increases the backup storage that is consumed by your server</strong><em>. There is no additional charge for backup storage for up to 100% of your total provisioned server storage. Additional consumption of backup storage will be charged in GB/month.&#8221;</em></strong>  &#8211; https://azure.microsoft.com/en-us/pricing/details/mysql/flexible-server/</p>
</blockquote>



<p class="wp-block-paragraph">Increasing the retention of the backup, may have an impact on the pricing. We can have an idea of the global costs related to Azure Database for MySQL on the following URL: <a href="https://azure.microsoft.com/en-us/pricing/details/mysql/flexible-server/" target="_blank" rel="noreferrer noopener">https://azure.microsoft.com/en-us/pricing/details/mysql/flexible-server/</a></p>



<h2 class="wp-block-heading">Recover a database from Azure Backup Restore interface</h2>



<p class="wp-block-paragraph">In this first test, we will simply use the recovery functionalities provided by Azure Database for MySQL flexible server. We will simulate a user error by deleting a table and we will restore the entire server (as it&#8217;s not possible to simply recover a database or a table using Azure features). </p>



<ol class="wp-block-list">
<li><strong>Dropping a table by mistake</strong></li>
</ol>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl  SQL &gt; SELECT CURRENT_TIMESTAMP ;
+---------------------+
| CURRENT_TIMESTAMP   |
+---------------------+
| 2022-08-18 20:48:44 |
+---------------------+
1 row in set (0.1002 sec)
 MySQL  albatroz.mysql.database.azure.com:3306 ssl  SQL &gt; drop table sysbench.sbtest1;
Query OK, 0 rows affected (0.1884 sec)</code></pre>



<ol class="wp-block-list" start="2">
<li><strong>Restoring the MySQL Server to a time before the mistake</strong></li>
</ol>



<p class="wp-block-paragraph">We first have to go in the &#8220;backup/restore&#8221; menu of our Azure Database for MySQL flexible server and select the backupset that we want to restore. As we can see a backupset is done everyday. In our current context, we want to use the most recent backupset (Automated backup #5)</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="914" height="226" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-032.png" alt="" class="wp-image-18597" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-032.png 914w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-032-300x74.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-032-768x190.png 768w" sizes="auto, (max-width: 914px) 100vw, 914px" /><figcaption class="wp-element-caption">Azure Database for MySQL flexible server backupset</figcaption></figure>



<p class="wp-block-paragraph">Once the backupset selected a screen appears showing the restore server options. It provides us with the possibility to make a Point In Time Restore (PITR) of our server by choosing between 3 options: </p>



<ul class="wp-block-list">
<li><em>Latest restore point (Now)</em></li>



<li><em>Select a custom restore point</em></li>



<li><em>Select fastest restore point (Restore using full backup)</em></li>
</ul>



<p class="wp-block-paragraph">In our case we will use the &#8220;<em>Select a Custom Restore point</em>&#8221; option as shown in the screenshot below. We will define the custom restore time just before the mistake and specify a name for the restored Server. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="743" height="523" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-033.png" alt="" class="wp-image-18598" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-033.png 743w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-033-300x211.png 300w" sizes="auto, (max-width: 743px) 100vw, 743px" /><figcaption class="wp-element-caption">Restore of a Server using a custom restore point</figcaption></figure>



<p class="wp-block-paragraph">Once the restore requested, it took approximately 5 minutes to deploy the new server. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="840" height="301" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-034.png" alt="" class="wp-image-18600" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-034.png 840w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-034-300x108.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-034-768x275.png 768w" sizes="auto, (max-width: 840px) 100vw, 840px" /></figure>



<ol class="wp-block-list" start="3">
<li><strong>Let&#8217;s check if my table is back on the new deployed server</strong></li>
</ol>



<p class="wp-block-paragraph">Finally we simply have to connect to the new restored server and check if the dropped table is back. Of course we can also export this table from this restored server and import this same table on the original server using mysqldump. </p>



<pre class="wp-block-code"><code> MySQL  albatrozrestored.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; show tables from sysbench like '%1';
+-------------------------+
| Tables_in_sysbench (%1) |
+-------------------------+
| sbtest1                 |
+-------------------------+
1 row in set (0.1048 sec)</code></pre>



<p class="wp-block-paragraph"><strong>4. Export/Import table from the restored Server</strong></p>



<p class="wp-block-paragraph">Now that the server is restored, we can export the table that was deleted by mistake using <code><em>util.dumpTables()</em></code> and import it to the albatroz server using <code><em>util.loadDump()</em></code>. The process is rather simple as you can see below:</p>



<p class="wp-block-paragraph"><strong>Export from the recovered server</strong> <strong>(albatrozrestored)</strong></p>



<pre class="wp-block-code"><code>MySQL  albatrozrestored.mysql.database.azure.com:3306 ssl  sysbench  JS &gt; util.dumpTables("sysbench", &#091; "sbtest1"], "C:/Users/grs/Albatroz-Sysbench-sbtest1");
NOTE: Backup lock is not available to the account 'grs'@'%' and DDL changes will not be blocked. The dump may fail with an error if schema changes are made while dumping.
Acquiring global read lock
Global read lock acquired
Initializing - done
...
...
109% (15.29K rows / ~13.98K rows), 0.00 rows/s, 0.00 B/s uncompressed, 0.00 B/s compressed
Dump duration: 00:00:01s
Total duration: 00:00:06s
Schemas dumped: 1
Tables dumped: 1
Uncompressed data size: 2.93 MB
Compressed data size: 1.33 MB
Compression ratio: 2.2
Rows written: 15294
Bytes written: 1.33 MB
Average uncompressed throughput: 2.35 MB/s
Average compressed throughput: 1.07 MB/s</code></pre>



<p class="wp-block-paragraph"><strong>Import on Albatroz server</strong></p>



<pre class="wp-block-code"><code>MySQL  albatroz.mysql.database.azure.com:3306 ssl  JS &gt; util.loadDump("C:/Users/grs/Albatroz-Sysbench-sbtest1", {schema: "sysbench"});
Loading DDL and Data from 'C:/Users/grs/Albatroz-Sysbench-sbtest1' using 4 threads.
Opening dump...
Target is MySQL 8.0.28. Dump was produced from MySQL 8.0.28
Scanning metadata - done
Checking for pre-existing objects...
Executing common preamble SQL
Executing DDL - done
Executing view DDL - done
Starting data load
1 thds loading | 100% (2.93 MB / 2.93 MB), 1.94 MB/s, 0 / 1 tables done
Executing common postamble SQL
Recreating indexes - done
1 chunks (15.29K rows, 2.93 MB) for 1 tables in 1 schemas were loaded in 6 sec (avg throughput 1.94 MB/s)
0 warnings were reported during the load.</code></pre>



<h2 class="wp-block-heading"><strong>Recover a database from your own backup</strong>s</h2>



<p class="wp-block-paragraph">As stated in the introduction, I will present in this chapter a complementary solution of backup/restore. Of course Azure does not prevent us from doing our own backups by connecting to the Azure Database for MySQL flexible server and using either mysqdump, MySQL Enterprise Backup or any other MySQL backup solution. I decided to use the opportunity of this blog to use the backup tools provided by MySQL Shell. Indeed MySQL Shell&#8217;s instance dump utility, such as <code><em>util.dumpInstance()</em></code>, <code><em>util.dumpSchemas()</em></code> or even <code><em>util.dumpTables()</em></code>, introduced in MySQL Shell 8.0.22, provide interesting functionalities. This export tools alone would deserve several blogs dedicated to them. </p>



<p class="wp-block-paragraph">Before starting let&#8217;s illustrate what will be demonstrated in the next few lines:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="331" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-035-1024x331.png" alt="" class="wp-image-18633" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-035-1024x331.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-035-300x97.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-035-768x249.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-035.png 1168w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Recovering a MySQL table after a human error</figcaption></figure>



<ol class="wp-block-list">
<li>The very first step consist in doing a dump of the MySQL Instance</li>



<li>Secondly, we will insert a row in a table named sbtest1</li>



<li>Thirdly, we will simulate a human error and drop a table</li>



<li>Then we will restore the database to the state after the backup</li>



<li>After having restored the backup, we will execute the binary to the state just before the human error</li>



<li>Finally we will check that the last insert I did is stored into the sbtest2 </li>
</ol>



<p class="wp-block-paragraph"><br></p>



<ol class="wp-block-list" start="1">
<li><strong>Dump of MySQL Instance using util.dumpInstance()</strong></li>
</ol>



<p class="wp-block-paragraph">As explained above, the very first step consist in doing a dump of the entire instance. Without this backup we won&#8217;t be able to restore the database. We will use <code><em>util.dumpInstance()</em></code> as presented below:</p>



<pre class="wp-block-code"><code>MySQL  albatroz.mysql.database.azure.com:3306 ssl  JS &gt; util.dumpInstance("C:/Users/grs/AlbatrozDump", {dryRun: false, showProgress: true, threads: 2})
NOTE: Backup lock is not available to the account 'grs'@'%' and DDL changes will not be blocked. The dump may fail with an error if schema changes are made while dumping.
Acquiring global read lock
Global read lock acquired
Initializing - done
2 out of 6 schemas will be dumped and within them 9 tables, 0 views.
4 out of 7 users will be dumped.
...
...
107% (137.28K rows / ~128.10K rows), 14.42K rows/s, 2.61 MB/s uncompressed, 1.20 MB/s compressed
Dump duration: 00:00:15s
Total duration: 00:00:21s
Schemas dumped: 2
Tables dumped: 9
Uncompressed data size: 26.26 MB
Compressed data size: 11.97 MB
Compression ratio: 2.2
Rows written: 137284
Bytes written: 11.97 MB
Average uncompressed throughput: 1.72 MB/s
Average compressed throughput: 784.25 KB/s</code></pre>



<ol class="wp-block-list" start="2">
<li><strong>Inserting row in our table</strong></li>
</ol>



<p class="wp-block-paragraph">Now we simulate some activity in the database by inserting a row into the table <em>sbtest1</em>. </p>



<pre class="wp-block-code"><code>MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; insert into sbtest1 values(999999999,1,1,"my row before drop table");
Query OK, 1 row affected (0.1134 sec)
MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; SELECT CURRENT_TIMESTAMP ;
+---------------------+
| CURRENT_TIMESTAMP   |
+---------------------+
| 2022-08-19 16:42:12 |
+---------------------+</code></pre>



<ol class="wp-block-list" start="3">
<li><strong>Dropping a table by mistake</strong></li>
</ol>



<p class="wp-block-paragraph">Thirdly, we simulate the human error by dropping the table <em>sbtest1</em>. </p>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; SELECT CURRENT_TIMESTAMP ;
+---------------------+
| CURRENT_TIMESTAMP   |
+---------------------+
| 2022-08-19 16:46:47 |
+---------------------+
1 row in set (0.1095 sec)
 MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; drop table sysbench.sbtest1;
Query OK, 0 rows affected (0.1823 sec)</code></pre>



<ol class="wp-block-list" start="4">
<li><strong>Restoring the MySQL Server using the backup </strong></li>
</ol>



<p class="wp-block-paragraph">Now, we have to restore the database using the last backup we have. We will use <em><code><em>util.loadDump()</em></code></em> in order to restore our table. To only recover the table we can simply use the option &#8220;<em>includeTables</em>&#8220;. </p>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  JS &gt; util.loadDump("C:/Users/grs/AlbatrozDump", { includeTables: &#091;"sysbench.sbtest1"],loadDdl:true, LoadData:true, threads: 2})
Loading DDL and Data from 'C:/Users/grs/AlbatrozDump' using 2 threads.
Opening dump...
Target is MySQL 8.0.28. Dump was produced from MySQL 8.0.28
Scanning metadata - done
Checking for pre-existing objects...
Executing common preamble SQL
Executing DDL - done
Executing view DDL - done
Starting data load
1 thds loading \ 100% (2.93 MB / 2.93 MB), 1.16 MB/s, 0 / 1 tables done
Executing common postamble SQL
Recreating indexes - done
1 chunks (15.29K rows, 2.93 MB) for 1 tables in 1 schemas were loaded in 9 sec (avg throughput 1.16 MB/s)
0 warnings were reported during the load.</code></pre>



<p class="wp-block-paragraph">If the restore worked properly, the table <em>sbtest1</em> should be restored. We now have recovered the table <em>sbtest1</em> without the queries that have been executed afterwards (before the drop table).  </p>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; show tables;
+--------------------+
| Tables_in_sysbench |
+--------------------+
| sbtest1            |
| sbtest10           |
| sbtest2            |
| sbtest3            |
| sbtest4            |
| sbtest5            |
| sbtest6            |
| sbtest7            |
| sbtest8            |
| sbtest9            |
+--------------------+
10 rows in set (0.1169 sec)

MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; select * from sbtest1 where pad like 'my%';
Empty set (0.1284 sec)</code></pre>



<ol class="wp-block-list" start="5">
<li><strong>Execution of the binary logs</strong></li>
</ol>



<p class="wp-block-paragraph">Before executing the binary logs, we need to define what we call the &#8220;<em>start-position</em>&#8221; and the &#8220;<em>end-position</em>&#8220;. In order to find these two numbers, we have to find the log position after the backup and to find the log position of the &#8220;drop table&#8221;. The first (<em>start-position</em>) can be found into the metadata of the dump ( .json file). For the second we have to find the exact position using mysqlbinlog as demonstrated below (drop position at 14329648) </p>



<pre class="wp-block-code"><code>mysqlbinlog --verify-binlog-checksum --host=albatroz.mysql.database.azure.com --port=3306 --user=grs -p -                                                   -read-from-remote-server --verbose --start-datetime="2022-08-19 18:40:40" --stop-datetime="2022-08-19 18:50:47" mysql-bin.00                                                   0006 | grep -C 15 "DROP TABLE"

# at 14329648
#220819 18:47:12 server id 3691359094  end_log_pos 14329725 CRC32 0xa81066cf    Anonymous_GTID  last_committed=6652     sequence_number=6653r                                  br_only=no      original_committed_timestamp=1660927632152016   immediate_commit_timestamp=1660927632152016     transaction_length=217
# original_commit_timestamp=1660927632152016 (2022-08-19 18:47:12.152016 CEST)
# immediate_commit_timestamp=1660927632152016 (2022-08-19 18:47:12.152016 CEST)
/*!80001 SET @@session.original_commit_timestamp=1660927632152016*//*!*/;
/*!80014 SET @@session.original_server_version=80028*//*!*/;
/*!80014 SET @@session.immediate_server_version=80028*//*!*/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 14329725
#220819 18:47:12 server id 3691359094  end_log_pos 14329865 CRC32 0x9f7865b0    Query   thread_id=480   exec_time=0     error_code=0    Xid =                                   412469
use `sysbench`/*!*/;
SET TIMESTAMP=1660927632/*!*/;
DROP TABLE `sbtest1` /* generated by server */
/*!*/;

</code></pre>



<p class="wp-block-paragraph">Now that we have the start and end position of the binary log, we can apply the events in binary log file to the server. For my part, I prefer to go through an intermediate step consisting in creating a file containing all the events. This way I can look at what is inside and then just run my file. This allows me, for example, to see if I have made an error. As shown below I&#8217;m for instance able to show my &#8220;<em>insert</em>&#8221; statement: </p>



<pre class="wp-block-code"><code>osboxes@osboxes:~$  mysqlbinlog --verify-binlog-checksum --host=albatroz.mysql.database.azure.com --port=3306 --user=grs -p --read-from-remote-server --start-datetime="2022-08-19 16:40:40" --stop-datetime="2022-08-19 16:46:47" mysql-bin.000006 &gt;/tmp/restore.sql
Enter password:
osboxes@osboxes:~$ vi /tmp/restore.sql
...
# at 14329545
#220819 18:41:18 server id 3691359094  end_log_pos 14329617 CRC32 0xd124e6a0    Write_rows: table id 913 flags: STMT_END_F

BINLOG '
Lr3/YhN2qwXcRQAAAMmm2gAAAJEDAAAAAAEACHN5c2JlbmNoAAdzYnRlc3QxAAQDA/7+BO7g/vAA
AQEAAgP8/wDqexN/
Lr3/Yh52qwXcSAAAABGn2gAAAJEDAAAAAAEAAgAE/wD/yZo7AQAAAAEAMRhteSByb3cgYmVmb3Jl
IGRyb3AgdGFibGWg5iTR
'/*!*/;
### INSERT INTO `sysbench`.`sbtest1`
### SET
###   @1=999999999
###   @2=1
###   @3='1'
###   @4='my row before drop table'
# at 14329617
...</code></pre>



<p class="wp-block-paragraph">Finally we can execute our restore script on the database.</p>



<pre class="wp-block-code"><code>osboxes@osboxes:~$ mysql --host=albatroz.mysql.database.azure.com --port=3306 --user=grs -p &lt;/tmp/restore.sql
Enter password:</code></pre>



<ol class="wp-block-list" start="6">
<li><strong>Let&#8217;s check that our last insert has been executed</strong></li>
</ol>



<p class="wp-block-paragraph">As we can see, the last record we inserted in the table is now present.</p>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl  sysbench  SQL &gt; select * from sbtest1 where pad like 'my%';
+-----------+---+---+--------------------------+
| id        | k | c | pad                      |
+-----------+---+---+--------------------------+
| 999999999 | 1 | 1 | my row before drop table |
+-----------+---+---+--------------------------+</code></pre>



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



<p class="wp-block-paragraph">Azure Backup Restore interface provides an easy and interesting solution to backup and restore a MySQL Server going through the replication of the server. In addition in the tests I did, the deployment of the new server was rather fast. However, my server did not contain gigabytes of information. The 35 days of backup window could be seen as too small depending on your needs. </p>



<p class="wp-block-paragraph">Beside of this solution I strongly encourage Database Administrators to keep on backing up their MySQL Database using other tools such as the ones provided by MySQL Shell or any other backup solution in order to ensure that no transactions are lost when restoring data. Such solutions could offer more flexibility in the backup and restore process and longer retention.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-3rd-part-backup-and-recovery/">MySQL Server on Microsoft Azure 3rd part (backup and recovery)</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/mysql-server-on-microsoft-azure-3rd-part-backup-and-recovery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL Server on Microsoft Azure 2nd part (Performance tests)</title>
		<link>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-2nd-part-performance-tests/</link>
					<comments>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-2nd-part-performance-tests/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Wed, 17 Aug 2022 06:00:58 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[MySQL]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=18470</guid>

					<description><![CDATA[<p>Introduction This second blog follows the first blog about deploying MySQL Server on Microsoft Azure. In the first blog, we saw how easy it is to deploy a MySQL server in minutes on the Azure cloud and we connected on it through the MySQL Shell client. This second blog is more focused on the performance [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-2nd-part-performance-tests/">MySQL Server on Microsoft Azure 2nd part (Performance tests)</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="293" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-1024x293.png" alt="" class="wp-image-18471" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-1024x293.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-300x86.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2-768x220.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-2.png 1345w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Azure Database for MySQL</figcaption></figure>



<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This second blog follows the first blog about <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-1st-part-deployment" target="_blank" rel="noreferrer noopener">deploying MySQL Server on Microsoft Azure</a>. In the first blog, we saw how easy it is to deploy a MySQL server in minutes on the Azure cloud and we connected on it through the MySQL Shell client.</p>



<p class="wp-block-paragraph"><br>This second blog is more focused on the performance of MySQL in the Azure Cloud. Although I didn&#8217;t do any tuning of MySQL parameters, we will see the influence of MySQL Server localization on the latency as well as changes in parameters such as CPU, memory or IOPS on performances using the SysBench tool.</p>



<h2 class="wp-block-heading">SysBench stress test</h2>



<p class="wp-block-paragraph">Of course there are many tools available to do stress tests. On my side, I decided to use SysBench simply because I know this wonderful free tool and because it is widely deployed. Rather than making a description of SysBench, I simply take a part of its description available on sourceforge that we can find below: </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><em>sysbench is a scriptable multi-threaded benchmark tool based on LuaJIT. It is most frequently used for database benchmarks, but can also be used to create arbitrarily complex workloads that do not involve a database server </em>&#8211; <a href="https://sourceforge.net/projects/sysbench.mirror/" target="_blank" rel="noreferrer noopener">https://sourceforge.net/projects/sysbench.mirror/</a>, 14.08.2022</p></blockquote>



<p class="wp-block-paragraph">Firstly I installed SysBench on my local Ubuntu client (osboxes). After the installation of SysBench but before starting the stress test, we first have to prepare the tables containing the records where the queries will be performed. In the following tests I created 10 tables with 1&#8217;000&#8217;000 rows in sysbench database (previously created). </p>



<pre class="wp-block-code"><code>osboxes@osboxes:/usr/bin$ sysbench --db-driver=mysql table-size=1000000 --mysql-host=albatroz.mysql.database.azure.com --mysql-port=3306 --mysql-db=sysbench --mysql-user=grs --tables=10 --mysql-password=MyPassword --test=/usr/share/sysbench/oltp_read_write.lua prepare</code></pre>



<p class="wp-block-paragraph">Once the tables populated, we can run the tests. For the tests, I decided to use oltp_read_write.lua which has a default ratio of read:write 95%:5%.</p>



<pre class="wp-block-code"><code>sysbench --db-driver=mysql  --num-threads=8 --mysql-user=grs --mysql-password=MyPassword --mysql-db=sysbench --events=0 --time=100  --test=/usr/share/sysbench/oltp_read_write.lua --mysql-host=albatroz.mysql.database.azure.com --mysql-port=3306 --tables=10 --db-ps-mode=disable --table-size=1000000 --report-interval=10 run</code></pre>



<p class="wp-block-paragraph"> I varied the number of threads (num-threads parameter) from 8 to 256, limited the time to 100 seconds and changed two kinds of parameters through the Azure interface during my tests: </p>



<ul class="wp-block-list"><li>The Server location (East US, vs West Switzerland)</li><li>The Compute and Storage (Compute Tier and IOPS)</li></ul>



<p class="wp-block-paragraph">It&#8217;s important to note that my Client is  also located in Western Switzerland to understand the impact of location. You can find below the four configurations I did: </p>



<ol class="wp-block-list"><li>Server located in <strong><mark class="has-inline-color has-vivid-cyan-blue-color">US</mark></strong>, with minimal compute and storage meaning <mark class="has-inline-color has-vivid-purple-color"><strong>1vCore 2Gib Memory and 360 IOPS</strong></mark></li><li>Server located in <strong><mark class="has-inline-color has-vivid-cyan-blue-color">US</mark></strong>, with general purpose configuration meaning <mark class="has-inline-color has-vivid-green-cyan-color"><strong>2vCores, 8Gib Memory and  3200 IOPS</strong></mark></li><li>Server located in <mark class="has-inline-color has-luminous-vivid-orange-color"><strong>West Switzerland</strong>,</mark> with minimal compute and storage meaning <mark class="has-inline-color has-vivid-purple-color"><strong>1vCore 2Gib Memory and 360 IOPS</strong></mark></li><li>Server located in <mark class="has-inline-color has-luminous-vivid-orange-color"><strong>West Switzerland</strong></mark>, with general purpose configuration meaning <mark class="has-inline-color has-vivid-green-cyan-color"><strong>2vCores, 8Gib Memory and  3200 IOPS</strong></mark></li></ol>



<h2 class="wp-block-heading">Server details</h2>



<p class="wp-block-paragraph">As it&#8217;s not possible to change the location of a server afterwards, I created two MySQL servers in same version (version 8.0.28). One located in East US and the other located in West Switzerland. Note that we have two locations in Switzerland (North Switzerland and West Switzerland). As explained above, in order to make comparisons, I provided the same set of resources for tests 1 and 3 and test 2 and 4. Also as specified before, my client is located in Switzerland.</p>



<p class="wp-block-paragraph">The basic configuration looks like the one below: </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="632" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-009-1-1024x632.png" alt="" class="wp-image-18474" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-009-1-1024x632.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-009-1-300x185.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-009-1-768x474.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-009-1.png 1292w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Basic configuration</figcaption></figure>
</div>


<p class="wp-block-paragraph">It is worth mentioning that to upgrade the server&#8217;s capacity (from Burstable to General Purpose with more IOPS), it only takes about ten minutes maximum. Meaning that when we end with the tests and we want to go to production, we only need few minutes to upgrade the server properties. We can find the description of the upgraded server below as well as the monthly price of this upgraded server. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="648" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-010-1024x648.png" alt="" class="wp-image-18473" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-010-1024x648.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-010-300x190.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-010-768x486.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-010.png 1262w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>General Purpose configuration</figcaption></figure>
</div>


<h2 class="wp-block-heading">Let&#8217;s run the tests</h2>



<p class="wp-block-paragraph">I executed the same tests with only a variation in the number of thread (from 8 to 256) on each four configurations. We can find an extract of the execution as well as the output below</p>



<pre class="wp-block-code"><code>osboxes@osboxes:/usr/bin$ sysbench --db-driver=mysql  --num-threads=8 --mysql-user=grs --mysql-password=MyPassword --mysql-db=sysbench --events=0 --time=100  --test=/usr/share/sysbench/oltp_read_write.lua --mysql-host=albatroz.mysql.database.azure.com --mysql-port=3306 --tables=10 --db-ps-mode=disable --table-size=1000000 --report-interval=10 run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --num-threads is deprecated, use --threads instead
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 8
Report intermediate results every 10 second(s)
Initializing random number generator from current time


Initializing worker threads...

Threads started!

&#091; 10s ] thds: 8 tps: 3.20 qps: 77.58 (r/w/o: 55.98/4.40/17.20) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00
&#091; 20s ] thds: 8 tps: 4.00 qps: 72.91 (r/w/o: 50.51/5.00/17.40) lat (ms,95%): 2585.31 err/s: 0.00 reconn/s: 0.00
&#091; 30s ] thds: 8 tps: 4.00 qps: 77.80 (r/w/o: 53.80/5.30/18.70) lat (ms,95%): 2120.76 err/s: 0.00 reconn/s: 0.00
&#091; 40s ] thds: 8 tps: 3.20 qps: 72.80 (r/w/o: 52.50/4.50/15.80) lat (ms,95%): 2632.28 err/s: 0.00 reconn/s: 0.00
&#091; 50s ] thds: 8 tps: 4.00 qps: 78.40 (r/w/o: 55.40/5.10/17.90) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00
&#091; 60s ] thds: 8 tps: 4.00 qps: 73.60 (r/w/o: 49.70/5.40/18.50) lat (ms,95%): 2632.28 err/s: 0.00 reconn/s: 0.00
&#091; 70s ] thds: 8 tps: 4.00 qps: 77.60 (r/w/o: 53.60/5.00/19.00) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00
&#091; 80s ] thds: 8 tps: 3.20 qps: 73.60 (r/w/o: 54.10/4.70/14.80) lat (ms,95%): 2405.65 err/s: 0.00 reconn/s: 0.00
&#091; 90s ] thds: 8 tps: 4.00 qps: 77.60 (r/w/o: 53.90/4.80/18.90) lat (ms,95%): 2082.91 err/s: 0.00 reconn/s: 0.00
&#091; 100s ] thds: 8 tps: 4.00 qps: 73.60 (r/w/o: 49.60/4.80/19.20) lat (ms,95%): 2493.86 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            5376
        write:                           501
        other:                           1803
        total:                           7680
    transactions:                        384    (3.78 per sec.)
    queries:                             7680   (75.60 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          101.5914s
    total number of events:              384

Latency (ms):
         min:                                 2000.71
         avg:                                 2115.55
         max:                                 2644.11
         95th percentile:                     2585.31
         sum:                               812371.47

Threads fairness:
    events (avg/stddev):           48.0000/0.00
    execution time (avg/stddev):   101.5464/0.07</code></pre>



<p class="wp-block-paragraph">We can see in this output, that I asked to sysbench to provide me with a feedback every 10 seconds. We can also observe that the ratio between the queries and transaction is respected (95%:5%), finally it can noted that the latency is important in our case (Server in US and client in Switzerland). The average latency in the above example is 2&#8217;115.55ms. If we are interested in the latency distribution we can use the option &#8211;histogram. </p>



<h2 class="wp-block-heading">Tests summary</h2>



<p class="wp-block-paragraph">We can find below the summary of the tests I did with the described configurations. </p>



<table cellspacing="2" border="1"><tbody>
<tr>
	<td align="right"></td><td colspan="4" align="center">East US</td><td colspan="4" align="center">West Switzerland</td>
</tr>
<tr>
	<td align="right"></td>
	<td colspan="2" align="center">1.Minimal configuration</td>
	<td colspan="2" align="center">2. General purpose</td>
	<td colspan="2" align="center">3.Minimal configuration</td><td colspan="2" align="center">4. General purpose</td>
</tr>
<tr>
	<td align="right">Number of Threads</td>
	<td align="right">trans./sec</td>
	<td align="right">queries/sec</td>
	<td align="right">trans./sec</td>
	<td align="right">queries/sec</td>
	<td align="right">trans./sec</td>
	<td align="right">queries/sec</td>
	<td align="right">trans./sec</td>
	<td align="right">queries/sec</td>
</tr>
<tr>
	<td align="right">8</td>
	<td align="right">3,78</td>
	<td align="right">75,6</td>
	<td align="right">3,73</td>
	<td align="right">74,63</td>
	<td align="right">27,91</td>
	<td align="right">559,82</td>
	<td align="right">28,06</td>
	<td align="right">561,13</td>
</tr>
<tr>
	<td align="right">16</td>
	<td align="right">7,95</td>
	<td align="right">150,94</td>
	<td align="right">7,46</td>
	<td align="right">149,22</td>
	<td align="right">54,13</td>
	<td align="right">1083,58</td>
	<td align="right">56,04</td>
	<td align="right">1120,71</td>
</tr>
<tr>
	<td align="right">32</td>
	<td align="right">15,14</td>
	<td align="right">303,02</td>
	<td align="right">15,52</td>
	<td align="right">310,61</td>
	<td align="right">102,33</td>
	<td align="right">2047,31</td>
	<td align="right">105,18</td>
	<td align="right">2103,62</td>
</tr><tr>
	<td align="right">64</td>
	<td align="right">29,1</td>
	<td align="right">588,85</td>
	<td align="right">30,74</td>
	<td align="right">614,91</td>
	<td align="right">178,78</td>
	<td align="right">3576</td>
	<td align="right">167,92</td>
	<td align="right">3358,82</td>
</tr>
<tr>
	<td align="right">128</td>
	<td align="right">58,87</td>
	<td align="right">1179,82</td>
	<td align="right">61,19</td>
	<td align="right">1225,15</td>
	<td colspan="2" align="right">too many conn.</td>
	<td align="right">191,83</td>
	<td align="right">3837,11</td>
</tr>
<tr>
	<td align="right">192</td>
	<td colspan="2" align="right">too many conn.</td>
	<td align="right">86,08</td>
	<td align="right">1722,69</td>
	<td colspan="2" align="right">too many conn.</td>
	<td align="right">176,63</td>
	<td align="right">3533,02</td>
</tr>
	<tr><td align="right">256</td>
	<td colspan="2" align="right">too many conn.</td>
	<td align="right">107,73</td>
	<td align="right">2158,16</td>
	<td colspan="2" align="right">too many conn.</td>
	<td align="right">161,66</td>
	<td align="right">3233,95</td>
</tr></tbody></table>



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



<p class="wp-block-paragraph">The first thing we can see after having a look on the above table is that whereas we faced a &#8220;too many connections&#8221; errors with minimal configurations, the tests worked properly with the General purpose configuration. </p>



<p class="wp-block-paragraph">The second thing that we can observe is that the tests performed better with the server located in West Switzerland. One of the reasons is most probably linked with the latency. Whereas we had an average of 2&#8217;100ms of latency for server located in East US, we have an average of 350ms of latency for server located in West Switzerland. </p>



<p class="wp-block-paragraph">Finally in our configuration, the increase of compute and storage doesn&#8217;t show any improvement in terms of transaction per second or queries per second. </p>



<h3 class="wp-block-heading">Latency between the application and the MySQL Server</h3>



<p class="wp-block-paragraph">The latency is an important parameter to take into consideration. As explained on Microsoft webpage named &#8220;Best practices for optimal performance of your Azure Database for MySQL server&#8221; to improve the performance of an application, we have to take into consideration the proximity between the MySQL Server and the application. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>To improve the performance and reliability of an application in a cost optimized deployment, it&#8217;s highly recommended that the web application service and the Azure Database for MySQL resource reside in the same region and availability zone. &#8211; <a href="https://docs.microsoft.com/en-us/azure/mysql/single-server/concept-performance-best-practices" target="_blank" rel="noreferrer noopener">Microsoft</a>,  16.08.2022</p></blockquote>



<p class="wp-block-paragraph">This page also gives some tips in order to optimize your MySQL performances on Azure. To check the latency, you do not need to use SysBench, a simple query such as the one executed in the below examples presents the latency difference between the execution on a localhost, an Azure server located in Switzerland and an Azure server located in US. </p>



<p class="wp-block-paragraph"><strong>Latency on a Localhost</strong></p>



<pre class="wp-block-code"><code>mysql&gt; select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (<strong>0.00 sec</strong>)
</code></pre>



<p class="wp-block-paragraph"><strong>Latency on an</strong> <strong>Azure Server located in West Switzerland</strong></p>



<pre class="wp-block-code"><code> MySQL  albatrozswitzerland.mysql.database.azure.com:3306 ssl SQL &gt; select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (<strong>0.0436 sec</strong>)</code></pre>



<p class="wp-block-paragraph"><strong>Latency on an</strong> <strong>Azure Server located in East US</strong></p>



<pre class="wp-block-code"><code> MySQL  albatroz.mysql.database.azure.com:3306 ssl SQL &gt; select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (<strong>0.1690 sec</strong>)</code></pre>



<p class="wp-block-paragraph">Considering only the latency, one could think that the application must be hosted on an Azure server in Switzerland (at least in my case). Unfortunately we will discover that not all services of the Microsoft Azure Cloud are available in Switzerland. For instance if we want to deploy an Ubuntu Server, we will see that only the following location are available: </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="486" height="384" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-012.png" alt="" class="wp-image-18505" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-012.png 486w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-012-300x237.png 300w" sizes="auto, (max-width: 486px) 100vw, 486px" /><figcaption>Ubuntu Server possible locations</figcaption></figure>
</div>


<h2 class="wp-block-heading">Performance monitoring</h2>



<p class="wp-block-paragraph">Microsoft Azure provides us with an interface showing the following default graphs (cf screenshot below: </p>



<ul class="wp-block-list"><li>CPU and Memory</li><li>IO Percent</li><li>DB Connections</li><li>Queries</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="294" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011-1024x294.png" alt="" class="wp-image-18476" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011-1024x294.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011-300x86.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011-768x220.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011-1536x441.png 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-011.png 1798w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>default performance graphs</figcaption></figure>



<p class="wp-block-paragraph">But you can add other information regarding storage, Host network in/out, replication lag, aborted connection, aso&#8230;</p>



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



<p class="wp-block-paragraph">This short blog regarding the performance of MySQL in the Azure Cloud provides the following conclusions: </p>



<p class="wp-block-paragraph">The ability to upgrade a MySQL server by adding CPU, disk and memory capacity in a few minutes is really interesting. For instance when you want to switch your test project to production, you simply need to change the servers properties and 10 minutes later, your server is adapted. Additionally, we can always reduce the CPU &amp; Memory capacity as well as the IOPS, only the storage cannot be reduced. </p>



<p class="wp-block-paragraph">At first glance, it also seems that it is very important to use a MySQL server close to the client for performance reasons (in order to avoid latency issues). Unfortunately depending on the application and business requirements it could be difficult to have the MySQL Server and the Application Server in the same country. </p>



<p class="wp-block-paragraph">Finally adding CPU, memory and increasing the number of IOPS did not show any improvement in the number of transactions or queries per second in this specific configuration (of course it&#8217;s strongly depending on the use case). However, this does not mean that by taking the time to configure the MySQL server correctly, one could not benefit from these additional capacities. Regarding the tuning of MySQL variables, it&#8217;s interesting to see that some variables are updated automatically such as the innodb_buffer_pool_size when we change server resources. </p>



<p class="wp-block-paragraph"></p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-2nd-part-performance-tests/">MySQL Server on Microsoft Azure 2nd part (Performance tests)</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/mysql-server-on-microsoft-azure-2nd-part-performance-tests/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL Server on Microsoft Azure 1st part (deployment)</title>
		<link>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-1st-part-deployment/</link>
					<comments>https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-1st-part-deployment/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 08:00:00 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Microsoft Azure]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=18458</guid>

					<description><![CDATA[<p>Introduction Did you know that you can run MySQL on Microsoft Azure for free for 30 days with a $200 credit? In this first blog I&#8217;ll show how to create a MySQL Server and provide few information related to this service. In futures blogs I&#8217;ll present insights regarding MySQL performances and backup/recovery. Let&#8217;s start by [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-1st-part-deployment/">MySQL Server on Microsoft Azure 1st part (deployment)</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="293" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-1024x293.png" alt="" class="wp-image-18459" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-1024x293.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-300x86.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001-768x220.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-001.png 1345w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Let&#8217;s try Azure Database for MySQL </figcaption></figure>



<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">Did you know that you can run MySQL on Microsoft Azure for free for 30 days with a $200 credit? In this first blog I&#8217;ll show how to create a MySQL Server and provide few information related to this service. In futures blogs I&#8217;ll present insights regarding MySQL performances and backup/recovery. </p>



<h2 class="wp-block-heading">Let&#8217;s start by registering ourselves</h2>



<p class="wp-block-paragraph">The registration process lasts approximately 5 to 10 minutes. We simply have to enter our contacts details as well as our credit card details. Don’t worry, no fees are automatically charged. Once your 200$ credit limit used, Microsoft will ask us if we want to keep on with the payment of the additional fees. &nbsp;</p>



<p class="wp-block-paragraph">In order to register ourselves on Microsoft Azure, we can simply go on the following URL: <a href="https://azure.microsoft.com/en-us/services/mysql/" target="_blank" rel="noreferrer noopener">https://azure.microsoft.com/en-us/services/mysql/</a> and click on &#8220;Try Azure Database for MySQL free&#8221; and  &#8220;Start free&#8221;. Then we enter our contact details such as country, name, surname, phone number, e-mail address, address, aso&#8230; Once finished, we will see a screen looking like the one below. We simply have to select the time zone and if we want to join a Q&amp;A session. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="778" height="520" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-002.png" alt="" class="wp-image-18460" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-002.png 778w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-002-300x201.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-002-768x513.png 768w" sizes="auto, (max-width: 778px) 100vw, 778px" /><figcaption>You&#8217;re ready to start with Azure!</figcaption></figure>
</div>


<h2 class="wp-block-heading">Our first MySQL Server on Azure</h2>



<p class="wp-block-paragraph">Once the registration process ended, it&#8217;s time to create our first MySQL Server on Azure. Log in into Microsoft Azure and enter “mysql” in the research field as shown below and select “Azure Database for MySQL servers”. &nbsp;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="273" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-003-1024x273.png" alt="" class="wp-image-18461" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-003-1024x273.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-003-300x80.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-003-768x205.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-003.png 1380w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Select &#8220;Azure Database for MySQL Server&#8221;</figcaption></figure>



<p class="wp-block-paragraph">Once &#8220;Azure Database for MySQL servers&#8221; selected, we simply have to click on &#8220;Create Azure Database for MySQL Server&#8221; on the next screen. We now have to select the deployment option. As shown below, we have the choice between the two following options: </p>



<ul class="wp-block-list"><li>Flexible Server (Recommended)</li><li>Single Server</li></ul>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-004-1024x658.png" alt="" class="wp-image-18462" width="840" height="539" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-004-1024x658.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-004-300x193.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-004-768x494.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-004.png 1237w" sizes="auto, (max-width: 840px) 100vw, 840px" /><figcaption>Choice between Flexible server and Single Server</figcaption></figure>



<p class="wp-block-paragraph">In the context of this blog, I chose the first option (Flexible server). </p>



<p class="wp-block-paragraph">Before deploying our first MySQL Server we have to follow a straightforward process which requires 4 steps described below. As we will see, depending on the workload type retained (which will affect the CPU, memory and possible IOPS), the storage and IOPS, the monthly fees will vary between USD 18.98/month and USD &gt;10&#8217;000/month. <br><br>What is really nice is to be able to see in real time the influence that each parameter has on the price estimate on the right hand side as we can see in the screenshot below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="761" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-005-1024x761.png" alt="" class="wp-image-18463" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-005-1024x761.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-005-300x223.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-005-768x571.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-005.png 1157w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>4 steps (in green) in order to complete your configuration</figcaption></figure>



<ol class="wp-block-list" type="1"><li>Firstly, we have to enter basic information regarding our MySQL Server such as :<ul><li>Subscription details,</li><li>Server name</li><li>Region where you want to deploy your server</li><li>MySQL Version (version 5.x or 8.x)</li><li>Workload type (Small or Medium Size database, Tier 1 Business Critical Workloads, for development of hobby projects)</li><li>Compute+Storage: Compute options &#8211;  (Burstable 1-20 vCores, General purpose 2-64 vCores or Business Critical 2-96 vCores). Storage options &#8211; from 20GB up to 16384GB (no scale down possibility) and from 360 to 48000IOPS</li></ul><ul><li>Availability Zone (optional)</li><li>Enable High-Availability (optional)</li><li>Administrator account<br><br></li></ul></li><li>Secondly, we have to fill in networking information regarding our MySQL Server such as:<ul><li>Network Connectivity (connect to your server through a public IP address or a Private Access)</li><li>Firewall rules (you can automatically select your current IP address or allow any remote connection)<br><br></li></ul></li><li>Thirdly, we can enter tags. Tags are name/value pairs that enable you to categorize and view consolidated billing by applying the same tag to multiple resources and resource groups.<br><br></li><li>We can finally review and create our server. Please note that we can also download a template for automation purpose.</li></ol>



<p class="wp-block-paragraph">In the compute option, you can select few options as presented below: </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="760" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-006-1024x760.png" alt="" class="wp-image-18464" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-006-1024x760.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-006-300x223.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-006-768x570.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-006.png 1287w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Compute + Storage options</figcaption></figure>
</div>


<p class="wp-block-paragraph">Once all the the fields completed we can create our server. It&#8217;s interesting to see that we also have the possibility to generate a template for automation purpose. </p>



<p class="wp-block-paragraph">On the summary page, you can see that you have access to the<a href="https://azure.microsoft.com/en-us/support/legal/" target="_blank" rel="noreferrer noopener"> Terms of Use</a> and <a href="https://privacy.microsoft.com/en-us/privacystatement" target="_blank" rel="noreferrer noopener">Privacy Policy</a>. In the Terms of Use we can find a link to the <a href="https://azure.microsoft.com/en-us/support/legal/sla/" target="_blank" rel="noreferrer noopener">SLA Conditions</a> where we can find the guaranteed service time as well as the credit in case of non compliance with the SLA conditions. </p>



<p class="wp-block-paragraph">The deployment and start-up of the server takes approximately 6 minutes.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="901" height="525" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-007.png" alt="" class="wp-image-18465" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-007.png 901w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-007-300x175.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-007-768x448.png 768w" sizes="auto, (max-width: 901px) 100vw, 901px" /></figure>



<h2 class="wp-block-heading">We have a server, let&#8217;s use it now!</h2>



<p class="wp-block-paragraph">In order to use our brand new MySQL Server, I decided to use MySQL Shell. MySQL Shell is a MySQL Client that provides scripting capabilities in JavaScript and Python. You can download MySQL Shell on this <a href="http://dev.mysql.com/downloads/shell/." target="_blank" rel="noreferrer noopener">link</a> and find MySQL Documentation on this <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/" target="_blank" rel="noreferrer noopener">link</a>. </p>



<p class="wp-block-paragraph">When we run MySQL Shell on Windows, a cmd window opens with a command prompt as shown below. To connect to our MySQL Server, we can use the &#8220;<em>connect</em>&#8221; keyword. and then switch in sql mode with the &#8220;<em>\sql</em>&#8221; command. </p>



<pre class="wp-block-code"><code>MySQL  JS &gt; \connect --mysql albatroz.mysql.database.azure.com
Creating a Classic session to 'grs@albatroz.mysql.database.azure.com'
Please provide the password for 'grs@albatroz.mysql.database.azure.com': *************
Save password for 'grs@albatroz.mysql.database.azure.com'? &#091;Y]es/&#091;N]o/Ne&#091;v]er (default No): yes
Fetching schema names for autocompletion... Press ^C to stop.
Your MySQL connection id is 20
Server version: 8.0.28 Source distribution
No default schema selected; type \use &lt;schema&gt; to set one.
 MySQL  albatroz.mysql.database.azure.com:3306 ssl  JS &gt; \sql
Switching to SQL mode... Commands end with ;</code></pre>



<p class="wp-block-paragraph">Using <em>show variables like &#8216;%version%&#8217;</em>; command provides us few information regarding the MySQL version as well as the Operating System in use. Version 8.0.28 is not the latest version but it is not old either since it dates from December 2021 and at the time of writing this blog, the latest version is 8.0.30.</p>



<pre class="wp-block-code"><code>MySQL  albatroz.mysql.database.azure.com:3306 ssl  SQL &gt; show variables like '%version%';
+--------------------------+---------------------+
| Variable_name            | Value               |
+--------------------------+---------------------+
| admin_tls_version        | TLSv1.2             |
| immediate_server_version | 999999              |
| innodb_version           | 8.0.28              |
| original_server_version  | 999999              |
| protocol_version         | 10                  |
| replica_type_conversions |                     |
| slave_type_conversions   |                     |
| tls_version              | TLSv1.2             |
| version                  | 8.0.28              |
| version_comment          | Source distribution |
| version_compile_machine  | x86_64              |
| version_compile_os       | Linux               |
| version_compile_zlib     | 1.2.11              |
+--------------------------+---------------------+
</code></pre>



<p class="wp-block-paragraph">After few tests, we can see some performance graphs (CPU and Memory, IO Percent, DB Connections and Queries) through the Azure interface. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="311" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-008-1024x311.png" alt="" class="wp-image-18466" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-008-1024x311.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-008-300x91.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-008-768x233.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/MySQLAzure-008.png 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>Few graphs regarding performance</figcaption></figure>
</div>


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



<p class="wp-block-paragraph">This first blog does not pretend to go into detail about the possibilities offered by Azure for the deployment of a MySQL server. It simply shows that deploying a MySQL server on the Azure Cloud is really simple. In addition, the $200 offered by Microsoft on the first 30 days of use allows you to have a first overview of the possibilities but also the costs related to a deployment in the Azure Cloud. The interface allows anyone to easily deploy a MySQL database in minutes.</p>



<p class="wp-block-paragraph">The next blog will discuss MySQL performance on the Azure Cloud through stress tests performed with SysBench.</p>



<p class="wp-block-paragraph"></p>
<p>L’article <a href="https://www.dbi-services.com/blog/mysql-server-on-microsoft-azure-1st-part-deployment/">MySQL Server on Microsoft Azure 1st part (deployment)</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/mysql-server-on-microsoft-azure-1st-part-deployment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Performance problems on a ZyWALL USG</title>
		<link>https://www.dbi-services.com/blog/performance-problems-on-a-zywall-usg/</link>
					<comments>https://www.dbi-services.com/blog/performance-problems-on-a-zywall-usg/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Wed, 10 Aug 2022 21:06:38 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[network bandwidth]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=18353</guid>

					<description><![CDATA[<p>Are you experiencing performance problems with your Zyxel ZyWALL USG firewall? You will find in this blog an example of a real case I faced and how I solved it. Introduction From one day to the next, network performance deteriorated. Users first reported sporadic access problems and then these problems became permanent. The performance problems [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/performance-problems-on-a-zywall-usg/">Performance problems on a ZyWALL USG</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="460" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-1024x460.jpg" alt="" class="wp-image-18397" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-1024x460.jpg 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-300x135.jpg 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-768x345.jpg 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-1536x690.jpg 1536w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/zywall-2048x921.jpg 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">ZyWALL USG 50</figcaption></figure>



<p class="wp-block-paragraph">Are you experiencing performance problems with your Zyxel ZyWALL USG firewall? You will find in this blog an example of a real case I faced and how I solved it.</p>



<h4 class="has-medium-font-size wp-block-heading">Introduction</h4>



<p class="wp-block-paragraph">From one day to the next, network performance deteriorated. Users first reported sporadic access problems and then these problems became permanent. The performance problems resulted in very slow access to a remote system. As shown below, the pings performed sometimes went up to more than a hundred milliseconds,</p>



<pre class="wp-block-code has-black-color has-text-color"><code>Pinging 8.8.8.8 with 32 bytes of data
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=63 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
<strong>Reply from 8.8.8.8: Bytes=32 time=562 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=519 ms TTL=116</strong>
Reply from 8.8.8.8: Bytes=32 time=211 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=31 ms TTL=116
<strong>Reply from 8.8.8.8: Bytes=32 time=617 ms TTL=116</strong>
Reply from 8.8.8.8: Bytes=32 time=100 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=19 ms TTL=116</code></pre>



<p class="wp-block-paragraph">Thanks to UDITIS, we were able to quickly isolate the problem and understood that it came from the firewall. In this case it was a ZyWALL USG 50 firewall.</p>



<p class="wp-block-paragraph">Logging into the ZyWALL USG GUI, we quickly saw that the processor resources were being used at over 90%. This had an impact on packet processing.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="554" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_001-1-1024x554.png" alt="" class="wp-image-18399" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_001-1-1024x554.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_001-1-300x162.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_001-1-768x416.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_001-1.png 1398w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Processor consumption at nearly 100%</figcaption></figure>



<h3 class="has-medium-font-size wp-block-heading">Problem analysis</h3>



<p class="wp-block-paragraph">Unfortunately the ZyWALL graphical interface does not give more details about the use of resources and does not allow to see what the processor or memory resources are used for. To analyze the problem, it is therefore necessary to connect to the Zywall via SSH.</p>



<p class="wp-block-paragraph"><a href="https://kb.zyxel.com/KB/searchArticle!gwsViewDetail.action?articleOid=015080&amp;lang=EN">As explained on the Zyxel support webpage</a>, we can use the command line &#8220;debug system show cpu status&#8221; to see the CPU usage details. For instance, if CPU time would have been spent on &#8220;softirq&#8221; it would have mean that the CPU was occupied with traffic load. In our case the CPU is occupied with a system item (currentrly 51%) and by user (currently 47%). </p>



<pre class="wp-block-code"><code>login as: admin
Using keyboard-interactive authentication.
Password:
Bad terminal type: "xterm". Will assume vt100.

Router&gt; <strong>debug system show cpu status</strong>
CPU utilization: 99 % (system: 51 %, user: 47 %, irq: 0 %, softirq 1 %)
CPU utilization (1 minute): 98 % (system: 48 %, user: 43 %, irq: 4 %, softirq 3 %)
CPU utilization (5 minute): 98 % (system: 47 %, user: 44 %, irq: 4 %, softirq 3 %)</code></pre>



<p class="wp-block-paragraph">To understand why the CPU is used by system item, we can use the command &#8220;<em>debug system ps</em>&#8220;. This command will help to see the different processes and the resources usage as presented below (extract). </p>



<pre class="wp-block-code"><code>Router&gt; debug system ps
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0    208   100 ?        Ss   Aug05   0:02 ini
root         2  0.0  0.0      0     0 ?        S&lt;   Aug05   1:01 &#091;kthreadd]
root       816  0.3  0.5   8464  1240 ?        Ss   Aug05   5:20 /usr/sbin/zylogd
root       820  0.0  0.1   1104   444 ?        Ss   Aug05   0:05 /usr/sbin/syslog-ng -f /var/zyxel/syslog-ng/syslog-ng.conf
root      1527  0.0  0.1   3760   404 ?        S    Aug05   0:00 /usr/sbin/pcap_monitor
root      1533  0.0  0.1   8920   340 ?        Ss   Aug05   0:00 /usr/sbin/vsd
root      1536  0.0  0.1   2588   276 ?        S&lt;   Aug05   0:00 /bin/zyshd_wd
root      1540  0.3  4.8  54304 11708 ?        S    Aug05   5:00 /bin/zyshd
root      1696  0.0  0.2   7068   664 ?        Ss   Aug05   0:00 /usr/sbin/xinetd -filelog /tmp/xinetd.log -stayalive -reuse -pidfile /var/run/xinetd.pid
root      1807  0.0  1.0  50108  2456 ?        Ss   Aug05   0:00 /usr/sbin/radiusd -d /var/zyxel/raddb
root      2297  0.0  0.1   2704   408 ?        S&lt;   Aug05   0:00 /sbin/resd
root      2303  0.0  0.8  35436  1944 ?        Ss   Aug05   0:04 /usr/sbin/contfltd
root      2382  0.0  0.0   2572   196 ?        Ss   Aug05   0:00 /sbin/lavd
root      2383  0.0  1.1  15836  2768 ?        S&lt;   Aug05   0:00 /sbin/decomp_server
root      2397  0.0  0.2  16212   632 ?        Ss   Aug05   0:00 /usr/sbin/fauthd
root      2412  0.0  0.1   2772   320 ?        S&lt;   Aug05   0:00 /sbin/wdtd
...
...
nobody   12843  0.0  1.5  41860  3804 ?        S    Aug05   0:00 /usr/local/apache/bin/httpd -f /usr/local/zyxel-gui/httpd.conf -k start -DSSL
nobody   12851  0.0  1.5  41860  3688 ?        S    Aug05   0:00 /usr/local/apache/bin/httpd -f /usr/local/zyxel-gui/httpd.conf -k start -DSSL
nobody   12852  0.0  1.6  44004  4108 ?        S    Aug05   0:00 /usr/local/apache/bin/httpd -f /usr/local/zyxel-gui/httpd.conf -k start -DSSL
<strong>root     20680 91.9  1.2  26976  3076 ?        R    10:18   4:31 /usr/local/sbin/snmpd udp:161,udp6:161 -c /var/zyxel/snmpd.conf -p /var/run/snmpd.pid</strong>
...
...
</code></pre>



<p class="wp-block-paragraph">As you can see, the SNMP process is using 91.9% of CPU usage. SNMP monitoring can be used to collect information from your USG. If you do not need it you can simply deactivate it through the graphical interface. In addition, it looks to be a good practice on the USG when not using this feature. In order to deactivate the SNMP functionality just go in Configuration section and then in System &gt; SNMP as shown below:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="642" height="468" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_002.png" alt="" class="wp-image-18400" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_002.png 642w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/08/USG_002-300x219.png 300w" sizes="auto, (max-width: 642px) 100vw, 642px" /><figcaption class="wp-element-caption">How to deactivate SNMP</figcaption></figure>
</div>


<p class="wp-block-paragraph">Once SNMP deactivated, Processor usages are freed up. </p>



<pre class="wp-block-code"><code>Router&gt; debug system show cpu status
<strong>CPU utilization: 12 % (system: 5 %, user: 2 %, irq: 3 %, softirq 2 %)</strong>
CPU utilization (1 minute): 78 % (system: 39 %, user: 33 %, irq: 3 %, softirq 3 %)
CPU utilization (5 minute): 92 % (system: 45 %, user: 41 %, irq: 3 %, softirq 3 %)
</code></pre>



<p class="wp-block-paragraph">The pings are now much more stable and there are no more spikes as we saw at the beginning.</p>



<pre class="wp-block-code"><code>Pinging 8.8.8.8 with 32 bytes of data
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=11 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=11 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
...
...
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
Reply from 8.8.8.8: Bytes=32 time=12 ms TTL=116
</code></pre>



<h3 class="has-medium-font-size wp-block-heading">Conclusion</h3>



<p class="wp-block-paragraph">In the event of a performance problem with a ZyWALL USG, the command line tool provided by ZyXEL allows you to understand what resources are being monopolized by. Once you have identified what was consuming the resources, in our case the SNMP process, you can either stop it or go further in the debugging process.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/performance-problems-on-a-zywall-usg/">Performance problems on a ZyWALL USG</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/performance-problems-on-a-zywall-usg/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Oracle Java Virtual Machine included in Oracle Database license ?</title>
		<link>https://www.dbi-services.com/blog/oracle-jvm-included-in-oracle-database-license/</link>
					<comments>https://www.dbi-services.com/blog/oracle-jvm-included-in-oracle-database-license/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Fri, 26 Mar 2021 10:05:36 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/oracle-jvm-included-in-oracle-database-license/</guid>

					<description><![CDATA[<p>Introduction A customer of mine asked me a licensing question regarding the usage or Oracle Java (OJVM) in an Oracle database.  Basically this customer have an Oracle Database Standard Edition License and would like to use Oracle JVM in order to load Java classes in his PL/SQL code executed by this database. The customer would [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-jvm-included-in-oracle-database-license/">Oracle Java Virtual Machine included in Oracle Database license ?</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Introduction</h3>
<p>A customer of mine asked me a licensing question regarding the usage or <strong>Oracle Java (OJVM) in an Oracle database</strong>.  Basically this customer have an Oracle Database Standard Edition License and would like to use Oracle JVM in order to load Java classes in his PL/SQL code executed by this database. The customer would like to ensure that his Oracle Database Standard Edition gives him the right to execute Java Classes in his PL/SQL code.</p>
<h3>Sources of information</h3>
<p>The question, even if looking obvious for some people, wasn&#8217;t so obvious for me.  Fact is that I wasn&#8217;t really able to find the information on Oracle documentation nor in a note on My Oracle Support. I started to ask to some of our internal Specialist such as <a href="https://www.dbi-services.com/on-the-company-and-its-associates/our-associates-and-certified-experts/pascal-brand/">Pascal Brand</a> and <a href="https://www.dbi-services.com/fr/dbi-services-et-ses-collaborateurs/equipe-dbi/franck-pachot/">Franck Pachot</a> in order to get some piece of answer. I use this opportunity to thanks both of them for their feedbacks ;-).</p>
<p>Both provided me some valuable inputs:</p>
<p>Their understanding was that the Java License is included in Oracle Database Standard Edition according to the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/dblic/Licensing-Information.html#GUID-AB354617-6614-487E-A022-7FC9A5A08472">following documentation</a>:</p>
<table width="100%">
<tbody>
<tr>
<td width="25%">Oracle Database Standard Edition 2</td>
<td width="10%">On-Premise</td>
<td width="18%">SE2</td>
<td width="47%">Oracle Database Standard Edition 2 includes features necessary to develop workgroup, department-level, and Web applications.</td>
</tr>
</tbody>
</table>
<p>In addition they provided me some MOS (My Oracle Support) notes were it was more clearly explained such as the note <a href="https://support.oracle.com/epmos/faces/DocContentDisplay?id=1557737.1">1557737.1</a>. as well as some link to the <a href="https://blogs.oracle.com/java-platform-group/oracle-java-se-releases-faq">Java FAQ</a> where the answer was even more explicit.</p>
<p style="padding-left: 40px"><em>&#8220;If you are an Oracle Customer with a supported Oracle product which requires Java SE, you continue to have access to Oracle Java updates, as required by your Oracle product, for the use of supported Oracle products, at no additional cost.&#8221;</em></p>
<p>Finally in order to be sure of my answer to the customer I wrote the following Service Request:</p>
<p style="padding-left: 40px"><em>Q:</em><br />
<em>=======</em><br />
<em>A question regarding Oracle Database Standard Edition and Java.</em></p>
<p style="padding-left: 40px"><em>We would like to use Oracle JVM in order to load Java classes in our PL/SQL code executed by a standard edition database. We would like to ensure that the Oracle Database Standard Edition gives us the right to execute Java Classes in PL/SQL code.</em></p>
<p style="padding-left: 40px"><em>Our understanding is that the Java License is included in Oracle Database Standard Edition according to the following documentation:</em><br />
<em>https://docs.oracle.com/en/database/oracle/oracle-database/19/dblic/Licensing-Information.html#GUID-AB354617-6614-487E-A022-7FC9A5A08472</em></p>
<p style="padding-left: 40px"><em>As far as we do understand we will however have to use the Java version provided by the Oracle Database located in the ORACLE_HOME. According to https://blogs.oracle.com/java-platform-group/oracle-java-se-releases-faq :</em><br />
<em>&#8220;If you are an Oracle Customer with a supported Oracle product which requires Java SE, you continue to have access to Oracle Java updates, as required by your Oracle product, for the use of supported Oracle products, at no additional cost.&#8221;</em></p>
<p style="padding-left: 40px"><em>May you please confirm that our understanding is correct, meaning that with Oracle Database Standard Edition, the Oracle Java is included and therefore we can load java classes in PL/SQL code without additional license ?</em></p>
<p>The answer from the support was crystal clear:</p>
<p style="padding-left: 40px"><em>A:</em><br />
<em>======</em><br />
<em>Yes, your understanding correct. Here in Oracle there are different Java products.</em><br />
<em>If you are going to use JAVAVM (Embedded JVM in Database) then DB license is enough. The embedded Database JVM is used to develop and load java source/ classes in database under custom schema.</em><br />
<em>These java stored procedures are wrapped with pl/sql and invoked by user.</em><br />
<em>ref: https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdev/Java-application-strategy.html#GUID-492B0C81-24A3-4551-A151-BC0DCE23C802</em></p>
<p style="padding-left: 40px"><em>Thank you.</em></p>
<h4>Conclusion</h4>
<p>Following these inputs I&#8217;ve been able to inform the customer that even with <strong>the Standard Database Edition he is fully allowed to load Java Classes in his PL/SQL Code</strong>. If you have doubts regarding usage of Java with Oracle products you will find some interesting information in the following note <a href="https://support.oracle.com/epmos/faces/DocContentDisplay?id=1557737.1">1557737.1</a>. I hope this small post will help some of you.</p>
<p>L’article <a href="https://www.dbi-services.com/blog/oracle-jvm-included-in-oracle-database-license/">Oracle Java Virtual Machine included in Oracle Database license ?</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-jvm-included-in-oracle-database-license/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Managing Licenses with AWS License Manager</title>
		<link>https://www.dbi-services.com/blog/aws-license-manager/</link>
					<comments>https://www.dbi-services.com/blog/aws-license-manager/#respond</comments>
		
		<dc:creator><![CDATA[Grégory Steulet]]></dc:creator>
		<pubDate>Wed, 25 Sep 2019 09:51:10 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[AWS License Manager]]></category>
		<category><![CDATA[AWS Systems Manager]]></category>
		<category><![CDATA[License]]></category>
		<category><![CDATA[licenses]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/aws-license-manager/</guid>

					<description><![CDATA[<p>Introduction Computing environments became more and more agile over these last years. Companies need to provide solutions helping people to quickly set up new resources, starting and stopping them, scaling them according to the need and finally, removing them. In such environments, it could be tricky to follow license compliance when resources are changing on [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/aws-license-manager/">Managing Licenses with AWS License Manager</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3><strong>Introduction</strong></h3>
<p>Computing environments became more and more agile over these last years. Companies need to provide solutions helping people to quickly set up new resources, starting and stopping them, scaling them according to the need and finally, removing them. In such environments, it could be tricky to follow license compliance when resources are changing on hourly basis.</p>
<p>Having a look on AWS services, I saw that AWS provides a license managing tool named “<em>AWS License Manager</em>”. I took few minutes in order to:</p>
<ul>
<li>Understand which resources this service is able to monitor</li>
<li>How it works</li>
<li>Test it with an on-premise Linux server executing an oracle database</li>
</ul>
<h3>License Manager Service</h3>
<p>The first step in order to use License Manager is to select it in the list of AWS Services.</p>
<p><figure id="attachment_34413" aria-describedby="caption-attachment-34413" style="width: 606px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-34413" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-Services-List.jpg" alt="AWS Services List" width="606" height="382" /><figcaption id="caption-attachment-34413" class="wp-caption-text">AWS Services List</figcaption></figure></p>
<p>After having clicked on AWS License Manager, the AWS License Manager window will appear.</p>
<p><img decoding="async" class="size-large wp-image-34553 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-License-Manager-License-Configuration.png" alt="&quot;&lt;yoastmark" /></p>
<p>Now, we simply have to create a license configuration with required license terms according to the software vendor. You can setup different kind of metrics such as</p>
<ul>
<li>vPCUs</li>
<li>Cores</li>
<li>Sockets</li>
<li>Instances</li>
</ul>
<p>License Manager also provides the possibility to enforce license limit, meaning that it prevents license usage after available licenses are exhausted.</p>
<p><figure id="attachment_34415" aria-describedby="caption-attachment-34415" style="width: 844px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-34415 size-full" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-Create-license-Configuration.jpg" alt="AWS Create License options" width="844" height="899" /><figcaption id="caption-attachment-34415" class="wp-caption-text">AWS Create License configuration</figcaption></figure></p>
<p>In a context of on-premise License monitoring, it is important to notice that sockets and cores license&#8217;s type are not accepted. Therefore, in this example I used vCPUs.</p>
<p><figure id="attachment_34520" aria-describedby="caption-attachment-34520" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-34520 size-large" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-Association-Error.png" alt="&quot;&lt;yoastmark" width="1024" height="97" /><figcaption id="caption-attachment-34520" class="wp-caption-text">Error while trying to associate Socket License to an on-premise host</figcaption></figure></p>
<h3><strong>AWS System Manager</strong></h3>
<p>Once the license configuration created, it&#8217;s now mandatory to use another AWS Service, <a href="https://aws.amazon.com/systems-manager">AWS System Manager</a>. This service allows you to view and control your infrastructure on AWS. AWS System Manager not only allows you to view and control your Amazon EC2 Instance but also on-premises servers, virtual machines (including VMs in other cloud environments). Some System Manager capabilities are not free, however in the context of this example everything is free.</p>
<h4><strong>AWS System Manager Agent (SSM Agent)</strong></h4>
<p>In order to benefit from AWS System Manager we need to install <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/prereqs-ssm-agent.html">AWS Systems Manager Agent</a> (SSM Agent) on our on-premised host. Indeed, SSM Agent is an Amazon software that can be installed and configured on an Amazon EC2 instance, an on-premises server, or a virtual machine (VM) and provides a solution to update, manage, and configure resources. SSM Agent is installed, by default on instances created from Windows Server 2016 and Windows Server 2019, Amazon Linux, Ubuntu Server Images AMIs. However, if you are running an on-premise server you need to install it. The process is really straightforward as presented below.</p>
<pre class="brush: actionscript3; gutter: true; first-line: 1">[root@vmrefdba01 ~]# mkdir /tmp/ssm
[root@vmrefdba01 ~]# curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm -o /tmp/ssm/amazon-ssm-agent.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 18.9M  100 18.9M    0     0  3325k      0  0:00:05  0:00:05 --:--:-- 4368k
[root@vmrefdba01 ~]# sudo yum install -y /tmp/ssm/amazon-ssm-agent.rpm
Loaded plugins: refresh-packagekit, ulninfo
Setting up Install Process
Examining /tmp/ssm/amazon-ssm-agent.rpm: amazon-ssm-agent-2.3.707.0-1.x86_64
Marking /tmp/ssm/amazon-ssm-agent.rpm to be installed
public_ol6_UEK_latest                                    | 2.5 kB     00:00
public_ol6_UEK_latest/primary_db                         |  64 MB     00:07
public_ol6_latest                                        | 2.7 kB     00:00
public_ol6_latest/primary_db                             |  18 MB     00:07
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package amazon-ssm-agent.x86_64 0:2.3.707.0-1 will be installed
--&gt; Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                            Arch                     Version                        Repository                           Size
======================================================================================================================================
Installing:
 amazon-ssm-agent                   x86_64                   2.3.707.0-1                    /amazon-ssm-agent                    61 M

Transaction Summary
======================================================================================================================================
Install       1 Package(s)

Total size: 61 M
Installed size: 61 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : amazon-ssm-agent-2.3.707.0-1.x86_64                                                                                1/1
amazon-ssm-agent start/running, process 3896
  Verifying  : amazon-ssm-agent-2.3.707.0-1.x86_64                                                                                1/1

Installed:
  amazon-ssm-agent.x86_64 0:2.3.707.0-1

Complete!</pre>
<h4>Creating an activation</h4>
<p>Once the agent installed, we have to create a new &#8220;<em>Activation</em>&#8221; in the AWS System Manager Service by clicking on &#8220;<em>Create activation</em>&#8220;. At the end of the creation you will get an Activation Code and an Activation ID (in the green field below). You have to keep this information for the agent configuration.</p>
<p><figure id="attachment_34417" aria-describedby="caption-attachment-34417" style="width: 988px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-34417" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-System-Manager-Activation.jpg" alt="AWS System Manager Activation" width="988" height="401" /><figcaption id="caption-attachment-34417" class="wp-caption-text">AWS System Manager Activation</figcaption></figure></p>
<h4></h4>
<h4><strong>Agent Configuration</strong></h4>
<p>In order to register your on-premise instance on AWS, you simply have to execute the following command with the activation code and activation id provided by AWS System Manager</p>
<pre class="brush: actionscript3; gutter: true; first-line: 1">sudo amazon-ssm-agent -register -code "<em>&lt;cf Activation Code&gt;</em>" -id "<em>&lt;cf Activation ID&gt;</em>" -region "us-east-2"

2019-09-19 13:53:05 INFO Successfully registered the instance with AWS SSM using Managed instance-id: mi-0756a9f0dc25be3cd</pre>
<p>Once registered the Managed Instance should appear as presented below in AWS Systems Manager</p>
<p><figure id="attachment_34518" aria-describedby="caption-attachment-34518" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-34518" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-System-Manager-Managed-Instances.png" alt="AWS System Manager - Managed Instances" width="1024" height="362" /><figcaption id="caption-attachment-34518" class="wp-caption-text">AWS Systems Manager &#8211; Managed Instances</figcaption></figure></p>
<p>The Platform type is detected as well as the Kernel version, IP address and computer name. AWS Systems Manager provides also a package inventory and many other kinds of inventory such as Network inventory, Files inventory, aso&#8230;</p>
<p><figure id="attachment_34519" aria-describedby="caption-attachment-34519" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-34519" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2019/09/AWS-System-Manager-Managed-Instances-Inventory.png" alt="AWS Systems Manager - Application Inventory" width="1024" height="410" /><figcaption id="caption-attachment-34519" class="wp-caption-text">AWS Systems Manager &#8211; Application Inventory</figcaption></figure></p>
<h3>Association between License Configuration and Resource ID</h3>
<p>We now have to make the link between the Managed Instance (resource) and the license configuration. The goal of course is to define which license configuration will be applied to which resource. In order to proceed, we have to go into the AWS License Manager, and select &#8220;Search Inventory&#8221; into the menu. Then we simply have to select the resource and then click on &#8220;Associate license Configuration&#8221;.</p>
<p><figure id="attachment_34521" aria-describedby="caption-attachment-34521" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-34521 size-large" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2019/09/AWS-License_manager-Associate-License-Configuration.png" alt="" width="1024" height="215" /><figcaption id="caption-attachment-34521" class="wp-caption-text">AWS License Manager &#8211; Search Inventory</figcaption></figure></p>
<p>The following window will appear, allowing you to define to which license configuration matches which resource:</p>
<p><img decoding="async" class="size-full wp-image-34522 aligncenter" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-License-Manager-Associate-license-configuration.jpg" alt="&quot;&lt;yoastmark" /></p>
<p>Having a look in the AWS License Manager Dashboard, you can see that 1 out of 1 license is consumed since I dedicated one vCPU to my virtual machine and I provided 1vCPU  license to this instance.</p>
<p><figure id="attachment_34523" aria-describedby="caption-attachment-34523" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-34523 size-large" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/AWS-License_manager-Dashboard.png" alt="&quot;&lt;yoastmark" width="1024" height="498" /><figcaption id="caption-attachment-34523" class="wp-caption-text">AWS License Manager &#8211; Dashboard</figcaption></figure></p>
<h3>Core Messages</h3>
<ul>
<li>AWS License Manager offers more functionalities for EC2 Instances than for on-premise servers.</li>
<li>AWS License Manager offers functionalities in order to monitor socket, vCPU, Cores and Instances.</li>
<li>AWS License Manager definitively helps to manage licenses but doesn&#8217;t fit with all requirements and license model.</li>
<li>AWS Systems Manager is a powerful tool providing several functionalities.</li>
</ul>
<h4><strong>Strenghts</strong></h4>
<ul>
<li>AWS License Manager is free.</li>
<li>AWS License Manager offers possibilities to monitor on-premise resources.</li>
<li>AWS License Manager provides solution in order to prevent instance to run if license compliance doesn&#8217;t fit.</li>
<li>AWS License Manager and AWS System Manager are straightforward to install and configure.</li>
<li>AWS License Manager and AWS System Manager offers a good documentation.</li>
<li>AWS System Manager offers many free functionalities (Patch Manager, Session Manager, Insights Dashboard, aso&#8230;).</li>
<li>AWS System Manager offers many  functionalities and is the basis of several other AWS tools such as AWS Config which allows to monitor instance&#8217;s compliance.</li>
</ul>
<h4><strong>Weaknesses</strong></h4>
<ul>
<li>AWS License Manager is not able by default to monitor options usage such as the ones of an Oracle database (Partitioning, Active Data Guard, aso&#8230;).</li>
<li>AWS License Manager is not able to calculate Oracle Processors, meaning taking into consideration core factors.</li>
<li>AWS System Manager is not able to monitor socket or cores on on-premise resources, only vCPUs.</li>
</ul>
<h3></h3>
<p>L’article <a href="https://www.dbi-services.com/blog/aws-license-manager/">Managing Licenses with AWS License Manager</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/aws-license-manager/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-07-17 14:10:05 by W3 Total Cache
-->