<?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>Docker Archives - Philipp Salvisberg&#039;s Blog</title>
	<atom:link href="https://www.salvis.com/blog/tag/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.salvis.com/blog/tag/docker/</link>
	<description>Database-centric development</description>
	<lastBuildDate>Tue, 05 Nov 2024 10:15:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.salvis.com/blog/wp-content/uploads/2014/04/favicon.png</url>
	<title>Docker Archives - Philipp Salvisberg&#039;s Blog</title>
	<link>https://www.salvis.com/blog/tag/docker/</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="hub" href="https://websubhub.com/hub"/>
<atom:link rel="self" href="https://www.salvis.com/blog/tag/docker/feed/"/>
	<item>
		<title>Oracle Database 23c on a Mac with an M-Series Chip</title>
		<link>https://www.salvis.com/blog/2023/04/16/oracle-database-23c-on-a-mac-with-an-m-series-chip/</link>
					<comments>https://www.salvis.com/blog/2023/04/16/oracle-database-23c-on-a-mac-with-an-m-series-chip/#comments</comments>
		
		<dc:creator><![CDATA[Philipp Salvisberg]]></dc:creator>
		<pubDate>Sun, 16 Apr 2023 14:49:07 +0000</pubDate>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Oracle 26ai]]></category>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=12304</guid>

					<description><![CDATA[<p>ARM Docker Images Now Available With the release of version 23.5 of Oracle Database 23ai, ARM builds are now available for Docker images. On the official Oracle Container Registry: And on Docker Hub provided by Gerald Venzl: This makes it very easy to use the Oracle Database on a Mac with an<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://www.salvis.com/blog/2023/04/16/oracle-database-23c-on-a-mac-with-an-m-series-chip/">Oracle Database 23c on a Mac with an M-Series Chip</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">ARM Docker Images Now Available</h2>



<p>With the release of version 23.5 of Oracle Database 23ai, ARM builds are now available for Docker images. </p>



<p>On the official <a href="https://container-registry.oracle.com/">Oracle Container Registry</a>:</p>



<figure class="wp-block-image size-full"><a href="https://www.salvis.com/blog/wp-content/uploads/2023/04/image.png"><img fetchpriority="high" decoding="async" width="989" height="200" src="https://www.salvis.com/blog/wp-content/uploads/2023/04/image.png" alt="" class="wp-image-13723" srcset="https://www.salvis.com/blog/wp-content/uploads/2023/04/image.png 989w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-300x61.png 300w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-768x155.png 768w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-150x30.png 150w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-480x97.png 480w" sizes="(max-width:767px) 480px, (max-width:989px) 100vw, 989px" /></a></figure>



<p>And on <a href="https://hub.docker.com/r/gvenzl/oracle-free/tags?name=arm">Docker Hub</a> provided by Gerald Venzl:</p>



<figure class="wp-block-image size-full"><a href="https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1.png"><img decoding="async" width="946" height="404" src="https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1.png" alt="" class="wp-image-13724" srcset="https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1.png 946w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1-300x128.png 300w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1-768x328.png 768w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1-150x64.png 150w, https://www.salvis.com/blog/wp-content/uploads/2023/04/image-1-480x205.png 480w" sizes="(max-width:767px) 480px, (max-width:946px) 100vw, 946px" /></a></figure>



<p>This makes it very easy to use the Oracle Database on a Mac with an Apple silicon chip.</p>



<h2 class="wp-block-heading">Starting Position</h2>



<p>I got my MacBook Pro 16&#8243; with an Apple M1 Max chip with 10 cores, 64 GB RAM and 4 TB disk in November 2021. At that time, the M1 chip had already been on the market for a year and I knew that there were problems when running virtual machines or Docker containers with the Intel x86_64 architecture. Most of my colleagues decided to go with a database instance in the cloud. However, I like the ability to develop offline and I often need an Oracle Database. And disk space is not an issue.</p>



<p>My solution was to <a href="https://twitter.com/phsalvisberg/status/1463365470984232960?s=20">run Windows on ARM in Parallels Desktop and install the Oracle Database</a> there. Microsoft did a tremendous job running Intel-based software under Windows on ARM. As far as I remember I did not experience a single crash. And the performance was similar to the Oracle Databases that ran in a Docker container on my Mac mini Server with a 2.3 GHz Intel Quad-Core i7.</p>



<p>I tried other solutions based on <a href="https://www.qemu.org/">QEMU</a> like <a href="https://mac.getutm.app/">UTM</a>, but the performance was unbearable slow. So, I lived with my Oracle Database under Windows. Happily until 4th April 2023. The release date of Oracle Database 23c Free.</p>



<h2 class="wp-block-heading">Oracle Database 23c Free</h2>



<p>The Oracle Database 23c Free is available as Linux RPM, VirtualBox VM or Docker image. There are two distributions for the Docker image:</p>



<ul class="wp-block-list">
<li>Oracle&#8217;s official image (<a href="https://container-registry.oracle.com/">container-registry.oracle.com/database/free</a>)</li>



<li>Gerald Venzl&#8217;s images (<a href="https://hub.docker.com/r/gvenzl/oracle-free">gvenzl/oracle-free</a>) in the flavours <code>thin</code>, <code>regular</code>, <code>full</code>&nbsp;and <code>faststart</code></li>
</ul>



<p>Gerald and the team at Oracle managed to allow us to download Oracle software without forcing us to log in and accept some license agreements. This is super cool, especially in CI environments.</p>



<p>Gerald mentions also the limitation regarding the <a href="https://github.com/gvenzl/oci-oracle-free#oracle-database-free-on-apple-m-chips">Oracle Database Free on Apple M chips</a> and points to <a href="https://github.com/abiosoft/colima">Colima</a>. I have not used Colima before, however, it sounds like the way to go until Oracle releases their flagship database system for <a href="https://en.wikipedia.org/wiki/ARM_architecture_family">ARM</a>.</p>



<h2 class="wp-block-heading">What is Colima?</h2>



<p>Colima provides an alternative context for Docker containers. Docker containers do not run natively on macOS. Instead, the context provides a virtual machine and the containers run there. The idea is that we do not need to know that there is a VM behind the scenes. Mostly.</p>



<p>Docker Desktop provides already a VM. Why do we need an alternative or an additional VM? Well, I see the following reasons:</p>



<ul class="wp-block-list">
<li>Firstly, you can use Colima as a replacement for Docker Desktop.</li>



<li>Secondly, you have more control over the configuration of the virtual machine, and this effectively allows you to run an Oracle Database in a Docker container on a macOS machine with an Apple M-Series chip.</li>
</ul>



<p>It&#8217;s important to note, that Colima can run side-by-side with Docker Desktop. You can change the current context via the <code>docker context</code> command. However, Docker Desktop 4.17.0 is not able to see &#8220;foreign&#8221; contexts. This means when you work with Colima you do that from the command line.</p>



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



<p>For the next steps, you will need the following:</p>



<ul class="wp-block-list">
<li>A Mac with an M-Series chip,</li>



<li>with macOS Ventura 13.3.1 or newer,</li>



<li>Internet access,</li>



<li>and the ability to work in a terminal window and execute <code>sudo</code> commands.</li>
</ul>



<p>So, let&#8217;s get started.</p>



<h2 class="wp-block-heading">Step 1 &#8211; Install Homebrew</h2>



<p>Run the following command in a terminal window, if you have not installed <a href="https://brew.sh/">homebrew</a> already:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">1a) Install homebrew</span><span role="button" tabindex="0" data-code="/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">/bin/bash</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-c</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;$(</span><span style="color: #DCDCAA">curl</span><span style="color: #CE9178"> </span><span style="color: #569CD6">-fsSL</span><span style="color: #CE9178"> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;</span></span></code></pre></div>



<p>If you already have installed homebrew, then update your installation as follows:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">1b) Update homebrew</span><span role="button" tabindex="0" data-code="brew update" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">brew</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">update</span></span></code></pre></div>



<p>You might be asked to upgrade outdated formulae. &#8211; You know what to do.</p>



<h2 class="wp-block-heading">Step 2 &#8211; Install Colima</h2>



<p>We install the stable version of Colima via homebrew. See the <a href="https://github.com/abiosoft/colima/blob/main/docs/INSTALL.md">installation guide</a> for all options.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">2) Install Colima</span><span role="button" tabindex="0" data-code="brew install colima" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">brew</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">install</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">colima</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 3 &#8211; Create Colima VM</h2>



<p>Now we can start Colima. The initial start creates the virtual machine. We pass a minimal set of parameters to override the defaults where necessary.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(234, 191, 191, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">3) Create Colima VM</span><span role="button" tabindex="0" data-code="colima start \
    --arch x86_64 \
    --vm-type=vz \
    --vz-rosetta \
    --mount-type=virtiofs \
    --memory 4" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">colima</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">start</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--arch</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">x86_64</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line cbp-line-highlight"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--vm-type=vz</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line cbp-line-highlight"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--vz-rosetta</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line cbp-line-highlight"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--mount-type=virtiofs</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--memory</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">4</span></span></code></pre></div>



<p>This command produces a VM with 2 CPUs, 4 GB RAM and 60 GB disk space. The architecture is x86_64. To improve the performance we use the virtualization framework of macOS 13 <code>vz</code>, enable Rosetta 2 and use the macOS-specific volume mount driver <code>virtiofs</code>.</p>



<p>The VM is created in <code>$HOME/.lima</code>. The configuration of the VM is stored in <code>$HOME/.colima/default/colima.yaml</code>. Most of the settings can be changed, but require a restart of the VM (via <code>colima restart</code> or <code>colima stop</code> followed by <code>colima start</code>).</p>



<p>Starting Colima changes the context to <code>colima</code> and stopping it changes it back to <code>default</code>. Use <code>docker context use</code> to change the context.</p>



<p><em><span class="highlight highlight-" style="background-color:Lemonchiffon;color:black;">Updated on 2023-04-19:</span>
 The <code>x86_64</code> architecture prohibits the use of Rosetta 2. Colima falls back silently to QEMU. Providing `<span class="s1">&#8211;arch aarch64` enables Rosetta 2. However, it will not be possible to start an Oracle Database. You will get the same errors as with the default Docker context. As a result, you do not need to pass the highlighted parameters.</span></em></p>



<h2 class="wp-block-heading">Step 4 &#8211; Create 23c Container</h2>



<p>We want to create a container with a volume mapped to a local directory. Due to various permission issues, it is not that simple to achieve that directly. It&#8217;s easier if we create an internal Docker volume (within the VM) first.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">4a) Create 23c Container</span><span role="button" tabindex="0" data-code="docker run -d \
    --name 23c \
    -p 1522:1521 \
    -v 23c-data:/opt/oracle/oradata \
    container-registry.oracle.com/database/free" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">run</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-d</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--name</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-p</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1522</span><span style="color: #CE9178">:1521</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-v</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c-data:/opt/oracle/oradata</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #CE9178">container-registry.oracle.com/database/free</span></span></code></pre></div>



<p>We use Oracle&#8217;s distribution of the image. It will be pulled automatically. The volume <code>23c-data</code> is also created automatically.</p>



<p>To monitor the console output we run the following command:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">4b) Monitor console output</span><span role="button" tabindex="0" data-code="docker logs -tf 23c" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">logs</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-tf</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span></span></code></pre></div>



<p>Here&#8217;s the log output with timestamps. The database was up and running after 38 seconds.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">4c) Console Output</span><span role="button" tabindex="0" data-code="2023-04-16T10:16:43.392545000Z Starting Oracle Net Listener.
2023-04-16T10:16:44.057130000Z Oracle Net Listener started.
2023-04-16T10:16:44.057316000Z Starting Oracle Database instance FREE.
2023-04-16T10:17:19.544454000Z Oracle Database instance FREE started.
2023-04-16T10:17:19.547911000Z 
2023-04-16T10:17:19.705193000Z The Oracle base remains unchanged with value /opt/oracle
2023-04-16T10:17:21.584419000Z #########################
2023-04-16T10:17:21.584722000Z DATABASE IS READY TO USE!
2023-04-16T10:17:21.584981000Z #########################
2023-04-16T10:17:21.669542000Z The following output is now a tail of the alert.log:
2023-04-16T10:17:21.720236000Z FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
2023-04-16T10:17:21.720480000Z 2023-04-16T10:17:17.657677+00:00
2023-04-16T10:17:21.720530000Z Completed: Pluggable database FREEPDB1 opened read write 
2023-04-16T10:17:21.720563000Z Completed: ALTER DATABASE OPEN
2023-04-16T10:17:21.720592000Z 2023-04-16T10:17:19.761876+00:00
2023-04-16T10:17:21.720620000Z ===========================================================
2023-04-16T10:17:21.720647000Z Dumping current patch information
2023-04-16T10:17:21.720673000Z ===========================================================
2023-04-16T10:17:21.720698000Z No patches have been applied
2023-04-16T10:17:21.720722000Z ===========================================================" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">2023-04-16T10:16:43.392545000Z Starting Oracle Net Listener.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:16:44.057130000Z Oracle Net Listener started.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:16:44.057316000Z Starting Oracle Database instance FREE.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:19.544454000Z Oracle Database instance FREE started.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:19.547911000Z </span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:19.705193000Z The Oracle base remains unchanged with value /opt/oracle</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.584419000Z #########################</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.584722000Z DATABASE IS READY TO USE!</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.584981000Z #########################</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.669542000Z The following output is now a tail of the alert.log:</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720236000Z FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720480000Z 2023-04-16T10:17:17.657677+00:00</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720530000Z Completed: Pluggable database FREEPDB1 opened read write </span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720563000Z Completed: ALTER DATABASE OPEN</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720592000Z 2023-04-16T10:17:19.761876+00:00</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720620000Z ===========================================================</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720647000Z Dumping current patch information</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720673000Z ===========================================================</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720698000Z No patches have been applied</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:17:21.720722000Z ===========================================================</span></span></code></pre></div>



<p>We can press Ctrl-C once we see this output.</p>



<h2 class="wp-block-heading">Step 5 &#8211; Change Passwords</h2>



<p>The database was created with random passwords for <code>SYS</code>, <code>SYSTEM</code> and <code>PDBADMIN</code>. To change them we run the following:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">5a) Change passwords</span><span role="button" tabindex="0" data-code="docker exec -it 23c ./setPassword.sh oracle" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-it</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">./setPassword.sh</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oracle</span></span></code></pre></div>



<p>As result, we expect the following SQL*Plus console output:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">5b) Console output</span><span role="button" tabindex="0" data-code="The Oracle base remains unchanged with value /opt/oracle

SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Sun Apr 16 10:18:57 2023
Version 23.2.0.0.0

Copyright (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; 
User altered.

SQL&gt; 
User altered.

SQL&gt; 
Session altered.

SQL&gt; 
User altered.

SQL&gt; Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">The Oracle base remains unchanged with value /opt/oracle</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Sun Apr 16 10:18:57 2023</span></span>
<span class="line"><span style="color: #D4D4D4">Version 23.2.0.0.0</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">Copyright (c) 1982, 2023, Oracle.  All rights reserved.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">Connected to:</span></span>
<span class="line"><span style="color: #D4D4D4">Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release</span></span>
<span class="line"><span style="color: #D4D4D4">Version 23.2.0.0.0</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL&gt; </span></span>
<span class="line"><span style="color: #D4D4D4">User altered.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL&gt; </span></span>
<span class="line"><span style="color: #D4D4D4">User altered.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL&gt; </span></span>
<span class="line"><span style="color: #D4D4D4">Session altered.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL&gt; </span></span>
<span class="line"><span style="color: #D4D4D4">User altered.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">SQL&gt; Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release</span></span>
<span class="line"><span style="color: #D4D4D4">Version 23.2.0.0.0</span></span></code></pre></div>



<p>That&#8217;s it if you are happy with a Docker volume.</p>



<p>If you&#8217;d like the volume to be mapped to a local directory on your Mac, then read on.</p>



<h2 class="wp-block-heading">Step 6 &#8211; Export Volume</h2>



<p>There are several ways to export a volume. The following script uses a helper container to access the volume and copy the content to the local directory which we want to use in the future as the replacement for the Docker volume.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">6) Export Volume</span><span role="button" tabindex="0" data-code="docker stop 23c
mkdir -p $HOME/docker/23c-data
docker run --rm \
    -v 23c-data:/source \
    -v $HOME/docker:/target \
    ubuntu tar czvf /target/23c-data.tar.gz /source
sudo tar xvpfz $HOME/docker/23c-data.tar.gz \
    --strip-components=1 -C $HOME/docker/23c-data
" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">stop</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span></span>
<span class="line"><span style="color: #DCDCAA">mkdir</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-p</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data</span></span>
<span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">run</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--rm</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-v</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c-data:/source</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-v</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker:/target</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #CE9178">ubuntu</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">tar</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">czvf</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/target/23c-data.tar.gz</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/source</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">tar</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">xvpfz</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data.tar.gz</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--strip-components=1</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-C</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data</span></span>
<span class="line"></span></code></pre></div>



<h2 class="wp-block-heading">Step 7 &#8211; Change Permissions</h2>



<p>We used <code>sudo tar xvpfz...</code> previously to ensure that we can create all files in the target directory with the same permissions as in the original Docker volume. However, this does not seem to be enough.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">7a) Change Permissions</span><span role="button" tabindex="0" data-code="sudo chown 54321:54321 $HOME/docker/23c-data
sudo chmod -R 777 $HOME/docker/23c-data
sudo chmod 4640 $HOME/docker/23c-data/dbconfig/FREE/orapwFREE" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">chown</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">54321</span><span style="color: #CE9178">:54321</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">chmod</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-R</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">777</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">chmod</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">4640</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data/dbconfig/FREE/orapwFREE</span></span></code></pre></div>



<p><code>orapwFREE</code> is the password file. It needs restrictive permission to work.</p>



<p>If you&#8217;d like to have the user <code>oracle</code> and the group <code>oinstall</code> also on your Mac, then you can run the following:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">7b) Create group oinstall and user oracle</span><span role="button" tabindex="0" data-code="sudo dscl . -create /Groups/oinstall
sudo dscl . -create /Groups/oinstall name oinstall
sudo dscl . -create /Groups/oinstall gid 54321
sudo dscl . -create /Users/oracle
sudo dscl . -create /Users/oracle name oracle
sudo dscl . -create /Users/oracle uid 54321
sudo dscl . -create /Users/oracle PrimaryGroupID 54321
sudo dseditgroup -o edit -a oracle -t user oinstall
sudo dseditgroup -o edit -a $USER -t user oinstall
sudo dscl . -create /Groups/oinstall GroupMembership oracle
sudo dscl . -create /Groups/oinstall GroupMembership $USER" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Groups/oinstall</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Groups/oinstall</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">name</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oinstall</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Groups/oinstall</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">gid</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">54321</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Users/oracle</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Users/oracle</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">name</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oracle</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Users/oracle</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">uid</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">54321</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Users/oracle</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">PrimaryGroupID</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">54321</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dseditgroup</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-o</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">edit</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-a</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oracle</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-t</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">user</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oinstall</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dseditgroup</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-o</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">edit</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-a</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$USER</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-t</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">user</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oinstall</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Groups/oinstall</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">GroupMembership</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">oracle</span></span>
<span class="line"><span style="color: #DCDCAA">sudo</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">dscl</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">.</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-create</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/Groups/oinstall</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">GroupMembership</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$USER</span></span></code></pre></div>



<p>After that the output of <code>cd $HOME/docker;ls -lR 23c-data</code> should look similar to this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">7c) Volume privileges</span><span role="button" tabindex="0" data-code="total 0
drwxrwxrwx  15 oracle  oinstall  480 Apr 16 12:16 FREE
drwxrwxrwx   3 oracle  oinstall   96 Apr 16 12:16 dbconfig

23c-data/FREE:
total 4928904
drwxrwxrwx  7 oracle  oinstall         224 Apr 16 12:16 FREEPDB1
-rwxrwxrwx  1 oracle  oinstall    18759680 Apr 16 12:19 control01.ctl
-rwxrwxrwx  1 oracle  oinstall    18759680 Mar 28 15:28 control02.ctl
drwxrwxrwx  6 oracle  oinstall         192 Apr 16 12:16 pdbseed
-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:16 redo01.log
-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:19 redo02.log
-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:16 redo03.log
-rwxrwxrwx  1 oracle  oinstall   576724992 Apr 16 12:19 sysaux01.dbf
-rwxrwxrwx  1 oracle  oinstall  1216356352 Apr 16 12:19 system01.dbf
-rwxrwxrwx  1 oracle  oinstall    20979712 Mar 28 15:24 temp01.dbf
-rwxrwxrwx  1 oracle  oinstall    26222592 Apr 16 12:19 undotbs01.dbf
-rwxrwxrwx  1 oracle  oinstall     5251072 Apr 16 12:19 users01.dbf

23c-data/FREE/FREEPDB1:
total 1464400
-rwxrwxrwx  1 oracle  oinstall  325066752 Apr 16 12:19 sysaux01.dbf
-rwxrwxrwx  1 oracle  oinstall  293609472 Apr 16 12:19 system01.dbf
-rwxrwxrwx  1 oracle  oinstall   20979712 Apr 16 12:17 temp01.dbf
-rwxrwxrwx  1 oracle  oinstall  104865792 Apr 16 12:19 undotbs01.dbf
-rwxrwxrwx  1 oracle  oinstall    5251072 Apr 16 12:19 users01.dbf

23c-data/FREE/pdbseed:
total 1454144
-rwxrwxrwx  1 oracle  oinstall  325066752 Mar 28 15:27 sysaux01.dbf
-rwxrwxrwx  1 oracle  oinstall  293609472 Mar 28 15:27 system01.dbf
-rwxrwxrwx  1 oracle  oinstall   20979712 Mar 28 15:25 temp01.dbf
-rwxrwxrwx  1 oracle  oinstall  104865792 Mar 28 15:27 undotbs01.dbf

23c-data/dbconfig:
total 0
drwxrwxrwx  8 oracle  oinstall  256 Apr 16 12:16 FREE

23c-data/dbconfig/FREE:
total 48
-rwxrwxrwx  1 oracle  oinstall   449 Mar 28 15:28 listener.ora
-rwSr-----  1 oracle  oinstall  2048 Apr 16 12:19 orapwFREE
-rwxrwxrwx  1 oracle  oinstall   779 Mar 28 15:28 oratab
-rwxrwxrwx  1 oracle  oinstall  3584 Apr 16 12:17 spfileFREE.ora
-rwxrwxrwx  1 oracle  oinstall    69 Mar 28 15:28 sqlnet.ora
-rwxrwxrwx  1 oracle  oinstall   690 Mar 28 15:28 tnsnames.ora" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">total 0</span></span>
<span class="line"><span style="color: #D4D4D4">drwxrwxrwx  15 oracle  oinstall  480 Apr 16 12:16 FREE</span></span>
<span class="line"><span style="color: #D4D4D4">drwxrwxrwx   3 oracle  oinstall   96 Apr 16 12:16 dbconfig</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">23c-data/FREE:</span></span>
<span class="line"><span style="color: #D4D4D4">total 4928904</span></span>
<span class="line"><span style="color: #D4D4D4">drwxrwxrwx  7 oracle  oinstall         224 Apr 16 12:16 FREEPDB1</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    18759680 Apr 16 12:19 control01.ctl</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    18759680 Mar 28 15:28 control02.ctl</span></span>
<span class="line"><span style="color: #D4D4D4">drwxrwxrwx  6 oracle  oinstall         192 Apr 16 12:16 pdbseed</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:16 redo01.log</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:19 redo02.log</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   209715712 Apr 16 12:16 redo03.log</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   576724992 Apr 16 12:19 sysaux01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  1216356352 Apr 16 12:19 system01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    20979712 Mar 28 15:24 temp01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    26222592 Apr 16 12:19 undotbs01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall     5251072 Apr 16 12:19 users01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">23c-data/FREE/FREEPDB1:</span></span>
<span class="line"><span style="color: #D4D4D4">total 1464400</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  325066752 Apr 16 12:19 sysaux01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  293609472 Apr 16 12:19 system01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   20979712 Apr 16 12:17 temp01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  104865792 Apr 16 12:19 undotbs01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    5251072 Apr 16 12:19 users01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">23c-data/FREE/pdbseed:</span></span>
<span class="line"><span style="color: #D4D4D4">total 1454144</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  325066752 Mar 28 15:27 sysaux01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  293609472 Mar 28 15:27 system01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   20979712 Mar 28 15:25 temp01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  104865792 Mar 28 15:27 undotbs01.dbf</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">23c-data/dbconfig:</span></span>
<span class="line"><span style="color: #D4D4D4">total 0</span></span>
<span class="line"><span style="color: #D4D4D4">drwxrwxrwx  8 oracle  oinstall  256 Apr 16 12:16 FREE</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">23c-data/dbconfig/FREE:</span></span>
<span class="line"><span style="color: #D4D4D4">total 48</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   449 Mar 28 15:28 listener.ora</span></span>
<span class="line"><span style="color: #D4D4D4">-rwSr-----  1 oracle  oinstall  2048 Apr 16 12:19 orapwFREE</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   779 Mar 28 15:28 oratab</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall  3584 Apr 16 12:17 spfileFREE.ora</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall    69 Mar 28 15:28 sqlnet.ora</span></span>
<span class="line"><span style="color: #D4D4D4">-rwxrwxrwx  1 oracle  oinstall   690 Mar 28 15:28 tnsnames.ora</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 8 &#8211; Remove Container &amp; Volume</h2>



<p>Now we can remove the existing 23c Container and its associated volume.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">8) Remove Container &amp; Volume</span><span role="button" tabindex="0" data-code="docker rm 23c
docker volume prune -f" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">rm</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span></span>
<span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">volume</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">prune</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-f</span></span></code></pre></div>



<h2 class="wp-block-heading">Step 9 &#8211; Recreate 23c Container</h2>



<p>Finally, we recreate the container as in step 4. The only difference is the volume. We use now a local directory.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(234, 191, 191, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">9a) Recreate 23c Container</span><span role="button" tabindex="0" data-code="docker run -d \
    --name 23c \
    -p 1522:1521 \
    -v $HOME/docker/23c-data:/opt/oracle/oradata \
    container-registry.oracle.com/database/free" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">run</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-d</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">--name</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-p</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1522</span><span style="color: #CE9178">:1521</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line cbp-line-highlight"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">-v</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">$HOME</span><span style="color: #CE9178">/docker/23c-data:/opt/oracle/oradata</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #CE9178">container-registry.oracle.com/database/free</span></span></code></pre></div>



<p>To monitor the console output we run the following command:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">9b) Monitor console output</span><span role="button" tabindex="0" data-code="docker logs -tf 23c" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">logs</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-tf</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">23</span><span style="color: #CE9178">c</span></span></code></pre></div>



<p>Here&#8217;s the log output with timestamps. The database was up and running after 40 seconds.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">9c) Console Output</span><span role="button" tabindex="0" data-code="2023-04-16T10:27:31.320723000Z Starting Oracle Net Listener.
2023-04-16T10:27:31.958206000Z Oracle Net Listener started.
2023-04-16T10:27:31.958391000Z Starting Oracle Database instance FREE.
2023-04-16T10:28:08.401153000Z Oracle Database instance FREE started.
2023-04-16T10:28:08.404032000Z 
2023-04-16T10:28:08.520502000Z The Oracle base remains unchanged with value /opt/oracle
2023-04-16T10:28:11.555842000Z #########################
2023-04-16T10:28:11.565430000Z DATABASE IS READY TO USE!
2023-04-16T10:28:11.565936000Z #########################
2023-04-16T10:28:11.670669000Z The following output is now a tail of the alert.log:
2023-04-16T10:28:11.697019000Z FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
2023-04-16T10:28:11.697309000Z 2023-04-16T10:28:07.384593+00:00
2023-04-16T10:28:11.697423000Z Completed: Pluggable database FREEPDB1 opened read write 
2023-04-16T10:28:11.697460000Z 2023-04-16T10:28:07.573292+00:00
2023-04-16T10:28:11.697490000Z ===========================================================
2023-04-16T10:28:11.697518000Z Dumping current patch information
2023-04-16T10:28:11.697545000Z ===========================================================
2023-04-16T10:28:11.697581000Z No patches have been applied
2023-04-16T10:28:11.697606000Z ===========================================================
2023-04-16T10:28:11.697633000Z Completed: ALTER DATABASE OPEN" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">2023-04-16T10:27:31.320723000Z Starting Oracle Net Listener.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:27:31.958206000Z Oracle Net Listener started.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:27:31.958391000Z Starting Oracle Database instance FREE.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:08.401153000Z Oracle Database instance FREE started.</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:08.404032000Z </span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:08.520502000Z The Oracle base remains unchanged with value /opt/oracle</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.555842000Z #########################</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.565430000Z DATABASE IS READY TO USE!</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.565936000Z #########################</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.670669000Z The following output is now a tail of the alert.log:</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697019000Z FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697309000Z 2023-04-16T10:28:07.384593+00:00</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697423000Z Completed: Pluggable database FREEPDB1 opened read write </span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697460000Z 2023-04-16T10:28:07.573292+00:00</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697490000Z ===========================================================</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697518000Z Dumping current patch information</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697545000Z ===========================================================</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697581000Z No patches have been applied</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697606000Z ===========================================================</span></span>
<span class="line"><span style="color: #D4D4D4">2023-04-16T10:28:11.697633000Z Completed: ALTER DATABASE OPEN</span></span></code></pre></div>



<p>We can press Ctrl-C once we see this output.</p>



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



<p>Thanks to the prepared database files within the Docker image we can start an Oracle Database quite fast. Even on a Mac with an M-Series chip.&nbsp; Mounting a folder as a volume needs a bit of fiddling. I like to mount volumes this way because they are easy to share and I can reset the underlying VM without losing data.</p>



<p>The runtime performance of the Database in a Colima container is still bad, compared to my Intel i7 Mac mini and the Oracle Database under Windows on ARM. Depending on the workload it is 5 to 10 times slower. Sometimes even more.&nbsp; <del>I do not see a big difference with or without Rosetta 2. That&#8217;s a bit disappointing. Maybe I do something wrong and someone can point me in the right direction.</del> Microsoft showed what&#8217;s possible.</p>



<p>Anyway, I&#8217;m not sure if I&#8217;m going to use a database within Colima during my live demos. But I will definitely keep one ready as a backup.</p>



<p>Hopefully, Oracle will release an ARM version of their Database soon.</p>


<hr class="" style="margin:0 auto 30px;"/>




<p><em>Updated on 2022-11-02, Rosetta 2 cannot be used with X86_64 architecture. Colima silently falls back to QEMU. To use Rosetta 2 you need to pass <code>--arch aarch64</code> when creating the Colima VM. However, it will not be possible to start an Oracle Database. You will get the same errors as with the default Docker context. Added a note in step 3 and crossed out the relevant parts in the summary.</em></p>



<p><em>Updated on 2024-11-05, new section &#8220;ARM Docker Images Now Available&#8221; at the top of the post.</em></p>
<p>The post <a href="https://www.salvis.com/blog/2023/04/16/oracle-database-23c-on-a-mac-with-an-m-series-chip/">Oracle Database 23c on a Mac with an M-Series Chip</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.salvis.com/blog/2023/04/16/oracle-database-23c-on-a-mac-with-an-m-series-chip/feed/</wfw:commentRss>
			<slash:comments>43</slash:comments>
		
		
			</item>
		<item>
		<title>PL/SQL Cop for SonarQube 7.0</title>
		<link>https://www.salvis.com/blog/2018/03/11/pl-sql-cop-for-sonarqube-7-0/</link>
					<comments>https://www.salvis.com/blog/2018/03/11/pl-sql-cop-for-sonarqube-7-0/#comments</comments>
		
		<dc:creator><![CDATA[Philipp Salvisberg]]></dc:creator>
		<pubDate>Sun, 11 Mar 2018 17:51:46 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[PL/SQL Cop]]></category>
		<category><![CDATA[SonarQube]]></category>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=8181</guid>

					<description><![CDATA[<p>For the last two months, my Trivadis colleague Daniel Schutzbach and I have been working on the PL/SQL Cop plugin for SonarQube. The goal was to support the most recent SonarQube versions 5.6 LTS, 6.7 LTS and 7.0. Dani was doing the heavy lifting and my job was testing and minor bug<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://www.salvis.com/blog/2018/03/11/pl-sql-cop-for-sonarqube-7-0/">PL/SQL Cop for SonarQube 7.0</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>For the last two months, my Trivadis colleague Daniel Schutzbach and I have been working on the <a href="https://www.salvis.com/blog/plsql-cop-for-sonarqube/">PL/SQL Cop plugin for SonarQube</a>. The goal was to support the most recent SonarQube versions 5.6 LTS, 6.7 LTS and 7.0. Dani was doing the heavy lifting and my job was testing and minor bug fixing. Today I can proudly announce that we were successful and that we have released the following three plugins:</p>



<ul class="wp-block-list">
<li>PL/SQL Cop for SonarQube 4.5 LTS (tested with SonarQube 4.5, 4.5.7 and 5.1.2)</li>



<li>PL/SQL Cop for SonarQube 5.6 LTS (tested with SonarQube 5.6, 5.6.7, 6.0, 6.1, 6.2, 6.3, 6.3.1, 6.4, 6.5 and 6.6)</li>



<li>PL/SQL Cop for SonarQube 6.7 LTS (tested with SonarQube 6.7, 6.7.1, 6.7.2 and 7.0)</li>
</ul>



<p>In this blog post, I show how to set up a new SonarQube 7.0 server using Docker and analyze a PL/SQL project on my local machine with SonarQube Scanner. This post is a stripped-down version of my <a href="https://www.salvis.com/blog/2017/09/24/continuous-code-quality-for-plsql-with-docker/">Continuous Code Quality for PL/SQL with Docker</a> post. I assume you know about Docker and have it installed on your machine.</p>



<p>Here is the table of contents of the major steps.</p>



<ol class="wp-block-list">
<li><a href="#create_sonarqube_container">Create SonarQube Container</a></li>



<li><a href="#install_plsql_cop_for_sonarqube">Install PL/SQL Cop for SonarQube</a></li>



<li><a href="#install_plsql_cop">Install PL/SQL Cop (Command Line Utility)</a></li>



<li><a href="#install_sonarqube_scanner">Install SonarQube Scanner</a></li>



<li><a href="#configure_sonarqube">Configure SonarQube</a></li>



<li><a href="#analyze_plsql_project">Analyze a PL/SQL Project</a></li>



<li><a href="#view_result_in_sonarqube">View the Result in SonarQube</a></li>



<li><a href="#summary">Summary</a></li>
</ol>



<h2 class="wp-block-heading"><a name="create_sonarqube_container"></a>1. Create a SonarQube Container</h2>



<p>In this step, I create a standalone container for SonarQube 7.0 using defaults to keep it simple.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker run -d --name sq7 -p 9000:9000 sonarqube:7.0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">run</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-d</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--name</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sq7</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-p</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">9000</span><span style="color: #CE9178">:9000</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sonarqube:7.0</span></span></code></pre></div>



<h2 class="wp-block-heading"><a name="install_plsql_cop_for_sonarqube"></a>2. Install PL/SQL Cop for SonarQube</h2>



<p>To install the current version of PL/SQL Cop for SonarQube within the &#8220;sq7&#8221; container run</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker exec sq7 wget --no-check-certificate \
   https://www.salvis.com/blog?ddownload=8167 \
   -O /opt/sonarqube/extensions/plugins/sonar-plsql-cop-plugin-6.7.0.0.jar" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sq7</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">wget</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--no-check-certificate</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #CE9178">https://www.salvis.com/blog?ddownload=</span><span style="color: #B5CEA8">8167</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">-O</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/opt/sonarqube/extensions/plugins/sonar-plsql-cop-plugin-6.7.0.0.jar</span></span></code></pre></div>



<p>The wget command will be executed within the &#8220;sq7&#8221; container.&nbsp;Windows user have to replace the &#8220;\&#8221; with &#8220;^&#8221; when using CMD or with &#8220;`&#8221; when using PowerShell.</p>



<p>To load the plugin we need to restart the container.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker restart sq7" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">restart</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sq7</span></span></code></pre></div>



<p>We will complete the installation in step 5.</p>



<h2 class="wp-block-heading"><a name="install_plsql_cop"></a>3. Install PL/SQL Cop (Command Line Utility)</h2>



<p>Download <a href="https://www.salvis.com/blog/plsql-cop/">PL/SQL Cop</a>&nbsp;and unzip the downloaded file in a directory of your choice. I&#8217;ve installed it on my local machine in &#8220;<span class="s1">/usr/local/bin/tvdcc&#8221;.</span></p>



<h2 class="wp-block-heading"><a name="install_sonarqube_scanner"></a>4. Install SonarQube Scanner</h2>



<p>Download <a href="https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner">SonarQube Scanner</a>&nbsp;and unzip the downloaded file in a directory of your choice. I&#8217;ve installed it on my local machine in &#8220;/usr/local/opt/sonar-scanner<span class="s1">&#8220;.</span></p>



<h2 class="wp-block-heading"><a name="configure_sonarqube"></a>5. Configure SonarQube 7.0</h2>



<p>Open &#8220;http://localhost:9000&#8221; in your web browser and log in with username &#8220;admin&#8221; and password &#8220;admin&#8221;.</p>



<p>SonarQube asks you to provide a token name. Enter &#8220;cop&#8221; and press &#8220;Generate&#8221; and then &#8220;Continue&#8221; on the next page. Then the token name and the token will be shown in the upper right corner of the screen as follows:</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5.png"><img decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5.png" alt="" class="wp-image-8189" srcset="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_5-100x75.png 100w" sizes="(max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Copy your token text (39d483241393ddd5600e9c9348ced410c7903c1a) to the clipboard and store it somewhere. We will need it in step 6. Press &#8220;Skip this tutorial&#8221; in the upper right corner.</p>



<p>Click on &#8220;Administration&#8221; and the Category &#8220;Trivadis PL/SQL Cop&#8221; and change the &#8220;Path to PL/SQL Cop command line tvdcc executable&#8221; to the path according to step 3. In my case this is &#8220;/usr/local/bin/tvdcc/tvdcc.sh&#8221;. Press &#8220;Save&#8221; and you are done.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6.png"><img loading="lazy" decoding="async" width="1024" height="1479" src="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6.png" alt="" class="wp-image-8190" srcset="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-208x300.png 208w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-768x1109.png 768w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-709x1024.png 709w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-101x146.png 101w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-35x50.png 35w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_6-52x75.png 52w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<h2 class="wp-block-heading"><a name="analyze_plsql_project"></a>6. Analyze a PL/SQL Project</h2>



<p>Create a temporary directory (in my case &#8220;/Users/phs/demo&#8221; and type the following</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="git clone https://github.com/PhilippSalvisberg/plscope-utils.git" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">git</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">clone</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">https://github.com/PhilippSalvisberg/plscope-utils.git</span></span></code></pre></div>



<p>This will clone the <a href="https://github.com/PhilippSalvisberg/plscope-utils">plscope-utils</a> git repository. If you do not have Git installed you may <a href="https://github.com/PhilippSalvisberg/plscope-utils/archive/main.zip">download</a> the repository as a zip file and extract it.</p>



<p>Run the following command to analyze the PL/SQL packages of this project:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="cd plscope-utils/database/utils/package
sonar-scanner \
   -Dsonar.projectKey=plscope-utils:main \
   -Dsonar.sources=. \
   -Dsonar.login=39d483241393ddd5600e9c9348ced410c7903c1a" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">cd</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">plscope-utils/database/utils/package</span></span>
<span class="line"><span style="color: #DCDCAA">sonar-scanner</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">-Dsonar.projectKey=plscope-utils:main</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">-Dsonar.sources=.</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">-Dsonar.login=39d483241393ddd5600e9c9348ced410c7903c1a</span></span></code></pre></div>



<p>Windows users have to replace the &#8220;\&#8221; with &#8220;^&#8221; when using CMD or with &#8220;`&#8221; when using PowerShell.</p>



<h2 class="wp-block-heading"><a name="view_result_in_sonarqube"></a>7. View the Result in SonarQube</h2>



<p>Open &#8220;http://localhost:9000&#8221; in your web browser.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8.png" alt="" class="wp-image-8197" srcset="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_8-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;plscope-utils:main&#8221;, &nbsp;select the &#8220;Issues&#8221; tab for this project and select all rules.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10.png" alt="" class="wp-image-8199" srcset="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_10-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on an issue to see the source code line causing this issue.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11.png" alt="" class="wp-image-8201" srcset="https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2018/03/sq7_11-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<h2 class="wp-block-heading"><a name="summary"></a>8. Summary</h2>



<p>Setting up a SonarQube 7.0 server with Docker is no big deal. Installing the PL/SQL Cop plugin is simple as well. However, I have only shown the minimum configuration. For real projects, you will spend some time configuring your quality profiles and quality gates. A CI environment might help you to implement a fast quality feedback loop.</p>



<p>The audio-less video summarizes the major installation and configuration steps. I hope this will encourage you to try PL/SQL Cop.</p>



<figure class="wp-block-video"><video controls src="https://www.salvis.com/blog/wp-content/uploads/2018/03/SonarQube7Installation.mp4"></video></figure>
<p>The post <a href="https://www.salvis.com/blog/2018/03/11/pl-sql-cop-for-sonarqube-7-0/">PL/SQL Cop for SonarQube 7.0</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.salvis.com/blog/2018/03/11/pl-sql-cop-for-sonarqube-7-0/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		<enclosure url="https://www.salvis.com/blog/wp-content/uploads/2018/03/SonarQube7Installation.mp4" length="24398354" type="video/mp4" />

			</item>
		<item>
		<title>Continuous Code Quality for PL/SQL with Docker</title>
		<link>https://www.salvis.com/blog/2017/09/24/continuous-code-quality-for-plsql-with-docker/</link>
		
		<dc:creator><![CDATA[Philipp Salvisberg]]></dc:creator>
		<pubDate>Sun, 24 Sep 2017 11:16:49 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[PL/SQL Cop]]></category>
		<category><![CDATA[SonarQube]]></category>
		<guid isPermaLink="false">https://www.salvis.com/blog/?p=7733</guid>

					<description><![CDATA[<p>In this blog post, I show step-by-step how to set up a continuous code quality inspection environment for a PL/SQL project hosted on GitHub. I&#8217;m going to use a Docker container for SonarQube and another container for Jenkins. Here is the table of contents of the major steps. In the summary of<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://www.salvis.com/blog/2017/09/24/continuous-code-quality-for-plsql-with-docker/">Continuous Code Quality for PL/SQL with Docker</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this blog post, I show step-by-step how to set up a continuous code quality inspection environment for a PL/SQL project hosted on GitHub. I&#8217;m going to use a Docker container for SonarQube and another container for Jenkins.</p>



<p>Here is the table of contents of the major steps.</p>



<ol class="wp-block-list">
<li><a href="#install_docker">Install Docker</a></li>



<li><a href="#create_sonarqube_and_jenkins_container">Create SonarQube and Jenkins Container</a></li>



<li><a href="#install_plsql_cop_for_sonarqube">Install PL/SQL Cop for SonarQube</a></li>



<li><a href="#install_plsql_cop">Install PL/SQL Cop (Command Line Utility)</a></li>



<li><a href="#configure_sonarqube">Configure SonarQube</a></li>



<li><a href="#configure_jenkins">Configure Jenkins</a></li>



<li><a href="#create_code_analysis_job">Create Code Analysis Job</a></li>



<li><a href="#view_result_in_sonarqube">View the Result in SonarQube</a></li>



<li><a href="#summary">Summary</a></li>
</ol>



<p>In the summary of this post, you find an audio-less video completing the process within 3.5 minutes.</p>



<h2 class="wp-block-heading"><a name="install_docker"></a>1. Install Docker</h2>



<p>I&#8217;m assuming that you already have installed Docker on your machine. If not, download and install the free <a href="https://www.docker.com/community-edition">Docker Community Edition</a>&nbsp;including <a href="https://docs.docker.com/compose/install/#install-compose">Docker Compose</a>. I&#8217;m going to use <a href="https://docs.docker.com/docker-for-mac/install/">Docker for Mac</a>. But you may use <a href="https://docs.docker.com/docker-for-windows/install/">Docker for Windows</a> or a <a href="https://docs.docker.com/engine/installation/#server">Docker server</a> for one of the various supported Linux distributions. It is also possible to use a cloud provider, but the installation procedure will differ slightly.</p>



<p>You are ready for the next steps when the command</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker run --rm hello-world" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">run</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--rm</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">hello-world</span></span></code></pre></div>



<p>produces this output</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the &quot;hello-world&quot; image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
   executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
   to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">Hello from Docker!</span></span>
<span class="line"><span style="color: #D4D4D4">This message shows that your installation appears to be working correctly.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">To generate this message, Docker took the following steps:</span></span>
<span class="line"><span style="color: #D4D4D4">1. The Docker client contacted the Docker daemon.</span></span>
<span class="line"><span style="color: #D4D4D4">2. The Docker daemon pulled the &quot;hello-world&quot; image from the Docker Hub.</span></span>
<span class="line"><span style="color: #D4D4D4">3. The Docker daemon created a new container from that image which runs the</span></span>
<span class="line"><span style="color: #D4D4D4">   executable that produces the output you are currently reading.</span></span>
<span class="line"><span style="color: #D4D4D4">4. The Docker daemon streamed that output to the Docker client, which sent it</span></span>
<span class="line"><span style="color: #D4D4D4">   to your terminal.</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">To try something more ambitious, you can run an Ubuntu container with:</span></span>
<span class="line"><span style="color: #D4D4D4"> $ docker run -it ubuntu bash</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">Share images, automate workflows, and more with a free Docker ID:</span></span>
<span class="line"><span style="color: #D4D4D4"> https://cloud.docker.com/</span></span>
<span class="line"><span style="color: #D4D4D4"></span></span>
<span class="line"><span style="color: #D4D4D4">For more examples and ideas, visit:</span></span>
<span class="line"><span style="color: #D4D4D4"> https://docs.docker.com/engine/userguide/</span></span></code></pre></div>



<p>in your terminal window.</p>



<h2 class="wp-block-heading"><a name="create_sonarqube_and_jenkins_container"></a>2. Create SonarQube and Jenkins Container</h2>



<p>In this step, we create a container for SonarQube and another one for Jenkins. Jenkins will need to communicate with SonarQube. Docker Compose allows us to use hostnames instead of hard-coded IP addresses and to manage all involved containers together in a single YAML configuration file.</p>



<p>Create a &#8220;docker-compose.yml&#8221; file in a &#8220;plsqlcop&#8221; directory. The directory name is used to derive names for containers and volumes. In this case, the volumes will be named &#8220;plsqlcop_sonardata&#8221; and &#8220;plsqlcop_cidata&#8221;. For the container names, the default naming has been overridden.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7">plsqlcop/docker-compose.yml</span><span role="button" tabindex="0" data-code="version: &quot;3.0&quot;
services:
   sonar:
      image: &quot;sonarqube:5.1.2&quot;
      container_name: &quot;sonar&quot;
      environment:
         - SONARQUBE_JDBC_USERNAME=sonar
         - SONARQUBE_JDBC_PASSWORD=sonar
         - SONARQUBE_JDBC_URL=
      ports:
         - &quot;9010:9000&quot;
      volumes:
         - &quot;sonardata:/opt/sonarqube/data&quot;
   ci:
      image: &quot;jenkins/jenkins:2.79&quot;
      container_name: &quot;ci&quot;
      ports:
         - &quot;9020:8080&quot;
      volumes:
         - &quot;cidata:/var/jenkins_home&quot;
volumes:
   sonardata:
      external: false
   cidata:
      external: false" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">version</span><span style="color: #D4D4D4">: </span><span style="color: #CE9178">&quot;3.0&quot;</span></span>
<span class="line"><span style="color: #569CD6">services</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">sonar</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">image</span><span style="color: #D4D4D4">: </span><span style="color: #CE9178">&quot;sonarqube:5.1.2&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">container_name</span><span style="color: #D4D4D4">: </span><span style="color: #CE9178">&quot;sonar&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">environment</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">SONARQUBE_JDBC_USERNAME=sonar</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">SONARQUBE_JDBC_PASSWORD=sonar</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">SONARQUBE_JDBC_URL=</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">ports</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">&quot;9010:9000&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">volumes</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">&quot;sonardata:/opt/sonarqube/data&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">ci</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">image</span><span style="color: #D4D4D4">: </span><span style="color: #CE9178">&quot;jenkins/jenkins:2.79&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">container_name</span><span style="color: #D4D4D4">: </span><span style="color: #CE9178">&quot;ci&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">ports</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">&quot;9020:8080&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">volumes</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">         - </span><span style="color: #CE9178">&quot;cidata:/var/jenkins_home&quot;</span></span>
<span class="line"><span style="color: #569CD6">volumes</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">sonardata</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">external</span><span style="color: #D4D4D4">: </span><span style="color: #569CD6">false</span></span>
<span class="line"><span style="color: #D4D4D4">   </span><span style="color: #569CD6">cidata</span><span style="color: #D4D4D4">:</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #569CD6">external</span><span style="color: #D4D4D4">: </span><span style="color: #569CD6">false</span></span></code></pre></div>



<p>Make sure you are located in the directory where the &#8220;docker-compose.yml&#8221; file is stored. Then create the containers in the background by running</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker-compose up -d" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker-compose</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">up</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-d</span></span></code></pre></div>



<p>You should get an output similar to the following:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="Creating volume &quot;plsqlcop_sonardata&quot; with default driver
Creating volume &quot;plsqlcop_cidata&quot; with default driver
Creating ci ... 
Creating sonar ... 
Creating sonar
Creating sonar ... done" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">Creating volume &quot;plsqlcop_sonardata&quot; with default driver</span></span>
<span class="line"><span style="color: #D4D4D4">Creating volume &quot;plsqlcop_cidata&quot; with default driver</span></span>
<span class="line"><span style="color: #D4D4D4">Creating ci ... </span></span>
<span class="line"><span style="color: #D4D4D4">Creating sonar ... </span></span>
<span class="line"><span style="color: #D4D4D4">Creating sonar</span></span>
<span class="line"><span style="color: #D4D4D4">Creating sonar ... done</span></span></code></pre></div>



<h2 class="wp-block-heading"><a name="install_plsql_cop_for_sonarqube"></a>3. Install PL/SQL Cop for SonarQube</h2>



<p>To install the current version of PL/SQL Cop for SonarQube within the &#8220;sonar&#8221; container run</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker exec sonar wget --no-check-certificate https://www.salvis.com/blog?ddownload=6822 -O \
/opt/sonarqube/extensions/plugins/sonar-plsql-cop-plugin-2.1.1.jar" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sonar</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">wget</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--no-check-certificate</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">https://www.salvis.com/blog?ddownload=</span><span style="color: #B5CEA8">6822</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-O</span><span style="color: #D4D4D4"> </span><span style="color: #D7BA7D">\</span></span>
<span class="line"><span style="color: #D4D4D4">/opt/sonarqube/extensions/plugins/sonar-plsql-cop-plugin-2.1.1.jar</span></span></code></pre></div>



<p>Windows users please note, that the \ (backslash) at the end of the first line is just the Unix line-continuation character (as the ` (grave accent) in PowerShell), you should omit it. The wget command will be executed within the sonar container.</p>



<p>To load the plugin we need to restart the container.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker restart sonar" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">restart</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">sonar</span></span></code></pre></div>



<h2 class="wp-block-heading"><a name="install_plsql_cop"></a>4. Install PL/SQL Cop (Command Line Utility)</h2>



<p>To install the current version of PL/SQL Cop within the &#8220;ci&#8221; container run</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker exec -u 0 ci wget --no-check-certificate https://www.salvis.com/blog/?ddownload=6680 -O /opt/tvdcc.zip
docker exec -u 0 ci unzip /opt/tvdcc.zip -d /opt 
docker exec -u 0 ci bash -c &quot;mv /opt/tvdcc-* /opt/tvdcc&quot;  
docker exec -u 0 ci rm /opt/tvdcc.zip" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-u</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">ci</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">wget</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">--no-check-certificate</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">https://www.salvis.com/blog/?ddownload=</span><span style="color: #B5CEA8">6680</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-O</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/opt/tvdcc.zip</span></span>
<span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-u</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">ci</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">unzip</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/opt/tvdcc.zip</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-d</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/opt</span><span style="color: #D4D4D4"> </span></span>
<span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-u</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">ci</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">bash</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-c</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">&quot;mv /opt/tvdcc-* /opt/tvdcc&quot;</span><span style="color: #D4D4D4">  </span></span>
<span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-u</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">ci</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">rm</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/opt/tvdcc.zip</span></span></code></pre></div>



<p>Why do we need to install this component in the &#8220;ci&#8221; container and not in the &#8220;sonar&#8221; container? Well, the SonarQube scanner is executed in the &#8220;ci&#8221; container and gets the code analyzer from the SonarQube server. This increases the scalability of the code analyzers since just the analysis reports need to be sent to the SonarQube server. However, the PL/SQL Cop SonarQube plugin is a wrapper to the command line utility. This means that every Jenkins agent needs to have PL/SQL Cop installed in the location configured on the SonarQube server.</p>



<p>In an environment with multiple servers and multiple Jenkins agents, the PL/SQL Cop installations need to be identical on every agent.</p>



<h2 class="wp-block-heading"><a name="configure_sonarqube"></a>5. Configure SonarQube</h2>



<p>Open &#8220;http://localhost:9010&#8221; in your web browser.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01.png" alt="" class="wp-image-7759" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-01-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Press &#8220;Log in&#8221; in the upper right corner and login into SonarQube with the username &#8220;admin&#8221; and password &#8220;admin&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02.png"><img loading="lazy" decoding="async" width="276" height="216" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02.png" alt="" class="wp-image-7760" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02.png 276w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02-187x146.png 187w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02-50x39.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-02-96x75.png 96w" sizes="auto, (max-width:767px) 276px, 276px" /></a></figure>



<p>Click on &#8220;Settings&#8221; and the Category &#8220;Trivadis PL/SQL Cop&#8221; and change the &#8220;Path to PL/SQL Cop command line tvdcc executable&#8221; to &#8220;/opt/tvdcc/tvdcc.sh&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03.png"><img loading="lazy" decoding="async" width="1024" height="1365" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03.png" alt="" class="wp-image-7761" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03-225x300.png 225w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03-768x1024.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03-110x146.png 110w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03-38x50.png 38w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-03-56x75.png 56w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Press &#8220;Save Trivadis PL/SQL Cop Settings&#8221; and your done.</p>



<h2 class="wp-block-heading"><a name="configure_jenkins"></a>6. Configure Jenkins</h2>



<p>Open &#8220;http://localhost:9020&#8221; in your web browser.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01.png" alt="" class="wp-image-7766" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-01-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Jenkins generated during the container creation a password for the user admin. To get this password execute in a terminal window the following:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="docker exec ci cat /var/jenkins_home/secrets/initialAdminPassword" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">docker</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">exec</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">ci</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">cat</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">/var/jenkins_home/secrets/initialAdminPassword</span></span></code></pre></div>



<p>Copy the output into the clipboard and paste it into the &#8220;Administrator password&#8221; field in the browser window and press &#8220;Continue&#8221;.</p>



<p>Press on &#8220;Install Suggested Plugins&#8221;</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02.png" alt="" class="wp-image-7767" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-02-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Wait until all plugins are installed.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03.png" alt="" class="wp-image-7768" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-03-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Enter the requested fields and press &#8220;Save and Finish&#8221;. And on the next page Click on &#8220;Start Using Jenkins&#8221;</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04.png" alt="" class="wp-image-7769" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-04-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Mange Jenkins&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12.png" alt="" class="wp-image-7777" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-12-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Manage Plugins&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09.png" alt="" class="wp-image-7775" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-09-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Select &#8220;SonarQube Scanner for Jenkins&#8221; in the &#8220;Available&#8221; tab. Use the filter to find the entry. Press &#8220;Install without restart&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10.png" alt="" class="wp-image-7774" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-10-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Go back to top page&#8221; when the plugins have been installed successfully.</p>



<p>Click on &#8220;Manage Jenkins&#8221; (again) and then on &#8220;Global Tool Configuration&#8221;.</p>



<p>Within the Global Tool Configuration click on &#8220;Add SonarQube Scanner&#8221;, add a name for the scanner and press &#8220;Save&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15.png" alt="" class="wp-image-7780" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-15-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Configure System&#8221;.</p>



<p>Scroll down to the &#8220;SonarQube servers&#8221; section and click on &#8220;Add SonarQube&#8221;.</p>



<p>Enter &#8220;SonarQube 5.1.2&#8221; for name, enter &#8220;http://sonar:9000&#8221; for &#8220;Server URL&#8221;, select &#8220;5.1 or lower&#8221; in &#8220;Server version&#8221; and enter &#8220;jdbc:h2:tcp://sonar/sonar&#8221; for &#8220;Database URL&#8221;. Click on &#8220;Save&#8221; to complete the Jenkins configuration.</p>



<p>Please note, that we are accessing the host sonar via the internal network Docker Compose has set up for us. Therefore we have to use the default port 9000 and not port 9010 which we are using from outside, e.g. to access SonarQube in the web browser.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19.png"><img loading="lazy" decoding="async" width="1176" height="1680" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19.png" alt="" class="wp-image-7790" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19.png 1176w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-210x300.png 210w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-768x1097.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-717x1024.png 717w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-102x146.png 102w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-35x50.png 35w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-19-53x75.png 53w" sizes="auto, (max-width:767px) 480px, (max-width:1176px) 100vw, 1176px" /></a></figure>



<h2 class="wp-block-heading"><a name="create_code_analysis_job"></a>7. Create Code Analysis Job</h2>



<p>Click on &#8220;create new jobs&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20.png" alt="" class="wp-image-7792" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-20-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Enter &#8220;plscope-utils&#8221; and click on &#8220;Freestyle project&#8221;</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21.png" alt="" class="wp-image-7794" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-21-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on the &#8220;Source Code Management&#8221; tab, select &#8220;Git&#8221;, enter &#8220;https://github.com/PhilippSalvisberg/plscope-utils&#8221; for &#8220;Repository URL&#8221;, add &#8220;Sparse Checkout paths&#8221; in &#8220;Additional Behaviours&#8221;, enter &#8220;database/utils&#8221; for &#8220;Paths&#8221; and click on &#8220;Apply&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22.png" alt="" class="wp-image-7793" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-22-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Build Triggers&#8221; tab, select &#8220;Poll SCM&#8221;. Enter &#8220;H/15 * * * *&#8221; for &#8220;Schedule&#8221; and press &#8220;Apply&#8221;. This will look for changes in the Git repository every 15 minutes and starts a build if a change is detected.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23.png" alt="" class="wp-image-7795" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-23-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Build&#8221; tab and Scroll down to the Build section and add a &#8220;Execute SonarQube Scanner&#8221; build step.</p>



<p>Copy the following lines into the &#8220;Analysis properties&#8221;.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="sonar.projectKey=plscope-utils:main
sonar.projectName=plscope-utils
sonar.projectVersion=0.5.0
sonar.sources=database
sonar.language=plsqlcop" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">sonar.projectKey</span><span style="color: #D4D4D4">=plscope-utils:main</span></span>
<span class="line"><span style="color: #DCDCAA">sonar.projectName</span><span style="color: #D4D4D4">=plscope-utils</span></span>
<span class="line"><span style="color: #DCDCAA">sonar.projectVersion</span><span style="color: #D4D4D4">=0.5.0</span></span>
<span class="line"><span style="color: #DCDCAA">sonar.sources</span><span style="color: #D4D4D4">=database</span></span>
<span class="line"><span style="color: #DCDCAA">sonar.language</span><span style="color: #D4D4D4">=plsqlcop</span></span></code></pre></div>



<p>and click on &#8220;Save&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25.png" alt="" class="wp-image-7797" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-25-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Wait until the initial build is started or click on &#8220;Build Now&#8221; and then on &#8220;#1&#8221; (the first build job in the Build History).</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26.png" alt="" class="wp-image-7798" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-26-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;Console Output&#8221;.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27.png" alt="" class="wp-image-7799" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-27-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>The analysis result has been stored successfully in SonarQube and can now be queried via http://localhost:9010 .</p>



<p>Please note, that the link to SonarQube provided in the console output is not working, since it is referring a port of the internal Docker Compose network which is not accessible to your browser. However, it is possible to configure the external IP address and port for SonarQube in Jenkins and than this link will work.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28.png"><img loading="lazy" decoding="async" width="1143" height="3465" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28.png" alt="" class="wp-image-7800" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28.png 1143w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-99x300.png 99w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-768x2328.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-338x1024.png 338w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-48x146.png 48w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-16x50.png 16w, https://www.salvis.com/blog/wp-content/uploads/2017/09/ci-28-25x75.png 25w" sizes="auto, (max-width:767px) 480px, (max-width:1143px) 100vw, 1143px" /></a></figure>



<h2 class="wp-block-heading"><a name="view_result_in_sonarqube"></a>8. View the Result in SonarQube</h2>



<p>Open &#8220;http://localhost:9010&#8221; in your web browser.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04.png" alt="" class="wp-image-7815" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-04-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;plscope-utils&#8221;, &nbsp;select the &#8220;Issues&#8221; tab for this project and select all rules.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05.png" alt="" class="wp-image-7820" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-05-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>Click on &#8220;&gt;&#8221; at the right side of an issue to see the source code line causing this issue.</p>



<figure class="wp-block-image"><a href="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06.png"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06.png" alt="" class="wp-image-7818" srcset="https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06.png 1024w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06-300x225.png 300w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06-768x576.png 768w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06-195x146.png 195w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06-50x38.png 50w, https://www.salvis.com/blog/wp-content/uploads/2017/09/sonar-06-100x75.png 100w" sizes="auto, (max-width:767px) 480px, (max-width:1024px) 100vw, 1024px" /></a></figure>



<p>See&nbsp;<a href="https://www.sonarqube.org/features/clean-code/">https://www.sonarqube.org/features/clean-code/</a> for more information.</p>



<h2 class="wp-block-heading"><a name="summary"></a>9. Summary</h2>



<p>Setting up a continuous code quality inspection environment for a PL/SQL project with Docker is quite simple. The audio-less video documents the complete process.</p>



<p>Granted, for production use, you need to use a different database as SonarQube backbone, define some roles, manage users and probably integrate an Active Directory. That should not be too difficult, at least not technically.</p>



<p>But the most challenging part will be to agree on some rules, adapt your development process and improve your code quality over time. So, let&#8217;s get started.</p>



<figure class="wp-block-video"><video controls src="https://www.salvis.com/blog/wp-content/uploads/2017/09/Continuous_Code_Quality_for_PLSQL_with_Docker.mp4"></video></figure>
<p>The post <a href="https://www.salvis.com/blog/2017/09/24/continuous-code-quality-for-plsql-with-docker/">Continuous Code Quality for PL/SQL with Docker</a> appeared first on <a href="https://www.salvis.com/blog">Philipp Salvisberg&#039;s Blog</a>.</p>
]]></content:encoded>
					
		
		<enclosure url="https://www.salvis.com/blog/wp-content/uploads/2017/09/Continuous_Code_Quality_for_PLSQL_with_Docker.mp4" length="52523180" type="video/mp4" />

			</item>
	</channel>
</rss>
